diff options
| author | Namhyung Kim <namhyung.kim@lge.com> | 2012-09-26 03:47:28 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-09-26 19:44:11 -0400 |
| commit | 9ec60972a38011ad8a5676f4cd5e51ac508c36b6 (patch) | |
| tree | 4546004ef753ca9b73aa25b0ed35d9e9542f2204 /tools | |
| parent | 514f1c67c2fdae7b334fdc5adee63a484781241a (diff) | |
perf hists: Add missing period_* fields when collapsing a hist entry
So that the perf report won't lost the cpu utilization information.
For example, if there're two process that have same name.
$ perf report --stdio --showcpuutilization -s pid
[SNIP]
# Overhead sys us Command: Pid
# ........ ........ ........ .............
#
55.12% 0.01% 55.10% noploop:28781
44.88% 0.06% 44.83% noploop:28782
Before:
$ perf report --stdio --showcpuutilization -s comm
[SNIP]
# Overhead sys us
# ........ ........ ........
#
100.00% 0.06% 44.83%
After:
$ perf report --stdio --showcpuutilization -s comm
[SNIP]
# Overhead sys us
# ........ ........ ........
#
100.00% 0.07% 99.93%
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Arun Sharma <asharma@fb.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1348645663-25303-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/util/hist.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 6ec5398de89d..236bc9d98ff2 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
| @@ -410,8 +410,13 @@ static bool hists__collapse_insert_entry(struct hists *hists __maybe_unused, | |||
| 410 | cmp = hist_entry__collapse(iter, he); | 410 | cmp = hist_entry__collapse(iter, he); |
| 411 | 411 | ||
| 412 | if (!cmp) { | 412 | if (!cmp) { |
| 413 | iter->period += he->period; | 413 | iter->period += he->period; |
| 414 | iter->nr_events += he->nr_events; | 414 | iter->period_sys += he->period_sys; |
| 415 | iter->period_us += he->period_us; | ||
| 416 | iter->period_guest_sys += he->period_guest_sys; | ||
| 417 | iter->period_guest_us += he->period_guest_us; | ||
| 418 | iter->nr_events += he->nr_events; | ||
| 419 | |||
| 415 | if (symbol_conf.use_callchain) { | 420 | if (symbol_conf.use_callchain) { |
| 416 | callchain_cursor_reset(&callchain_cursor); | 421 | callchain_cursor_reset(&callchain_cursor); |
| 417 | callchain_merge(&callchain_cursor, | 422 | callchain_merge(&callchain_cursor, |
