Currently perf_event_open targets a single PID:
|
for (i = 0; i < nr_cpus; i++) { |
|
fd = syscall(__NR_perf_event_open, &attr, env.pid, i, -1, 0); |
Unfortunately, this actually means TID, so if you have a multithreaded program, you are missing out on quite a bit.
I think the right thing to do here is to pass the PID via BSS and do filtering in ebpf.
Currently
perf_event_opentargets a single PID:ebpf-bolt/ebpf-bolt.cc
Lines 138 to 139 in 8527320
Unfortunately, this actually means TID, so if you have a multithreaded program, you are missing out on quite a bit.
I think the right thing to do here is to pass the PID via BSS and do filtering in ebpf.