perf_event_open cpu should be -1 for valid PID#1464
Conversation
mmat11
left a comment
There was a problem hiding this comment.
lgtm, this only affected Uprobes with PID>0, right?
|
I'm missing context, sorry. What is currently broken? Can you extend the commit message to include the explanation? And is it possible to add a test? |
|
Theoretically, if you specify a PID then the arguments given mean it is applying only to CPU 0. In practice, it may not be affecting anything because the perf <-> tracepoint/kprobe linkage has some gaps. |
|
Hmm, could this be the cause of #406 ? |
I believe not, in that test |
|
So this is a fix for a theoretical issue? Happy to carry the patch without tests as long as the commit message gets a bit of detail why we're doing this. |
From perf_event_open manpage attributes documentation:
pid > 0 and cpu == -1
This measures the specified process/thread on any CPU.
Fixes it so it measures all CPUs when a PID is specified.
Signed-off-by: Bryce Kahle <[email protected]>
1652da3 to
a363f0d
Compare
|
Updated commit message |
This will match libbpf behavior. Relevant snippet from
perf_event_openmanpage