public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Nick Alcock <nick.alcock@oracle.com>
Cc: Eugene Loh <eugene.loh@oracle.com>,
	dtrace-devel@oss.oracle.com, dtrace@lists.linux.dev
Subject: Re: [DTrace-devel] [PATCH v2] dtprobed: use /proc/$pid/map_files, not the filename of the mapping
Date: Thu, 12 Feb 2026 13:28:08 -0500	[thread overview]
Message-ID: <aY4buJOhWlmm9CvW@oracle.com> (raw)
In-Reply-To: <878qcxomfi.fsf@esperi.org.uk>

Here is the problem:

        prf = mapp->pr_file;
        if (prf == NULL || (mapp = prf->first_segment) == NULL) { 
                fuse_log(FUSE_LOG_ERR, "%i: dtprobed: cannot look up mapping (process dead?)\n",
                         pid);
                goto out;
        } else if ((fn = Pmap_mapfile_name(P, mapp)) == NULL) {
                fuse_log(FUSE_LOG_ERR, "%i: dtprobed: cannot look up mapname (process dead?)\n",
                         pid);
                goto out;
        }
        mod = strrchr(fn, '/');
        if (mod)
                mod++;
        else
                mod = fn;

Since you changed this to get the mapping filename in map_files, you get a
name that has the address range as its filename, and since that gets used as
the module name, you end up with the wrong module name in the probe spec.

It needs to be the actual filename of the source file that the mapping came
from.

On Thu, Feb 12, 2026 at 06:18:25PM +0000, Nick Alcock wrote:
> On 12 Feb 2026, Eugene Loh outgrape:
> 
> > I do not know what went wrong here.  I would have bet big money that I
> > tested this, but here is what I find now with this patch:
> 
> So did I!
> 
> > test/unittest/usdt/tst.enabled.sh: Running timeout --signal=TERM 41 test/unittest/usdt/tst.enabled.sh /home/.../build/dtrace
> > FAIL: expected results differ.
> > 400000-401000:main:go
> >
> > Diff against expected:
> > --- test/unittest/usdt/tst.enabled.r    2026-02-12 05:31:24.000000000 +0000
> > +++ /tmp/runtest.6196/test.out  2026-02-12 18:09:58.980466976 +0000
> > @@ -1,2 +1,2 @@
> > -test:main:go
> > +400000-401000:main:go
> 
> This suggests that symbol lookup is failing, which it shouldn't be,
> because that *too* uses /proc/$pid/map_files, or should.
> 
> I clearly need to debug this. Got a system on which it goes wrong?

  reply	other threads:[~2026-02-12 18:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 23:04 [PATCH] dtprobed: use /proc/$pid/map_files, not the filename of the mapping Nick Alcock
2025-12-04  6:18 ` Eugene Loh
2026-01-20 16:19   ` Nick Alcock
2026-01-20 16:20 ` [PATCH v2] " Nick Alcock
2026-01-20 19:24   ` [DTrace-devel] " Eugene Loh
2026-02-12 18:13     ` Eugene Loh
2026-02-12 18:18       ` Nick Alcock
2026-02-12 18:28         ` Kris Van Hees [this message]
2026-02-12 18:37           ` Kris Van Hees
2026-02-12 18:43             ` Kris Van Hees
2026-02-12 18:49               ` Eugene Loh
2026-02-12 18:51                 ` Kris Van Hees
2026-02-12 18:56                   ` Nick Alcock

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=aY4buJOhWlmm9CvW@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=eugene.loh@oracle.com \
    --cc=nick.alcock@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox