]> Git Repo - linux.git/commitdiff
perf stat: Consolidate condition to print metrics
authorNamhyung Kim <[email protected]>
Mon, 7 Nov 2022 21:33:14 +0000 (13:33 -0800)
committerArnaldo Carvalho de Melo <[email protected]>
Mon, 14 Nov 2022 16:21:19 +0000 (13:21 -0300)
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]>
tools/perf/util/stat-display.c

index 7b2ec400813e9120f5acd572976cd9a13dcfdfd5..cb2a116bded6d8ab561780577a86bace131f6b0f 100644 (file)
@@ -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;
        }
This page took 0.057618 seconds and 4 git commands to generate.