Repository navigation
Tracepoints only triggered by CPU 0 #2126
Replies: 3 comments 2 replies
|
@JoyfulSheep This is likely a kernel regression, and a pretty impactful one at that. There's a chance this has already been fixed upstream. Having vendor kernels in the mix when debugging this adds unnecessary noise, please try to diagnose this using upstream kernels. I'd recommend using vimto (see |
|
@JoyfulSheep similar to @ti-mo I think you are running into a Kernel regression, rather than an issue with this package. If I didn't mix up things, the described issue got fixed upstream with https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2c2b322acdcc78575b8d6afa64a085cf92e03c12. |
|
Isn't that the expected behavior though ? From the man page for perf_event_open :
So if link.Tracepoint is only calling perf_event_open once, with cpu == 0 and pid == -1 as arguments, I wouldn't be surprised that only events from CPU 0 are traced. Maybe the regression is in fact a fix ? I might be missing something. When using strace on a tool like perf with system-wide collection ("-a" flag) like this for example : |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
You will find at the bottom of this post a small code excerpt that seems to have changed its behavior on Ubuntu26.04 (differs from Debian13, Debian14, and Ubuntu24.04). On Debian or the previous Ubuntu distribution, this program logs all open syscalls. But on Ubuntu26.04, only the calls attributed to CPU#0 are logged. This has been tested by having a simple program (also in attachments just in case) opening files in a loop and starting it with taskset :
taskset -c 1,15 ./my_test_program-> no logs in /sys/kernel/tracing/trace_pipetaskset -c 0 ./my_test_program-> calls are logged as expectedAfter reading the man page for perf_event_open, I saw that calling it with
pid == -1andcpu >= 0(like what is done in cilium/ebpf/link/tracepoint) only "measures all processes/threads on the specified CPU" and not all CPUs. Modifying the code inside the cilium/ebpf/link package to loop over all possible CPUs when creating perf events does fix the issue, and every open call on the system is then logged.My questions being :
If I misinterpreted anything, please do correct me.
Thanks a lot
Kernel : 7.0.0-38-generic
Cilium-ebpf : v0.22.0
C code for the ebpf program :
Go code for linking :
Test program :
All reactions