Re: [PATCH v2] perf tool: Fix ppid for synthesized fork events

From: Don Zickus
Date: Wed Mar 25 2015 - 16:26:35 EST


On Wed, Mar 25, 2015 at 01:55:44PM -0600, David Ahern wrote:
> On 3/25/15 1:15 PM, Don Zickus wrote:
> >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.
> >
>
> From your other response I take it you understand the patch now? It
> is a matter of semantics to break this single into 2 -- optimize the
> existing code and then add the ppid. End result will be what this
> patch shows. Before I do that can you /Joe confirm the performance
> is acceptable?

Yes. I believe Joe will try to find time on Thursday to run this.

Cheers,
Don
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/