diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-top.c | 3 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 2 |
2 files changed, 4 insertions, 1 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 | ||
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index f4f427ce4d64..9abd8ac508e2 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -108,7 +108,7 @@ void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts, | |||
108 | if (opts->call_graph) | 108 | if (opts->call_graph) |
109 | attr->sample_type |= PERF_SAMPLE_CALLCHAIN; | 109 | attr->sample_type |= PERF_SAMPLE_CALLCHAIN; |
110 | 110 | ||
111 | if (opts->target.system_wide) | 111 | if (perf_target__has_cpu(&opts->target)) |
112 | attr->sample_type |= PERF_SAMPLE_CPU; | 112 | attr->sample_type |= PERF_SAMPLE_CPU; |
113 | 113 | ||
114 | if (opts->period) | 114 | if (opts->period) |