From: Kris Van Hees <kris.van.hees@oracle.com>
To: Nick Alcock <nix@esperi.org.uk>
Cc: Kris Van Hees <kris.van.hees@oracle.com>,
dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH 02/20] libdtrace: retain module metadata across incremental discovery
Date: Thu, 5 Nov 2026 12:32:57 -0500 [thread overview]
Message-ID: <auy9ycnMQuLGDW4V@oracle.com> (raw)
In-Reply-To: <878q37usm6.fsf@esperi.org.uk>
On Thu, Nov 05, 2026 at 04:53:53PM +0000, Nick Alcock wrote:
> On 30 Oct 2026, Kris Van Hees spake thusly:
>
> > Stop unloading cached modules in dtrace_update(), including vmlinux. Keep
> > discovered symbol tables, ranges, types, and BTF IDs for the handle lifetime
> > while collecting newly loaded modules. Module disappearance or reloading no
> > longer replaces cached metadata.
>
> Hm. Interesting. I considered doing this back in the day but more or
> less immediately hit problems with wanting to remove dtrace.ko and
> loading a modified one.
Since we no longer have a dtrace.ko, that is not an issue.
> I guess we don't care about replacement of modules with bugfixed ones
> any more? (What happens if someone does it?)
Well, is a module is unloaded and reloaded with a different content, then an
active tracing session already will face trouble because there is e.g. a
potential that addresses were put in the trace buffer based on the old version
of the module, but symbol resolution takes place in the consumer using the new
version, and thus you get wrong results. Of ocurse, that would be (possibly)
of short duration - but either way, the system changing underneath us is just
not a case that we can really deal with. That was something we could deal with
much better when dtrace had an important piece living in the kernel because we
could (in a pretty seamless way) re-enable probes based on the enablings that
were stored in the kernel. Now we would have to react to a module unloading
and reloading from userspace which means there would be delays and all kinds of
side effects that would disrupt ongoing tracing anyway.
> > Separate failed ELF-load cleanup from module destruction, retaining the
> > existing handle ownership of shared CTF and BTF. Document the new lifetime
> > contract and cover incremental discovery with both kernel symbol formats.
>
> (I don't really know what this series is for, or why you're doing this.
> Is the point of this incremental discovery? Or is it just that the
> compiler resolves these things to addresses, so having them change just
> causes trouble because the resolution is already done? If so, this seems
> reasonable -- one hopes that the verifier would trap cases where the
> addresses used now resolve to something else.)
Combination of all the above :) The main purpose is remove complexity that is
no longer really beneficial to the operation of DTrace, and also to makes it
easier to simply and streamline the code that handles modules symbol and type
data - the extra complexity was lowering performance without really offering
much of a benefit.
> > Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
>
> Reviewed-by: Nick Alcock <nix@esperi.org.uk> # given the above
>
> (I suspect there are more simplifications one could make, given this,
> but the below seems like it should work.)
>
> --
> NULL && (void)
>
prev parent reply other threads:[~2026-11-05 17:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 19:36 [PATCH 02/20] libdtrace: retain module metadata across incremental discovery Kris Van Hees
2026-11-05 16:53 ` Nick Alcock
2026-11-05 17:32 ` 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=auy9ycnMQuLGDW4V@oracle.com \
--to=kris.van.hees@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=nix@esperi.org.uk \
/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