perf stat: Fix multi-line metric output in JSON
Namhyung Kim
maintainerPATCH 1/1 perf stat: Fix multi-line metric output in JSON
When a metric produces more than one values, it missed to print the opening bracket.
---
Weilin, could you please verify it fixes your problem?
tools/perf/util/stat-display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/stat-display.c +1 -1
@@ -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);
Signature · 1 line
2.39.0.rc0.267.gcb52ba06e7-goog
Namhyung, it works. Thanks!
-----Original Message-----
From: Namhyung Kim <[email protected]> On Behalf Of Namhyung Kim
Sent: Friday, December 2, 2022 11:05 AM
To: Arnaldo Carvalho de Melo <[email protected]>; Jiri Olsa <[email protected]>
Cc: Ingo Molnar <[email protected]>; Peter Zijlstra <[email protected]>; LKML <[email protected]>; Ian Rogers <[email protected]>; Hunter, Adrian <[email protected]>; [email protected]; Kan Liang <[email protected]>; Zhengjun Xing <[email protected]>; James Clark <[email protected]>; Athira Jajeev <[email protected]>; Wang, Weilin <[email protected]>
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.
---
Weilin, could you please verify it fixes your problem?
tools/perf/util/stat-display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/stat-display.c +1 -2
@@ -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
Arnaldo Carvalho de Melo
maintainerEm Fri, Dec 02, 2022 at 07:31:59PM +0000, Wang, Weilin escreveu:
Quoted 1 line
Namhyung, it works. Thanks!
Thanks, applied and added a Tested-by: Weilin, ok?
- Arnaldo
Quoted 31 lines
-----Original Message-----
From: Namhyung Kim <[email protected]> On Behalf Of Namhyung Kim
Sent: Friday, December 2, 2022 11:05 AM
To: Arnaldo Carvalho de Melo <[email protected]>; Jiri Olsa <[email protected]>
Cc: Ingo Molnar <[email protected]>; Peter Zijlstra <[email protected]>; LKML <[email protected]>; Ian Rogers <[email protected]>; Hunter, Adrian <[email protected]>; [email protected]; Kan Liang <[email protected]>; Zhengjun Xing <[email protected]>; James Clark <[email protected]>; Athira Jajeev <[email protected]>; Wang, Weilin <[email protected]>
Subject: [PATCH] perf stat: Fix multi-line metric output in JSONWhen 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" <[email protected]>Signed-off-by Namhyung Kim <[email protected]>---
Weilin, could you please verify it fixes your problem?tools/perf/util/stat-display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/stat-display.c +1
-2@@ -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
Signature · 1 line
- Arnaldo
Yes, no problem.
Thanks,
Weilin
-----Original Message-----
From: Arnaldo Carvalho de Melo <[email protected]>
Sent: Monday, December 5, 2022 5:04 AM
To: Wang, Weilin <[email protected]>
Cc: Namhyung Kim <[email protected]>; Jiri Olsa <[email protected]>; Ingo Molnar <[email protected]>; Peter Zijlstra <[email protected]>; LKML <[email protected]>; Ian Rogers <[email protected]>; Hunter, Adrian <[email protected]>; [email protected]; Kan Liang <[email protected]>; Zhengjun Xing <[email protected]>; James Clark <[email protected]>; Athira Jajeev <[email protected]>
Subject: Re: [PATCH] perf stat: Fix multi-line metric output in JSON
Em Fri, Dec 02, 2022 at 07:31:59PM +0000, Wang, Weilin escreveu:
Quoted 1 line
Namhyung, it works. Thanks!
Thanks, applied and added a Tested-by: Weilin, ok?
- Arnaldo
Quoted 31 lines
-----Original Message-----
From: Namhyung Kim <[email protected]> On Behalf Of Namhyung Kim
Sent: Friday, December 2, 2022 11:05 AM
To: Arnaldo Carvalho de Melo <[email protected]>; Jiri Olsa <[email protected]>
Cc: Ingo Molnar <[email protected]>; Peter Zijlstra <[email protected]>; LKML <[email protected]>; Ian Rogers <[email protected]>; Hunter, Adrian <[email protected]>; [email protected]; Kan Liang <[email protected]>; Zhengjun Xing <[email protected]>; James Clark <[email protected]>; Athira Jajeev <[email protected]>; Wang, Weilin <[email protected]>
Subject: [PATCH] perf stat: Fix multi-line metric output in JSONWhen 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" <[email protected]>Signed-off-by Namhyung Kim <[email protected]>---
Weilin, could you please verify it fixes your problem?tools/perf/util/stat-display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/stat-display.c +1
-2@@ -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
Signature · 1 line
- Arnaldo