profile: -p should match user PID
authorBrendan Gregg <brendan.d.gregg@gmail.com>
Thu, 1 Dec 2016 04:26:26 +0000 (20:26 -0800)
committerBrendan Gregg <brendan.d.gregg@gmail.com>
Thu, 1 Dec 2016 04:26:26 +0000 (20:26 -0800)
tools/profile.py

index 30c4d25..c2ed6ea 100755 (executable)
@@ -132,7 +132,7 @@ BPF_STACK_TRACE(stack_traces, STACK_STORAGE_SIZE)
 // This code gets a bit complex. Probably not suitable for casual hacking.
 
 int do_perf_event(struct bpf_perf_event_data *ctx) {
-    u32 pid = bpf_get_current_pid_tgid();
+    u32 pid = bpf_get_current_pid_tgid() >> 32;
     if (!(THREAD_FILTER))
         return 0;