<!DOCTYPE html>
<!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">
On 7 Nov 2026, Kris Van Hees told this: > On Fri, Nov 06, 2026 at 12: 59: 41PM +0000, Nix wrote: >> On 30 Oct 2026, Kris Van Hees outgrape: >> >> > --- >> > libdtrace/dt_btf. c | 79 ++++++++++++++++++++++++++++++--</div>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;"></div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->
<html>
<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
  #pfptBannerfqlo1dy { all: revert !important; display: block !important;
    visibility: visible !important; opacity: 1 !important;
    background-color: #c2d4d4 !important;
    max-width: none !important; max-height: none !important }
  .pfptPrimaryButtonfqlo1dy:hover, .pfptPrimaryButtonfqlo1dy:focus {
    background-color: #a2b1b1 !important; }
  .pfptPrimaryButtonfqlo1dy:active {
    background-color: #828e8e !important; }
  html:root, html:root>body { all: revert !important; display: block !important;
    visibility: visible !important; opacity: 1 !important; }
</style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><body><pre style="font-family: sans-serif; font-size: 100%; white-space: pre-wrap; word-wrap: break-word">On 7 Nov 2026, Kris Van Hees told this:

> On Fri, Nov 06, 2026 at 12:59:41PM +0000, Nix wrote:
>> On 30 Oct 2026, Kris Van Hees outgrape:
>> 
>> > ---
>> >  libdtrace/dt_btf.c               | 79 ++++++++++++++++++++++++++++++--
>> >  libdtrace/dt_impl.h              |  1 +
>> >  libdtrace/dt_open.c              |  1 +
>> >  test/triggers/module-discovery.c | 11 +++++
>> >  4 files changed, 88 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/libdtrace/dt_btf.c b/libdtrace/dt_btf.c
>> > index 617b0128..727e5f54 100644
>> > --- a/libdtrace/dt_btf.c
>> > +++ b/libdtrace/dt_btf.c
>> > @@ -1479,17 +1479,67 @@ dt_btf_lookup_name_kind(dtrace_hdl_t *dtp, dt_module_t *dmp, const char *name,
>> >   return id;
>> >  }
>> >  
>> > +/*
>> > + * Retain a descriptor as well as the ID: otherwise an unloaded object's ID
>> > + * could be reused and a later enumeration could mistake it for a cached one.
>> > + * Only IDs assigned to modules are retained, bounding descriptor use by the
>> > + * number of modules discovered by this handle.
>> > + */
>> 
>> I suppose just not reusing IDs in general, and having them only
>> increment, would end up using too many? (I can't remember under what
>> circumstances they're reused, but I didn't think it was *common*.)
>
> The thing is that we have no control over the IDs...  They are provided
> by the BTF subsystem, and we should not make any assumptions about them
> in terms of wether they could be reused or not.
>
>> How it interacts with the earlier change to never remove dt_modules when
>> their corresponding kernel module is unloaded is unclear to me -- is
>> this the bit that ensures that an unloaded module never gets reused (and
>> instead we load a new one if the module is reloaded into the kernel), or
>> what?
>
> This really has to do with the way the BTF subsystem handles modules and
> associates IDs with them.  OUr own view of modules is independent from
> that.

Aha, makes sense.

Reviewed-by: Nick Alcock <nix@esperi.org.uk>

-- 
NULL && (void)
</pre></body></html>