[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fVyRrU_oFU_r3jsoY2MK=zMKLKvgLvhG+v8SjtSQmmoeg@mail.gmail.com>
Date: Tue, 8 Nov 2022 15:22:32 -0800
From: Ian Rogers <irogers@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-perf-users@...r.kernel.org,
Kan Liang <kan.liang@...ux.intel.com>,
Zhengjun Xing <zhengjun.xing@...ux.intel.com>,
James Clark <james.clark@....com>
Subject: Re: [PATCH 7/9] perf stat: Add header for interval in JSON output
On Mon, Nov 7, 2022 at 1:33 PM Namhyung Kim <namhyung@...nel.org> wrote:
>
> It missed to print a matching header line for intervals.
>
> Before:
> # perf stat -a -e cycles,instructions --metric-only -j -I 500
> {"unit" : "insn per cycle"}
> {"interval" : 0.500544283}{"metric-value" : "1.96"}
> ^C
>
> After:
> # perf stat -a -e cycles,instructions --metric-only -j -I 500
> {"unit" : "sec"}{"unit" : "insn per cycle"}
> {"interval" : 0.500515681}{"metric-value" : "2.31"}
> ^C
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Acked-by: Ian Rogers <irogers@...gle.com>
Thanks,
Ian
> ---
> tools/perf/util/stat-display.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index 25f67fb37f6d..aab2576bd40f 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -860,6 +860,10 @@ static void print_metric_headers(struct perf_stat_config *config,
> if (!config->iostat_run)
> fputs(aggr_header_csv[config->aggr_mode], config->output);
> }
> + if (config->json_output) {
> + if (config->interval)
> + fputs("{\"unit\" : \"sec\"}", config->output);
> + }
> if (config->iostat_run)
> iostat_print_header_prefix(config);
>
> --
> 2.38.1.431.g37b22c650d-goog
>
Powered by blists - more mailing lists