On Wed, Mar 25, 2015 at 10:51:10AM -0600, David Ahern wrote:
363b785f38 added synthesized fork events and set a thread's parent id
to itself. Since we are already processing /proc/<pid>/status the ppid
can be determined properly. Make it so.
Performance impact measured on a sparc based T5-8 (1024 CPUs):
$ ps -efL | wc -l
20185
Current code:
$ time perf record -o perf-no-ppid.data -e cpu-clock -F 1000 -a -v -BN -- usleep 1
mmap size 532480B
[ perf record: Woken up 0 times to write data ]
failed to write feature 9
[ perf record: Captured and wrote 0.000 MB perf-no-ppid.data ]
real 0m26.144s
user 0m0.452s
sys 0m25.564s
With PPID patch:
$ time ./perf_ppid record -o perf-ppid.data -e cpu-clock -F 1000 -a -v -BN -- usleep 1
mmap size 532480B
[ perf record: Woken up 0 times to write data ]
failed to write feature 9
[ perf record: Captured and wrote 0.000 MB perf-ppid.data ]
real 0m25.743s
user 0m0.268s
sys 0m25.368s
Signed-off-by: David Ahern <dsahern@xxxxxxxxx>
Cc: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Joe Mario <jmario@xxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
---
v2:
- removed loop in place of 1 read and processing a buffer
Hmm, I am not entirely sure this is correct. You made an optimization that
hides the negative impact your patch does. I would prefer you split this
patch into two pieces. One with the read loop optimization (which I think
is great) and the second is your ppid change.
I would then like to redo our test with the first patch applied and then
both patches applied.