Re: [PATCH] perf tools: Fix reading of perf.data file header

From: Ingo Molnar
Date: Thu Aug 06 2009 - 15:59:42 EST



* Brice Goglin <Brice.Goglin@xxxxxxxx> wrote:

> $ /mnt/scratch/bgoglin/cpunode/linux-2.6.31/tools/perf/perf report -D |
> grep _READ | sort -k5
> 0x8bb8 [0x30]: PERF_EVENT_READ: 6268 6268 raw 0x1000001e0 494628
> 0x8fc0 [0x30]: PERF_EVENT_READ: 6268 6268 raw 0x1000002e0 209113
> 0x9698 [0x30]: PERF_EVENT_READ: 6268 6268 raw 0x1000004e0 307215
> 0x9cf8 [0x30]: PERF_EVENT_READ: 6268 6268 raw 0x1000008e0 9203221
> 0x8a08 [0x30]: PERF_EVENT_READ: 6268 6269 raw 0x1000001e0 9210788
> 0x9020 [0x30]: PERF_EVENT_READ: 6268 6269 raw 0x1000002e0 302344
> 0x9608 [0x30]: PERF_EVENT_READ: 6268 6269 raw 0x1000004e0 198705
> 0x9d28 [0x30]: PERF_EVENT_READ: 6268 6269 raw 0x1000008e0 473471
> [...]
>
> Now I know which thread actually reads from where.
> Looks like we're good to go now! thanks a lot Peter!
>
> Tested-by: Brice Goglin <Brice.Goglin@xxxxxxxx>

Thanks Brice.

It would be nice to add this as some "perf report -s/--stats" flag,
to not have to go via -D (which is a 'print debug output' kind of
ad-hoc thing and subject to format changes in the future).

Would you be interested in sending a patch that adds that flag to
'perf report', to print out these statistics entries (if any), in a
tabular form suitable for your purposes? Below is a past patch to
builtin-report.c that shows how to add new options.

Ingo

-------------------->