perf stat: Add before_metric argument
authorNamhyung Kim <namhyung@kernel.org>
Mon, 14 Nov 2022 23:02:16 +0000 (15:02 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 16 Nov 2022 12:51:22 +0000 (09:51 -0300)
commitdf46a3c92b510b7776fed14728a271f8836ef19b
tree2572f0881abe7123e387ef583e6a892df7214616
parentd6aeb861b1fb26f55c1b5be4b6e900ad1e734516
perf stat: Add before_metric argument

Unfortunately, event running time, percentage and noise data are printed
in different positions in normal output than CSV/JSON.  I think it's
better to put such details in where it actually prints.

So add before_metric argument to print_noise() and print_running() and
call them twice before and after the metric.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Link: https://lore.kernel.org/r/20221114230227.1255976-9-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/stat-display.c