public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] pid: USDT probes cannot have "-" as function name
@ 2026-02-09 18:35 Kris Van Hees
  2026-02-09 19:22 ` [DTrace-devel] " Eugene Loh
  0 siblings, 1 reply; 4+ messages in thread
From: Kris Van Hees @ 2026-02-09 18:35 UTC (permalink / raw)
  To: dtrace, dtrace-devel

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
 libdtrace/dt_pid.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libdtrace/dt_pid.c b/libdtrace/dt_pid.c
index 517b9265..ef97c8d9 100644
--- a/libdtrace/dt_pid.c
+++ b/libdtrace/dt_pid.c
@@ -1568,6 +1568,10 @@ dt_pid_create_usdt_probes(dtrace_probedesc_t *pdp, dtrace_hdl_t *dtp)
 	char *globpat = NULL;
 	int err = 0, i, nmatches = 0;
 
+	/* If the function name is "-", we're done. */
+	if (pdp->fun[0] == '-' && pdp->fun[1] == '\0')
+		return 0;
+
 	/* If it cannot end with a pid, we're done. */
 	if (pdp->prv[0] != '\0') {
 		char lastchar = pdp->prv[strlen(pdp->prv) - 1];
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [DTrace-devel] [PATCH] pid: USDT probes cannot have "-" as function name
  2026-02-09 18:35 [PATCH] pid: USDT probes cannot have "-" as function name Kris Van Hees
@ 2026-02-09 19:22 ` Eugene Loh
  2026-02-09 19:37   ` Kris Van Hees
  0 siblings, 1 reply; 4+ messages in thread
From: Eugene Loh @ 2026-02-09 19:22 UTC (permalink / raw)
  To: Kris Van Hees, dtrace, dtrace-devel

Could we have a little more explanation here?  Like, what is wrong with 
the current behavior (which is... to complain that the probe is not 
found?)?  And should any test check the behavior?

On 2/9/26 13:35, Kris Van Hees via DTrace-devel wrote:
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
>   libdtrace/dt_pid.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/libdtrace/dt_pid.c b/libdtrace/dt_pid.c
> index 517b9265..ef97c8d9 100644
> --- a/libdtrace/dt_pid.c
> +++ b/libdtrace/dt_pid.c
> @@ -1568,6 +1568,10 @@ dt_pid_create_usdt_probes(dtrace_probedesc_t *pdp, dtrace_hdl_t *dtp)
>   	char *globpat = NULL;
>   	int err = 0, i, nmatches = 0;
>   
> +	/* If the function name is "-", we're done. */
> +	if (pdp->fun[0] == '-' && pdp->fun[1] == '\0')
> +		return 0;
> +
>   	/* If it cannot end with a pid, we're done. */
>   	if (pdp->prv[0] != '\0') {
>   		char lastchar = pdp->prv[strlen(pdp->prv) - 1];

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [DTrace-devel] [PATCH] pid: USDT probes cannot have "-" as function name
  2026-02-09 19:22 ` [DTrace-devel] " Eugene Loh
@ 2026-02-09 19:37   ` Kris Van Hees
  2026-02-09 19:38     ` Eugene Loh
  0 siblings, 1 reply; 4+ messages in thread
From: Kris Van Hees @ 2026-02-09 19:37 UTC (permalink / raw)
  To: Eugene Loh; +Cc: Kris Van Hees, dtrace, dtrace-devel

On Mon, Feb 09, 2026 at 02:22:11PM -0500, Eugene Loh wrote:
> Could we have a little more explanation here?  Like, what is wrong with the
> current behavior (which is... to complain that the probe is not found?)? 
> And should any test check the behavior?

It is an optimization.  That is why I added it right above the test to see
if there is a pid in the provider name.  That was also an optimization.  In
both cases we bail if we can determine immediately that the presented probedesc
cannot be a USDT probe.

> On 2/9/26 13:35, Kris Van Hees via DTrace-devel wrote:
> > Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> > ---
> >   libdtrace/dt_pid.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
> > diff --git a/libdtrace/dt_pid.c b/libdtrace/dt_pid.c
> > index 517b9265..ef97c8d9 100644
> > --- a/libdtrace/dt_pid.c
> > +++ b/libdtrace/dt_pid.c
> > @@ -1568,6 +1568,10 @@ dt_pid_create_usdt_probes(dtrace_probedesc_t *pdp, dtrace_hdl_t *dtp)
> >   	char *globpat = NULL;
> >   	int err = 0, i, nmatches = 0;
> > +	/* If the function name is "-", we're done. */
> > +	if (pdp->fun[0] == '-' && pdp->fun[1] == '\0')
> > +		return 0;
> > +
> >   	/* If it cannot end with a pid, we're done. */
> >   	if (pdp->prv[0] != '\0') {
> >   		char lastchar = pdp->prv[strlen(pdp->prv) - 1];

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [DTrace-devel] [PATCH] pid: USDT probes cannot have "-" as function name
  2026-02-09 19:37   ` Kris Van Hees
@ 2026-02-09 19:38     ` Eugene Loh
  0 siblings, 0 replies; 4+ messages in thread
From: Eugene Loh @ 2026-02-09 19:38 UTC (permalink / raw)
  To: Kris Van Hees; +Cc: dtrace, dtrace-devel

Okay, but I like having some explanation like that in the commit 
message.  Anyhow,
Reviewed-by: Eugene Loh <eugene.loh@oracle.com>

On 2/9/26 14:37, Kris Van Hees wrote:
> On Mon, Feb 09, 2026 at 02:22:11PM -0500, Eugene Loh wrote:
>> Could we have a little more explanation here?  Like, what is wrong with the
>> current behavior (which is... to complain that the probe is not found?)?
>> And should any test check the behavior?
> It is an optimization.  That is why I added it right above the test to see
> if there is a pid in the provider name.  That was also an optimization.  In
> both cases we bail if we can determine immediately that the presented probedesc
> cannot be a USDT probe.
>
>> On 2/9/26 13:35, Kris Van Hees via DTrace-devel wrote:
>>> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
>>> ---
>>>    libdtrace/dt_pid.c | 4 ++++
>>>    1 file changed, 4 insertions(+)
>>>
>>> diff --git a/libdtrace/dt_pid.c b/libdtrace/dt_pid.c
>>> index 517b9265..ef97c8d9 100644
>>> --- a/libdtrace/dt_pid.c
>>> +++ b/libdtrace/dt_pid.c
>>> @@ -1568,6 +1568,10 @@ dt_pid_create_usdt_probes(dtrace_probedesc_t *pdp, dtrace_hdl_t *dtp)
>>>    	char *globpat = NULL;
>>>    	int err = 0, i, nmatches = 0;
>>> +	/* If the function name is "-", we're done. */
>>> +	if (pdp->fun[0] == '-' && pdp->fun[1] == '\0')
>>> +		return 0;
>>> +
>>>    	/* If it cannot end with a pid, we're done. */
>>>    	if (pdp->prv[0] != '\0') {
>>>    		char lastchar = pdp->prv[strlen(pdp->prv) - 1];

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-09 19:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-09 18:35 [PATCH] pid: USDT probes cannot have "-" as function name Kris Van Hees
2026-02-09 19:22 ` [DTrace-devel] " Eugene Loh
2026-02-09 19:37   ` Kris Van Hees
2026-02-09 19:38     ` Eugene Loh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox