diff options
-rw-r--r-- | tools/perf/builtin-stat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index e598e4e98170..d28949d210cc 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -510,6 +510,9 @@ static int read_counter(struct perf_evsel *counter) | |||
510 | int ncpus = perf_evsel__nr_cpus(counter); | 510 | int ncpus = perf_evsel__nr_cpus(counter); |
511 | int cpu, thread; | 511 | int cpu, thread; |
512 | 512 | ||
513 | if (!counter->supported) | ||
514 | return -ENOENT; | ||
515 | |||
513 | if (counter->system_wide) | 516 | if (counter->system_wide) |
514 | nthreads = 1; | 517 | nthreads = 1; |
515 | 518 | ||
@@ -1285,7 +1288,7 @@ static void print_counter_aggr(struct perf_evsel *counter, char *prefix) | |||
1285 | if (prefix) | 1288 | if (prefix) |
1286 | fprintf(output, "%s", prefix); | 1289 | fprintf(output, "%s", prefix); |
1287 | 1290 | ||
1288 | if (scaled == -1) { | 1291 | if (scaled == -1 || !counter->supported) { |
1289 | fprintf(output, "%*s%s", | 1292 | fprintf(output, "%*s%s", |
1290 | csv_output ? 0 : 18, | 1293 | csv_output ? 0 : 18, |
1291 | counter->supported ? CNTR_NOT_COUNTED : CNTR_NOT_SUPPORTED, | 1294 | counter->supported ? CNTR_NOT_COUNTED : CNTR_NOT_SUPPORTED, |