[DTrace-devel] [PATCH] dtprobed: use /proc/$pid/map_files, not the filename of the mapping

Nick Alcock nick.alcock at oracle.com
Tue Jan 20 16:19:06 UTC 2026


On 4 Dec 2025, Eugene Loh told this:

> I tested on a variety of platforms, and yes this seems to do the job.
>
> The commit message struck me as wordy and hard to follow.  I asked an AI bot for its suggestion and (with a slight tweak by me) came
> up with:
>
>         Instead of using prf->prf_mapname (which resolves to the
>         mapped file's target), use Pmap_mapfile_name() to get the
>         actual /proc/$pid/map_files/* path.  These special entries
>         can be opened even when the apparent symlink looks broken
>         or points across filesystem namespaces, ensuring we can
>         read the mapping contents reliably.  This matches how DTrace
>         handles USDT probe lookup.
>
>         Fixes issues with probes in paths like /home when dtprobed
>         is sandboxed by systemd.
>
> which I like better.  (But maybe some other tweak would help better,
> and maybe I've just been staring at this long enough to finally get
> it.  So, I'm not saying this version is the last word on the subject.)

I'm a perfect test reader right now, because I can't remember a thing
about this commit.

The revised message is OK, but not quite right -- it doesn't "match" how
DTrace handles USDT probe lookup, DTrace uses the same mechanism when
doing USDT probe lookup (but that's not actually how USDT probe lookup
is done, it's just one aspect of it).

v2 coming shortly.

> I would like some comment on testing in the commit message.  At this
> point, perhaps it would be a stretch to ask for a test in the test
> suite, given that the issues (systemd, /tmp) are so tied into the test
> suite, but there should be at least a description of how -- and even
> just what! -- to test manually.  How would a reader know what the
> problem is or how to confirm this patch fixes it?

Agreed. I'll soup it up a bit.

-- 
NULL && (void)



More information about the DTrace-devel mailing list