[DTrace-devel] [PATCH v3 1/9] dt_lex: support '/' in probe descriptors
Kris Van Hees
kris.van.hees at oracle.com
Thu Jan 15 22:48:00 UTC 2026
On Tue, Jan 13, 2026 at 04:51:24PM +0000, Alan Maguire wrote:
> This will allow us to support paths in module descriptions.
>
> Signed-off-by: Alan Maguire <alan.maguire at oracle.com>
> ---
> libdtrace/dt_lex.l | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libdtrace/dt_lex.l b/libdtrace/dt_lex.l
> index fd70aa0a..a8268c44 100644
> --- a/libdtrace/dt_lex.l
> +++ b/libdtrace/dt_lex.l
> @@ -48,7 +48,7 @@ static size_t dt_input(char *buf, size_t max_size);
> %s S0 S1 S2 S3 S4 S5 SIDENT
>
> RGX_AGG "@"[a-zA-Z_][0-9a-zA-Z_]*
> -RGX_PSPEC [-$:a-zA-Z_.?*\\\[\]!][-$:0-9a-zA-Z_.`?*\\\[\]!]*
> +RGX_PSPEC [-$:a-zA-Z_.?*\\\[\]!][-$:0-9a-zA-Z_.`/?*\\\[\]!]*
This change makes it that / is allowed anywhere in a probe specification,
except as first character. That is a much wider change than what you propose
this patch to provide.
It also does not accomplish what you want, because if a probe specification
does not specify the provider name, a module name starting with / would be
reported as a syntax error.
Instead of introducing a change here, would it suffice to have the specified
library name be resolved by means of the /proc/$PID/maps file or something like
that, i.e. look at what the absolute path is of the library that matches the
provided module name? That avoids needing to change the probe specification
syntax while also avoiding the complexity of not knowing what the library
search path is for the task being traced.
> RGX_IDENT ([a-zA-Z_`][0-9a-zA-Z_`]*)|([0-9][0-9a-zA-Z_]*`[0-9a-zA-Z_`]*)
> RGX_INT ([0-9]+|0[xX][0-9A-Fa-f]+)[uU]?[lL]?[lL]?
> RGX_FP ([0-9]+("."?)[0-9]*|"."[0-9]+)((e|E)("+"|-)?[0-9]+)?[fFlL]?
> --
> 2.43.5
>
More information about the DTrace-devel
mailing list