[DTrace-devel] [PATCH 03/15] fix probe lookups mixing static and glob components

Nick Alcock nick.alcock at oracle.com
Thu Feb 23 12:36:44 UTC 2023


On 23 Feb 2023, Kris Van Hees via DTrace-devel stated:

> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>

Reviewed-by: Nick Alcock <nick.alcock at oracle.com>

> +	int			p_is_glob, m_is_glob, f_is_glob, n_is_glob;
>  
>  	/*
>  	 * If a probe id is provided, we can do a direct lookup.
> @@ -799,14 +800,22 @@ dt_probe_lookup(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp)
>  	 * specified as glob patterns (or the empty string), we need to loop
>  	 * through all probes and look for a match.
>  	 */
> +	desc = *pdp;
> +	desc.id = (p_is_glob << 3) | (m_is_glob << 2) | (f_is_glob << 1) |
> +		  n_is_glob;

... but someday we should change this frankly weird scheme for smuggling
nullity info into gmatch to something a bit less arcane! (I know it's
not obvious what to do or I'd have done it already...)



More information about the DTrace-devel mailing list