All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: eugene.loh@oracle.com
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH] Do not convert "__" to "-" for stapsdt provider names
Date: Thu, 20 Nov 2025 15:38:26 -0500	[thread overview]
Message-ID: <aR98Qjq2zwtEV3Bt@oracle.com> (raw)
In-Reply-To: <20251120185311.28904-1-eugene.loh@oracle.com>

On Thu, Nov 20, 2025 at 01:53:11PM -0500, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
> 
> DTrace converts "__" to "-" for USDT probe names, but not for functions,
> modules, or providers.  We document this behavior.
> 
> We provide the same conversion for stapsdt probe names, but we also
> convert stapsdt provider names and in commit 22932a9875
> ("selftests/usdt: add is-enabled stapsdt tests using semaphores") we
> test that conversion.
> 
> SystemTap performs the conversion for the probe name but not for the
> provider name.
> 
> Remove the conversion for stapsdt provider names.

I would rewrite this commit comment...

	DTrace provides "--" to "_" conversioon for USDT probe names.

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

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

> 
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
> ---
>  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
> 
> diff --git a/libdtrace/dt_pid.c b/libdtrace/dt_pid.c
> index 703be112e..39714bdb2 100644
> --- a/libdtrace/dt_pid.c
> +++ b/libdtrace/dt_pid.c
> @@ -1360,7 +1360,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;
> diff --git a/test/unittest/usdt/tst.stapsdt-notes-isenabled.r b/test/unittest/usdt/tst.stapsdt-notes-isenabled.r
> index b088b285f..19924aa6b 100644
> --- a/test/unittest/usdt/tst.stapsdt-notes-isenabled.r
> +++ b/test/unittest/usdt/tst.stapsdt-notes-isenabled.r
> @@ -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
>  
> diff --git a/test/unittest/usdt/tst.stapsdt-notes-isenabled.r.p b/test/unittest/usdt/tst.stapsdt-notes-isenabled.r.p
> new file mode 100755
> index 000000000..234d1fa55
> --- /dev/null
> +++ b/test/unittest/usdt/tst.stapsdt-notes-isenabled.r.p
> @@ -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; }
> diff --git a/test/unittest/usdt/tst.stapsdt-notes-isenabled.sh b/test/unittest/usdt/tst.stapsdt-notes-isenabled.sh
> index 322bf53aa..a839d5722 100755
> --- a/test/unittest/usdt/tst.stapsdt-notes-isenabled.sh
> +++ b/test/unittest/usdt/tst.stapsdt-notes-isenabled.sh
> @@ -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
> -- 
> 2.47.3
> 

      reply	other threads:[~2025-11-20 20:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 18:53 [PATCH] Do not convert "__" to "-" for stapsdt provider names eugene.loh
2025-11-20 20:38 ` Kris Van Hees [this message]

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=aR98Qjq2zwtEV3Bt@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=eugene.loh@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.