On Tue, Jun 03, 2025 at 02:54:50PM -0700, Blake Jones wrote: > Hi Namhyung, > > On Tue, Jun 3, 2025 at 2:44 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote: > > > > IIUC the metadata is collected for each BPF program which may have > > > > multiple subprograms. Then this patch creates multiple PERF_RECORD_ > > > > BPF_METADATA for each subprogram, right? > > > > > > > > Can it be shared using the BPF program ID? > > > > > > In theory, yes, it could be shared. But I want to be able to correlate them > > > with the corresponding PERF_RECORD_KSYMBOL events, and KSYMBOL events for > > > subprograms don't have the full-program ID, so I wouldn't be able to do that. > > > > It's unfortunate that KSYMBOL doesn't have the program ID, but IIRC the > > following BPF_EVENT should have it. I think it's safe to think KSYMBOLs > > belong to the BPF_EVENT when they are from the same thread. > > Hmmm. Is that documented and tested anywhere? Offhand it sounds like an > implementation detail that I wouldn't feel great about depending on - > certainly not without a strong guarantee that it wouldn't change. Good point. Maybe BPF folks have some idea? Anyway the current code generates them together in a function. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/events/core.c?h=v6.15#n9825 > > Can you say more about why the duplicated records concern you? More data means more chance to lost something. I don't expect this is gonna be a practical concern but in general we should pursue less data. Thanks, Namhyung