All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] JSON output for perf stat
@ 2022-05-25  5:38 Ian Rogers
  2022-05-25  5:38 ` [PATCH v4 1/3] perf test: Add checking for perf stat CSV output Ian Rogers
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Ian Rogers @ 2022-05-25  5:38 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Kan Liang, Zhengjun Xing, Sandipan Das, Claire Jensen,
	Alyssa Ross, Like Xu, James Clark, Florian Fischer, linux-kernel,
	linux-perf-users, Claire Jensen
  Cc: Stephane Eranian, Ian Rogers

Parsing the CSV or text output of perf stat can be problematic when
new output is added (columns in CSV format). JSON names values and
simplifies the job of parsing. Add a JSON output option to perf-stat
then add unit test that parses and validates the output.

This is a resend of two v2 patches:
https://lore.kernel.org/lkml/20210813220754.2104922-1-cjense@google.com/
https://lore.kernel.org/lkml/20210813220936.2105426-1-cjense@google.com/
with a few formatting changes and improvements to the linter.

The CSV test/linter is also added to ensure that CSV output doesn't regress:
https://lore.kernel.org/lkml/20210813192108.2087512-1-cjense@google.com/

v4. Does some minor fixes to the json linter.

v3. There is some tidy up of CSV code including a potential memory
    over run in the os.nfields set up caught by sanitizers. To
    facilitate this an AGGR_MAX value is added. v3 also adds the CSV
    testing.

v2. Fixes the system wide no aggregation test to not run if the
    paranoia is wrong. It also makes the counter-value check handle
    the "<not counted>" and "<not supported>" cases.

Claire Jensen (3):
  perf test: Add checking for perf stat CSV output.
  perf stat: Add JSON output option
  perf test: Json format checking

 tools/perf/Documentation/perf-stat.txt        |  21 +
 tools/perf/builtin-stat.c                     |   6 +
 .../tests/shell/lib/perf_csv_output_lint.py   |  48 +++
 .../tests/shell/lib/perf_json_output_lint.py  |  94 +++++
 tools/perf/tests/shell/stat+csv_output.sh     | 147 +++++++
 tools/perf/tests/shell/stat+json_output.sh    | 147 +++++++
 tools/perf/util/stat-display.c                | 384 +++++++++++++-----
 tools/perf/util/stat.c                        |   1 +
 tools/perf/util/stat.h                        |   2 +
 9 files changed, 744 insertions(+), 106 deletions(-)
 create mode 100644 tools/perf/tests/shell/lib/perf_csv_output_lint.py
 create mode 100644 tools/perf/tests/shell/lib/perf_json_output_lint.py
 create mode 100755 tools/perf/tests/shell/stat+csv_output.sh
 create mode 100755 tools/perf/tests/shell/stat+json_output.sh

-- 
2.36.1.124.g0e6072fb45-goog


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-08-10 14:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25  5:38 [PATCH v4 0/3] JSON output for perf stat Ian Rogers
2022-05-25  5:38 ` [PATCH v4 1/3] perf test: Add checking for perf stat CSV output Ian Rogers
2022-05-25 11:07   ` Arnaldo Carvalho de Melo
2022-05-25  5:38 ` [PATCH v4 2/3] perf stat: Add JSON output option Ian Rogers
2022-05-31 22:46   ` Namhyung Kim
2022-05-31 23:13     ` Ian Rogers
2022-05-31 23:18       ` Ian Rogers
2022-08-10 14:03       ` Arnaldo Carvalho de Melo
2022-05-25  5:38 ` [PATCH v4 3/3] perf test: Json format checking Ian Rogers
2022-05-25 11:18 ` [PATCH v4 0/3] JSON output for perf stat Arnaldo Carvalho de Melo
2022-05-25 11:21   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.