[DTrace-devel] [PATCH 06/19] Allow for USDT wildcards

Eugene Loh eugene.loh at oracle.com
Tue Sep 17 17:34:52 UTC 2024


This patch should really be part of a later patch (11/19 "Support USDT 
wildcard provider descriptions").  When the two changes are separated, 
the intervening patches are broken.

I'm withdrawing this patch, squashing it instead into the later 11/19 
patch.  I'll post a new version of that 11/19 patch.

On 8/29/24 01:25, eugene.loh at oracle.com wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
>
> To look for pid probes, we can require that the provider description
> should end in a digit.  For USDT probes, however, there can be wildcard
> descriptions.  This includes a blank provider description as well as
> a description that ends in an '*'.
>
> So expand the criteria appropriately.
> ---
>   libdtrace/dt_cc.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/libdtrace/dt_cc.c b/libdtrace/dt_cc.c
> index cfd4d3d1..a9934d10 100644
> --- a/libdtrace/dt_cc.c
> +++ b/libdtrace/dt_cc.c
> @@ -278,8 +278,9 @@ dt_setcontext(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp)
>   	 * On an error, dt_pid_create_probes() will set the error message
>   	 * and tag -- we just have to longjmp() out of here.
>   	 */
> -	if (pdp->prv && pdp->prv[0] &&
> -	    isdigit(pdp->prv[strlen(pdp->prv) - 1]) &&
> +	if (pdp->prv &&
> +	    (pdp->prv[0] == '\0' || isdigit(pdp->prv[strlen(pdp->prv) - 1]) ||
> +	             pdp->prv[strlen(pdp->prv) - 1] == '*') &&
>   	    ((pvp = dt_provider_lookup(dtp, pdp->prv)) == NULL ||
>   	     pvp->pv_flags & DT_PROVIDER_PID) &&
>   	    dt_pid_create_probes((dtrace_probedesc_t *)pdp, dtp, yypcb, 0) != 0) {



More information about the DTrace-devel mailing list