[DTrace-devel] [PATCH 2/2] pid: ignore compiler-generated internal function names

Kris Van Hees kris.van.hees at oracle.com
Mon Sep 12 18:19:27 UTC 2022


On Mon, Sep 12, 2022 at 02:08:20PM -0400, Eugene Loh via DTrace-devel wrote:
> Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> 
> Does a test show the underlying problem?  Would a test be helpful to include
> in this patch?

I do not know of a way to guarantee that we have an executable to test with
that has any such identifiers.  It is very compiler dependent and these special
identifiers are usually generated by the compiler based on optimization
decisions and not under the control of the developer.  They are meant to be
transparent.  In fact, I only happened to see this issue with a test in one
of my test environments where it worked perfectly fine elsewhere.

> While two spaces in ".  */" (twice in this patch) sometimes appears in our
> code base, it is much more common to have only one space before the "*/".
>
> On 9/12/22 13:04, Kris Van Hees via DTrace-devel wrote:
> > Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> > ---
> >   libdtrace/dt_pid.c | 8 +++++---
> >   1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libdtrace/dt_pid.c b/libdtrace/dt_pid.c
> > index fc338e0f..d6215dcc 100644
> > --- a/libdtrace/dt_pid.c
> > +++ b/libdtrace/dt_pid.c
> > @@ -277,12 +277,14 @@ dt_pid_sym_filt(void *arg, const GElf_Sym *symp, const char *func)
> >   		if (strcmp(func, "_init") == 0 || strcmp(func, "_fini") == 0)
> >   			return 0;
> > -		/*
> > -		 * Versioned identifiers are a problem.
> > -		 */
> > +		/* Versioned identifiers are a problem.  */
> >   		if (strchr(func, '@') != NULL)
> >   			return 0;
> > +		/* Compiler-generated internal identifiers are a problem.  */
> > +		if (strchr(func, '.') != NULL)
> > +			return 0;
> > +
> >   		if ((pp->dpp_last_taken = gmatch(func, pp->dpp_func)) != 0) {
> >   			pp->dpp_last = *symp;
> >   			return dt_pid_per_sym(pp, symp, func);
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list