[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CO6PR11MB5635C3BB62A1B9FA532DF57BEE179@CO6PR11MB5635.namprd11.prod.outlook.com>
Date: Fri, 2 Dec 2022 19:31:59 +0000
From: "Wang, Weilin" <weilin.wang@...el.com>
To: Namhyung Kim <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>
CC: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Ian Rogers <irogers@...gle.com>,
"Hunter, Adrian" <adrian.hunter@...el.com>,
"linux-perf-users@...r.kernel.org" <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>,
"Athira Jajeev" <atrajeev@...ux.vnet.ibm.com>
Subject: RE: [PATCH] perf stat: Fix multi-line metric output in JSON
Namhyung, it works. Thanks!
-----Original Message-----
From: Namhyung Kim <namhyung@...il.com> On Behalf Of Namhyung Kim
Sent: Friday, December 2, 2022 11:05 AM
To: Arnaldo Carvalho de Melo <acme@...nel.org>; Jiri Olsa <jolsa@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>; Peter Zijlstra <peterz@...radead.org>; LKML <linux-kernel@...r.kernel.org>; Ian Rogers <irogers@...gle.com>; Hunter, Adrian <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>; Athira Jajeev <atrajeev@...ux.vnet.ibm.com>; Wang, Weilin <weilin.wang@...el.com>
Subject: [PATCH] perf stat: Fix multi-line metric output in JSON
When a metric produces more than one values, it missed to print the opening bracket.
Fixes: ab6baaae2735 ("perf stat: Fix JSON output in metric-only mode")
Reported-by: "Wang, Weilin" <weilin.wang@...el.com>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
Weilin, could you please verify it fixes your problem?
tools/perf/util/stat-display.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c index f1ee4b052198..8d0bdd57163d 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -440,7 +440,7 @@ static void new_line_json(struct perf_stat_config *config, void *ctx) {
struct outstate *os = ctx;
- fputc('\n', os->fh);
+ fputs("\n{", os->fh);
if (os->prefix)
fprintf(os->fh, "%s", os->prefix);
aggr_printout(config, os->evsel, os->id, os->nr);
--
2.39.0.rc0.267.gcb52ba06e7-goog
Powered by blists - more mailing lists