Jiri Olsa
32b8af82e3
perf stat: Introduce --per-thread option
...
Currently all the -p option PID arguments tasks values get aggregated
and printed as single values.
Adding --per-tasks option to print values per task.
$ perf stat -e cycles,instructions --per-thread -p 30190,30242
^C
Performance counter stats for process id '30190,30242':
cat-30190 0 cycles
yes-30242 3,842,525,421 cycles
cat-30190 0 instructions
yes-30242 10,370,817,010 instructions
1.143155657 seconds time elapsed
Also works under interval mode:
$ perf stat -e cycles,instructions --per-thread -p 30190,30242 -I 1000
# time comm-pid counts unit events
1.000073435 cat-30190 89,058 cycles
1.000073435 yes-30242 3,360,786,902 cycles (100.00%)
1.000073435 cat-30190 14,066 instructions
1.000073435 yes-30242 9,069,937,462 instructions
2.000204830 cat-30190 0 cycles
2.000204830 yes-30242 3,351,667,626 cycles
2.000204830 cat-30190 0 instructions
2.000204830 yes-30242 9,045,796,885 instructions
^C 2.771286639 cat-30190 0 cycles
2.771286639 yes-30242 2,593,884,166 cycles
2.771286639 cat-30190 0 instructions
2.771286639 yes-30242 7,001,171,191 instructions
It works only with -t and -p options, otherwise following error is
printed:
$ perf stat -e cycles --per-thread -I 1000 ls
The --per-thread option is only available when monitoring via -p -t options.
-p, --pid <pid> stat events on existing process id
-t, --tid <tid> stat events on existing thread id
Signed-off-by: Jiri Olsa <[email protected] >
Tested-by: Arnaldo Carvalho de Melo <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-26 12:05:04 -03:00
Jiri Olsa
a7d0a102e4
perf stat: Introduce perf_evsel__alloc_stats function
...
Move all stat allocation logic related to stat object under single
function. This way we can use it separately for stat object out of
evlist object.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-26 11:46:00 -03:00
Jiri Olsa
24e34f68e2
perf stat: Move perf_evlist__(alloc|free|reset)_stats into stat object
...
Moving perf_evlist__(alloc|free|reset)_stats into stat object,
so it could be used in following patches.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-26 11:44:37 -03:00
Jiri Olsa
a939512d10
perf stat: Move perf_evsel__(alloc|free)_prev_raw_counts into stat object
...
Moving perf_evsel__(alloc|free)_prev_raw_counts into stat object, so it
could be used in following patches.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-26 11:34:43 -03:00
Jiri Olsa
9689edfabc
perf stat: Move perf_evsel__(alloc|free|reset)_stat_priv into stat object
...
Moving perf_evsel__(alloc|free|reset)_stat_priv into stat object, so it
could be used outside stat command in following patches.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-26 11:26:44 -03:00
Jiri Olsa
57b289159a
perf stat: Rename struct perf_counts::cpu member to values
...
Renaming 'struct xyarray *cpu' pointer to more fitting/generic values,
because now we store both cpu and thread values.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-26 11:25:03 -03:00
Jiri Olsa
a6fa003855
perf stat: Make stats work over the thread dimension
...
Now that we have space for thread dimension counts, let's store it.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-26 11:20:02 -03:00
Jiri Olsa
a8e02324df
perf stat: Use xyarray for cpu evsel counts
...
Switching single dimensional array of 'struct perf_counts_values'
with xyarray object, so we could store thread dimension counts.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-26 11:19:19 -03:00
Jiri Olsa
1ac77e1ce8
perf stat: Introduce perf_counts function
...
Introducing perf_counts function, that returns
'struct perf_counts_values' pointer for given cpu.
Also moving perf_counts* structures into stat.h.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-26 11:11:26 -03:00
Jiri Olsa
9df38e82e2
perf stat: Introduce perf_counts__(new|delete|reset) functions
...
Move 'struct perf_counts' allocation|free|reset code into separate
functions.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-16 10:34:41 -03:00
Jiri Olsa
a9a3a4d92d
perf tools: Move perf_evsel__(alloc|free|reset)_counts into stat object
...
It's stat specific. Updating python build objects with stat.c.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-16 10:34:40 -03:00
Jiri Olsa
f87027b968
perf stat: Move shadow stat counters into separate object
...
Separating shadow counters code into separate object as a cleanup, but
mainly for upcomming changes, so could use it from script command
context.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-08 10:30:31 -03:00
Jiri Olsa
4c358d5cf3
perf stat: Replace transaction event possition check with id check
...
Using perf_stat::id to check for transaction events, instead of current
position based way.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-08 10:30:30 -03:00
Jiri Olsa
e2f56da1d6
perf stat: Add id into perf_stat struct
...
We need fast way to identify evsel as transaction event for shadow
counters computation. Currently we are using possition (in evlist) based
way.
Adding 'id' into 'struct perf_stat' so it can carry transaction event ID
and we can use it for shadow counters computations.
Signed-off-by: Jiri Olsa <[email protected] >
Tested-by: Arnaldo Carvalho de Melo <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2015-06-08 10:30:30 -03:00
Borislav Petkov
d944c4eebc
tools: Consolidate types.h
...
Combine all definitions into a common tools/include/linux/types.h and
kill the wild growth elsewhere. Move DECLARE_BITMAP to its proper
bitmap.h header.
Signed-off-by: Borislav Petkov <[email protected] >
Acked-by: Rusty Russell <[email protected] >
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Jiri Olsa <[email protected] >
2014-05-01 21:22:39 +02:00
David Ahern
ffe4f3c0d1
perf stats: Add max and min stats
...
Need an initialization function to set min to -1 to
differentiate from an actual min of 0.
Signed-off-by: David Ahern <[email protected] >
Reviewed-by: Xiao Guangrong <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Runzhen Wang <[email protected] >
Cc: Xiao Guangrong <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-08-07 17:35:26 -03:00
Xiao Guangrong
0007eceace
perf stat: Move stats related code to util/stat.c
...
Then, the code can be shared between kvm events and perf stat.
Signed-off-by: Xiao Guangrong <[email protected] >
[ Dong Hao <[email protected] >: rebase it on acme's git tree ]
Signed-off-by: Dong Hao <[email protected] >
Cc: Avi Kivity <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: [email protected]
Cc: Marcelo Tosatti <[email protected] >
Cc: Runzhen Wang <[email protected] >
Cc: Xiao Guangrong <[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-09-17 13:10:03 -03:00