diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-05-20 21:42:07 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-22 11:37:12 -0400 |
commit | e40ee742d4542b4c046ac5426654b1494d87ad73 (patch) | |
tree | e416c878d5ceb38659774967e42e83e4af13ea64 /tools/perf/builtin-top.c | |
parent | e33387fc2748ac78fd577dee2c914fc3ea0ba0cd (diff) |
perf target: Add cpu flag to sample_type if target has cpu
Add PERF_SAMPLE_CPU flag into attr->sample_type if an user specified any
of cpu target (either system-wide or cpu list).
It will show correct values when cpu sort key is given for perf top and
perf report.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1337564527-9367-1-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 3e981a710c4d..18bd226f9f2b 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -900,6 +900,9 @@ static void perf_top__start_counters(struct perf_top *top) | |||
900 | attr->read_format |= PERF_FORMAT_ID; | 900 | attr->read_format |= PERF_FORMAT_ID; |
901 | } | 901 | } |
902 | 902 | ||
903 | if (perf_target__has_cpu(&top->target)) | ||
904 | attr->sample_type |= PERF_SAMPLE_CPU; | ||
905 | |||
903 | if (symbol_conf.use_callchain) | 906 | if (symbol_conf.use_callchain) |
904 | attr->sample_type |= PERF_SAMPLE_CALLCHAIN; | 907 | attr->sample_type |= PERF_SAMPLE_CALLCHAIN; |
905 | 908 | ||