[DTrace-devel] [External] : Re: [PATCH v5 03/11] libdtrace: avoid BTF probes for ranged built-in modules

Alan Maguire almagui at kernel.org
Tue Oct 20 09:58:04 UTC 2026


>> +	/*
>> +	 * modules.builtin.ranges identifies this object as linked into vmlinux.
>> +	 * Such objects cannot have a per-module BTF object, so use the shared
>> +	 * vmlinux BTF directly.  Retain the usual lookup for an explicitly
>> +	 * configured BTF directory and every other module.
>> +	 */
>> +	if (dtp->dt_btf_path == NULL && (dmp->dm_flags & DT_DM_KERN_BUILTIN)) {
>> +		dmp->dm_btf = dtp->dt_shared_btf;
>> +		dt_dprintf("Using shared vmlinux BTF for built-in module %s.\n",
>> +		    dmp->dm_name);
>> +		return;
>> +	}
> 
> This does not look right to me, because if a dt_btf_path is specified, I
> would expect the handle to still provided a handle-wide shared CTF and
> BTF, even if it may be different from the system-wide shared CTF and
> BTF.  In other words, I think that sharing should be based on:
> 
> System standard CTF and BTF -> dt_shared_ctf and dt_share_btf globals
> Non-standard CTF or BTF -> dtp->dt_shared_ctf and dtp->dt_shared_btf
> 
> So dropping the dtp->dt_btf_path == NULL in the conditional clause above
> should be fine, right?

Yeah, certainly in the case of BTF we should always prioritize the
system-provided BTF since it travels directly with the kernel in
question.



More information about the DTrace-devel mailing list