From: Alan Maguire <alan.maguire@oracle.com>
To: dtrace@lists.linux.dev
Cc: dtrace-devel@oss.oracle.com, Alan Maguire <alan.maguire@oracle.com>
Subject: [PATCH v5 1/9] dt_lex: support '/' in probe descriptors
Date: Wed, 4 Mar 2026 08:01:17 +0000 [thread overview]
Message-ID: <20260304080125.649031-2-alan.maguire@oracle.com> (raw)
In-Reply-To: <20260304080125.649031-1-alan.maguire@oracle.com>
This will allow us to support paths in module descriptions.
Add '/' to regexp, but then constrain usage to probe module.
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
---
libdtrace/dt_lex.l | 2 +-
libdtrace/dt_subr.c | 6 ++++++
2 files changed, 7 insertions(+), 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_.`/?*\\\[\]!]*
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]?
diff --git a/libdtrace/dt_subr.c b/libdtrace/dt_subr.c
index 6d06c2b5..73db5939 100644
--- a/libdtrace/dt_subr.c
+++ b/libdtrace/dt_subr.c
@@ -119,6 +119,12 @@ dtrace_xstr2desc(dtrace_hdl_t *dtp, dtrace_probespec_t spec, const char *s,
memcpy(name + len, v, vlen);
memcpy(name + len + vlen, w, wlen);
+ /* Only allow '/' in probemod */
+ if (strchr(name, '/') != NULL && spec != DTRACE_PROBESPEC_MOD) {
+ free(name);
+ return dt_set_errno(dtp, EDT_BADPROBE);
+ }
+
switch (spec) {
case DTRACE_PROBESPEC_PROVIDER:
pdp->prv = name;
--
2.43.5
next prev parent reply other threads:[~2026-03-04 8:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 8:01 [PATCH v5 0/9] stapsdt provider: simple system-wide probing Alan Maguire
2026-03-04 8:01 ` Alan Maguire [this message]
2026-03-04 8:01 ` [PATCH v5 2/9] stapsdt provider: support systemwide probing Alan Maguire
2026-03-04 8:01 ` [PATCH v5 3/9] test: add systemwide stapsdt note test Alan Maguire
2026-03-04 8:01 ` [PATCH v5 4/9] test: add systemwide stapsdt note test using absolute path Alan Maguire
2026-03-04 8:01 ` [PATCH v5 5/9] test: add systemwide stapsdt note test for library Alan Maguire
2026-03-04 8:01 ` [PATCH v5 6/9] stapsdt: add test for listing systemwide probes in object Alan Maguire
2026-03-04 8:01 ` [PATCH v5 7/9] stapsdt: add test for listing systemwide probes in absolute path object Alan Maguire
2026-03-04 8:01 ` [PATCH v5 8/9] stapsdt: add systemwide test for is-enabled probes Alan Maguire
2026-03-04 8:01 ` [PATCH v5 9/9] documentation: update stapsdt docs to describe wildcard support Alan Maguire
2026-03-04 8:25 ` [PATCH v5 0/9] stapsdt provider: simple system-wide probing Alan Maguire
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260304080125.649031-2-alan.maguire@oracle.com \
--to=alan.maguire@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox