Skip to contentSkip to conversation

Do not convert "__" to "-" for stapsdt provider names

PATCH In review [email protected] 2 participants 2 messages Nov 20, 2025 – Nov 21, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Do not convert "__" to "-" for stapsdt provider names

From: Eugene Loh <[email protected]>

DTrace provides "__" to "-" conversion for USDT probe names.

Commit 4f58b864a0 ("support stapsdt ELF-note-defined static probes") included "__" to "-" conversion for stapsdt provider names and probe names. Commit 22932a9875
("selftests/usdt: add is-enabled stapsdt tests using semaphores") adds tests for both conversions.

Since SystemTap itself provides "__" to "-" conversion only for probe names, remove the conversion for stapsdt provider names.

---
 libdtrace/dt_pid.c                            |  1 -
 .../usdt/tst.stapsdt-notes-isenabled.r        | 24 ++++----
 .../usdt/tst.stapsdt-notes-isenabled.r.p      |  4 ++
 .../usdt/tst.stapsdt-notes-isenabled.sh       | 61 +++++++++++--------
 4 files changed, 52 insertions(+), 38 deletions(-)
 create mode 100755 test/unittest/usdt/tst.stapsdt-notes-isenabled.r.p
libdtrace/dt_pid.c +0 -1
index 7d6cfb4dc..fb3c59581 100644
@@ -1346,7 +1346,6 @@ dt_stapsdt_parse(dtrace_hdl_t *dtp, dt_proc_t *dpr, dtrace_probedesc_t *pdp,
 		if (strlen(prv) >= nhdr.n_descsz)
 			continue;
 		strncpy(prvname, prv, sizeof(prvname));
-		(void) strhyphenate(prvname);
 		prb = prv + strlen(prv) + 1;
 		if (strlen(prb) >= nhdr.n_descsz)
 			continue;
test/unittest/usdt/tst.stapsdt-notes-isenabled.r +12 -12
index b088b285f..19924aa6b 100644
@@ -1,13 +1,13 @@
-test:main:zero-probe
-test:main:one-probe:1
-test:main:two-probe:2:3
-test:main:three-probe:4:5:7
-test:main:four-probe:7:8:9:10
-test:main:five-probe:11:12:13:14:15
-test:main:six-probe:16:17:18:19:20:21
-test:main:seven-probe:22:23:24:25:26:27:28
-test:main:eight-probe:29:30:31:32:33:34:35:36
-test:main:nine-probe:37:38:39:40:41:42:43:44:45
-test:main:eleven-probe:56:57:58:59:60:61:62:63:64:65
-test:main:twelve-probe:67:68:69:70:71:72:73:74:75:76
+test__prov$pid:test:main:zero-probe
+test__prov$pid:test:main:one-probe:1
+test__prov$pid:test:main:two-probe:2:3
+test__prov$pid:test:main:three-probe:4:5:7
+test__prov$pid:test:main:four-probe:7:8:9:10
+test__prov$pid:test:main:five-probe:11:12:13:14:15
+test__prov$pid:test:main:six-probe:16:17:18:19:20:21
+test__prov$pid:test:main:seven-probe:22:23:24:25:26:27:28
+test__prov$pid:test:main:eight-probe:29:30:31:32:33:34:35:36
+test__prov$pid:test:main:nine-probe:37:38:39:40:41:42:43:44:45
+test__prov$pid:test:main:eleven-probe:56:57:58:59:60:61:62:63:64:65
+test__prov$pid:test:main:twelve-probe:67:68:69:70:71:72:73:74:75:76
 
test/unittest/usdt/tst.stapsdt-notes-isenabled.r.p new file +4 -0
new file mode 100755
index 000000000..234d1fa55
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# Replace pid in provider name with "$pid" for standardized output.
+{ sub(/^test__prov[0-9][0-9]*:/, "test__prov$pid:"); print; }
test/unittest/usdt/tst.stapsdt-notes-isenabled.sh +36 -25

103 lines not on this page · raw message

Signature · 1 line
2.47.3
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · On Thu, Nov 20, 2025 at 05:50:00PM -0500, [email protected] wrote:

From: Eugene Loh <[email protected]>

DTrace provides "__" to "-" conversion for USDT probe names.

Commit 4f58b864a0 ("support stapsdt ELF-note-defined static probes") included "__" to "-" conversion for stapsdt provider names and probe names. Commit 22932a9875
("selftests/usdt: add is-enabled stapsdt tests using semaphores") adds tests for both conversions.

Quoted 4 lines

Since SystemTap itself provides "__" to "-" conversion only for probe names, remove the conversion for stapsdt provider names.

Quoted 171 lines
---
 libdtrace/dt_pid.c                            |  1 -
 .../usdt/tst.stapsdt-notes-isenabled.r        | 24 ++++----
 .../usdt/tst.stapsdt-notes-isenabled.r.p      |  4 ++
 .../usdt/tst.stapsdt-notes-isenabled.sh       | 61 +++++++++++--------
 4 files changed, 52 insertions(+), 38 deletions(-)
 create mode 100755 test/unittest/usdt/tst.stapsdt-notes-isenabled.r.p
libdtrace/dt_pid.c +0 -1
index 7d6cfb4dc..fb3c59581 100644
@@ -1346,7 +1346,6 @@ dt_stapsdt_parse(dtrace_hdl_t *dtp, dt_proc_t *dpr, dtrace_probedesc_t *pdp,
 		if (strlen(prv) >= nhdr.n_descsz)
 			continue;
 		strncpy(prvname, prv, sizeof(prvname));
-		(void) strhyphenate(prvname);
 		prb = prv + strlen(prv) + 1;
 		if (strlen(prb) >= nhdr.n_descsz)
 			continue;
test/unittest/usdt/tst.stapsdt-notes-isenabled.r +12 -12
index b088b285f..19924aa6b 100644
@@ -1,13 +1,13 @@
-test:main:zero-probe
-test:main:one-probe:1
-test:main:two-probe:2:3
-test:main:three-probe:4:5:7
-test:main:four-probe:7:8:9:10
-test:main:five-probe:11:12:13:14:15
-test:main:six-probe:16:17:18:19:20:21
-test:main:seven-probe:22:23:24:25:26:27:28
-test:main:eight-probe:29:30:31:32:33:34:35:36
-test:main:nine-probe:37:38:39:40:41:42:43:44:45
-test:main:eleven-probe:56:57:58:59:60:61:62:63:64:65
-test:main:twelve-probe:67:68:69:70:71:72:73:74:75:76
+test__prov$pid:test:main:zero-probe
+test__prov$pid:test:main:one-probe:1
+test__prov$pid:test:main:two-probe:2:3
+test__prov$pid:test:main:three-probe:4:5:7
+test__prov$pid:test:main:four-probe:7:8:9:10
+test__prov$pid:test:main:five-probe:11:12:13:14:15
+test__prov$pid:test:main:six-probe:16:17:18:19:20:21
+test__prov$pid:test:main:seven-probe:22:23:24:25:26:27:28
+test__prov$pid:test:main:eight-probe:29:30:31:32:33:34:35:36
+test__prov$pid:test:main:nine-probe:37:38:39:40:41:42:43:44:45
+test__prov$pid:test:main:eleven-probe:56:57:58:59:60:61:62:63:64:65
+test__prov$pid:test:main:twelve-probe:67:68:69:70:71:72:73:74:75:76
 
test/unittest/usdt/tst.stapsdt-notes-isenabled.r.p new file +4 -0
new file mode 100755
index 000000000..234d1fa55
@@ -0,0 +1,4 @@
+#!/usr/bin/gawk -f
+
+# Replace pid in provider name with "$pid" for standardized output.
+{ sub(/^test__prov[0-9][0-9]*:/, "test__prov$pid:"); print; }
test/unittest/usdt/tst.stapsdt-notes-isenabled.sh +36 -25
index 322bf53aa..a839d5722 100755
@@ -83,67 +83,78 @@ if [ $? -ne 0 ]; then
 fi
 
 $dtrace -c ./test -qs /dev/stdin <<EOF
-test-prov\$target:::zero-probe
+test__prov\$target:::zero-probe
 {
-	printf("%s:%s:%s\n", probemod, probefunc, probename);
+	printf("%s:%s:%s:%s\n", probeprov, probemod, probefunc, probename);
 }
 
-test-prov\$target:::one-probe
+test__prov\$target:::one-probe
 {
-	printf("%s:%s:%s:%li\n", probemod, probefunc, probename, arg0);
+	printf("%s:%s:%s:%s:%li\n", probeprov, probemod, probefunc, probename,
+	       arg0);
 }
 
-test-prov\$target:::two-probe
+test__prov\$target:::two-probe
 {
-	printf("%s:%s:%s:%li:%li\n", probemod, probefunc, probename, arg0, arg1);
+	printf("%s:%s:%s:%s:%li:%li\n",
+	       probeprov, probemod, probefunc, probename,
+	       arg0, arg1);
 }
 
-test-prov\$target:::three-probe
+test__prov\$target:::three-probe
 {
-	printf("%s:%s:%s:%li:%li:%li\n", probemod, probefunc, probename, arg0, arg1,
-	       arg2);
+	printf("%s:%s:%s:%s:%li:%li:%li\n",
+	       probeprov, probemod, probefunc, probename,
+	       arg0, arg1, arg2);
 }
 
-test-prov\$target:::four-probe
+test__prov\$target:::four-probe
 {
-	printf("%s:%s:%s:%li:%li:%li:%li\n", probemod, probefunc, probename, arg0, arg1,
-	       arg2, arg3);
+	printf("%s:%s:%s:%s:%li:%li:%li:%li\n",
+	       probeprov, probemod, probefunc, probename,
+	       arg0, arg1, arg2, arg3);
 }
 
-test-prov\$target:::five-probe
+test__prov\$target:::five-probe
 {
-	printf("%s:%s:%s:%li:%li:%li:%li:%li\n", probemod, probefunc, probename,
+	printf("%s:%s:%s:%s:%li:%li:%li:%li:%li\n",
+	       probeprov, probemod, probefunc, probename,
 	       arg0, arg1, arg2, arg3, arg4);
 }
 
-test-prov\$target:::six-probe
+test__prov\$target:::six-probe
 {
-	printf("%s:%s:%s:%li:%li:%li:%li:%li:%li\n", probemod, probefunc, probename,
+	printf("%s:%s:%s:%s:%li:%li:%li:%li:%li:%li\n",
+	       probeprov, probemod, probefunc, probename,
 	       arg0, arg1, arg2, arg3, arg4, arg5);
 }
 
-test-prov\$target:::seven-probe
+test__prov\$target:::seven-probe
 {
-	printf("%s:%s:%s:%li:%li:%li:%li:%li:%li:%li\n", probemod, probefunc, probename,
+	printf("%s:%s:%s:%s:%li:%li:%li:%li:%li:%li:%li\n",
+	       probeprov, probemod, probefunc, probename,
 	       arg0, arg1, arg2, arg3, arg4, arg5, arg6);
 }
 
-test-prov\$target:::eight-probe
+test__prov\$target:::eight-probe
 {
-	printf("%s:%s:%s:%li:%li:%li:%li:%li:%li:%li:%li\n", probemod, probefunc, probename,
+	printf("%s:%s:%s:%s:%li:%li:%li:%li:%li:%li:%li:%li\n",
+	       probeprov, probemod, probefunc, probename,
 	       arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
 }
 
-test-prov\$target:::nine-probe
+test__prov\$target:::nine-probe
 {
-	printf("%s:%s:%s:%li:%li:%li:%li:%li:%li:%li:%li:%li\n", probemod, probefunc, probename,
+	printf("%s:%s:%s:%s:%li:%li:%li:%li:%li:%li:%li:%li:%li\n",
+	       probeprov, probemod, probefunc, probename,
 	       arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
 }
 
-test-prov\$target:::eleven-probe,
-test-prov\$target:::twelve-probe
+test__prov\$target:::eleven-probe,
+test__prov\$target:::twelve-probe
 {
-	printf("%s:%s:%s:%li:%li:%li:%li:%li:%li:%li:%li:%li:%li\n", probemod, probefunc, probename,
+	printf("%s:%s:%s:%s:%li:%li:%li:%li:%li:%li:%li:%li:%li:%li\n",
+	       probeprov, probemod, probefunc, probename,
 	       arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
 }
 EOF
Signature · 1 line
2.47.3