diff options
author | Namhyung Kim <[email protected]> | 2022-11-07 13:33:14 -0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2022-11-14 13:21:19 -0300 |
commit | 20e2e31779377b36ada04c06d572ce0b4e234bb1 (patch) | |
tree | 4eb5daefcaf266ec7f51d7e5196494bb5331359b | |
parent | f1db5a1d1d4de248534567fd95efa570bc693f73 (diff) |
perf stat: Consolidate condition to print metrics
The pm variable holds an appropriate function to print metrics for CSV
anf JSON already. So we can combine the if statement to simplify the
code a little bit. This also matches to the above condition for non-CSV
and non-JSON case.
Signed-off-by: Namhyung Kim <[email protected]>
Acked-by: Ian Rogers <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: James Clark <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Xing Zhengjun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/util/stat-display.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index 7b2ec400813e..cb2a116bded6 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -600,9 +600,7 @@ static void printout(struct perf_stat_config *config, struct aggr_cpu_id id, int pm(config, &os, NULL, NULL, "", 0); print_noise(config, counter, noise); print_running(config, run, ena); - if (config->csv_output) - pm(config, &os, NULL, NULL, "", 0); - else if (config->json_output) + if (config->csv_output || config->json_output) pm(config, &os, NULL, NULL, "", 0); return; } |