On Thu, Jul 30, 2026 at 5:18 PM Mykyta Yatsenko <[email protected]> wrote: > > From: Mykyta Yatsenko <[email protected]> > > DECLARE_EVENT_CLASS emitted __bpf_trace_btf_ids_<call> through > BTF_ID_LIST_GLOBAL, i.e. a global symbol named after the event class. > The class name is not unique across the kernel, so the symbol > multiply-defines whenever two translation units instantiate the same > class. > > Switch to the file-local BTF_ID_LIST: the list is reached > only through the event_class_<call>.btf_ids pointer, initialised in the > same unit, so tracefs readers never reference the symbol by name and > resolve_btfids still fills the now-local .BTF_ids entries. > > The handcrafted syscall classes are the one cross-unit consumer: give > them their own local BTF_ID_LIST rather than importing the generated > sys_{enter,exit} lists. > > Fixes: eadc0725ab8d3 ("tracing: Expose tracepoint BTF ids via tracefs") > Reported-by: Mark Brown <[email protected]> > Closes: > https://lore.kernel.org/all/[email protected]/ > Signed-off-by: Mykyta Yatsenko <[email protected]> > --- > Changes in v2: > - Emit the per-class BTF id list only under CONFIG_DEBUG_INFO_BTF; > without BTF the ids are unresolved and BTF_ID_LIST falls back to a > 128-entry (512-byte) per-class stub, adding hundreds of KB of BSS > across the ~1000 event classes (reported in review of v1). > - Link to v1: > https://patch.msgid.link/[email protected] > --- > Changes in v2: > - Emit the per-class BTF id list only under CONFIG_DEBUG_INFO_BTF; > without BTF the ids are unresolved and BTF_ID_LIST falls back to a > 128-entry stub. > - Remove verbose comments (Andrii) > - Link to v1: > https://patch.msgid.link/[email protected] > --- > include/trace/trace_events.h | 7 +++---- > kernel/trace/trace_syscalls.c | 27 ++++++++++++++------------- > 2 files changed, 17 insertions(+), 17 deletions(-) >
LGTM Acked-by: Andrii Nakryiko <[email protected]> [...]
