Skip to content

perf stat: Decouple and modularize display formatting

Ian Rogers linux-perf-users lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest14 patches 7 repliesIn review
  2. v314 patches 0 repliesSuperseded
  3. v2 RFC14 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC14 patches0 repliesSuperseded

Changes in v4 from the cover letter

- Squash all multi-metric column padding, zero-skip logic, and formatting fixes directly into their introducing commits for a perfectly bisectable, pristine Git history.
- Avoid newlines before signed-off-by, assisted-by, and acked-by tags, organizing all contributor tags into a single, contiguous block for strict checkpatch and LKML compliance.
- Introduce strict, grid-based column padding to perfectly align multi-metric events (e.g. TopdownL1) across both standard and metric-only CSV rows, guaranteeing perfect 6-comma and 7-comma parsing compliance by external DataFrame engines.
- Refactor the PMU and hybrid metric event printer to propagate identical zero-counter skipping semantics in alignment with the legacy abs_printout path.
- Re-run all STD, JSON, and CSV linter test suites to achieve 100% passing status.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14perf stat: Introduce core generic print traversal engine and header stubstools/perf/builtin-stat.c tools/perf/util/Build tools/perf/util/stat-display.c +6 more+744 -501 reply
2/14perf stat: Implement standard console (STD) formatting callbackstools/perf/util/stat-print-std.c+848 -71 reply
3/14perf stat: Extend STD output linter to test basic New API checkstools/perf/tests/shell/stat+std_output.sh+4 -00 replies
4/14perf stat: Extend STD output linter to test core aggregation checkstools/perf/tests/shell/stat+std_output.sh+11 -00 replies
5/14perf stat: Extend STD output linter to test advanced PMU checkstools/perf/tests/shell/stat+std_output.sh+2 -00 replies
6/14perf stat: Extend STD output linter to test metric-only checkstools/perf/tests/shell/stat+std_output.sh+1 -01 reply
7/14perf stat: Implement CSV formatting callbackstools/perf/util/stat-print-csv.c+671 -71 reply
8/14perf stat: Extend CSV output linter to test core aggregation checkstools/perf/tests/shell/stat+csv_output.sh+16 -00 replies
9/14perf stat: Extend CSV output linter to test advanced PMU and metric-only checkstools/perf/tests/shell/stat+csv_output.sh+3 -00 replies
10/14perf stat: Implement streaming JSON formatting callbackstools/perf/util/stat-print-json.c+333 -71 reply
11/14perf stat: Extend JSON output linter to test core aggregation checkstools/perf/tests/shell/stat+json_output.sh+45 -260 replies
12/14perf stat: Extend JSON output linter to test advanced PMU and metric-only checkstools/perf/tests/shell/stat+json_output.sh+3 -00 replies
13/14perf stat: Add --new support to PMU metrics Python validatortools/perf/tests/shell/lib/perf_metric_validation.py+9 -30 replies
14/14perf stat: Extend PMU metrics value linter to validate --new outputstools/perf/tests/shell/stat_metrics_values.sh+19 -30 replies

Reviews trailers per patch

All 14 patches have a Reviewed-by or Acked-by.

PatchChun-Tse ShaoArnaldo Carvalho de Melo
1/14A-b
2/14A-b
3/14A-b A-b
4/14A-b
5/14A-b
6/14A-b
7/14A-b
8/14A-b
9/14A-b
10/14A-b
11/14A-b
12/14A-b
13/14A-b
14/14A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/14] perf stat: Decouple and modularize display formatting

This patch set decouples and modularizes perf stat metric and event counter display processing into a unified traversal engine supporting pluggable, format-specific callbacks for standard (STD), CSV, and JSON outputs via the new --new flag.

Changes in v4:
- Squash all multi-metric column padding, zero-skip logic, and formatting fixes directly into their introducing commits for a perfectly bisectable, pristine Git history.
- Avoid newlines before signed-off-by, assisted-by, and acked-by tags, organizing all contributor tags into a single, contiguous block for strict checkpatch and LKML compliance.
- Introduce strict, grid-based column padding to perfectly align multi-metric events (e.g. TopdownL1) across both standard and metric-only CSV rows, guaranteeing perfect 6-comma and 7-comma parsing compliance by external DataFrame engines.
- Refactor the PMU and hybrid metric event printer to propagate identical zero-counter skipping semantics in alignment with the legacy abs_printout path.
- Re-run all STD, JSON, and CSV linter test suites to achieve 100% passing status.

Ian Rogers (14):
perf stat: Introduce core generic print traversal engine and header
stubs
perf stat: Implement standard console (STD) formatting callbacks perf stat: Extend STD output linter to test basic New API checks perf stat: Extend STD output linter to test core aggregation checks perf stat: Extend STD output linter to test advanced PMU checks perf stat: Extend STD output linter to test metric-only checks perf stat: Implement CSV formatting callbacks
perf stat: Extend CSV output linter to test core aggregation checks perf stat: Extend CSV output linter to test advanced PMU and
metric-only checks
perf stat: Implement streaming JSON formatting callbacks perf stat: Extend JSON output linter to test core aggregation checks perf stat: Extend JSON output linter to test advanced PMU and
metric-only checks
perf stat: Add --new support to PMU metrics Python validator perf stat: Extend PMU metrics value linter to validate --new outputs

 tools/perf/builtin-stat.c                     |  96 +-
 .../tests/shell/lib/perf_metric_validation.py |  12 +-
 tools/perf/tests/shell/stat+csv_output.sh     |  19 +
 tools/perf/tests/shell/stat+json_output.sh    |  74 +-
 tools/perf/tests/shell/stat+std_output.sh     |  18 +
 tools/perf/tests/shell/stat_metrics_values.sh |  22 +-
 tools/perf/util/Build                         |   4 +
 tools/perf/util/stat-display.c                |  12 +-
 tools/perf/util/stat-print-csv.c              | 677 ++++++++++++++
 tools/perf/util/stat-print-json.c             | 339 +++++++
 tools/perf/util/stat-print-std.c              | 854 ++++++++++++++++++
 tools/perf/util/stat-print.c                  | 500 ++++++++++
 tools/perf/util/stat-print.h                  | 137 +++
 tools/perf/util/stat.h                        |   6 +
 14 files changed, 2688 insertions(+), 82 deletions(-)
 create mode 100644 tools/perf/util/stat-print-csv.c
 create mode 100644 tools/perf/util/stat-print-json.c
 create mode 100644 tools/perf/util/stat-print-std.c
 create mode 100644 tools/perf/util/stat-print.c
 create mode 100644 tools/perf/util/stat-print.h
Signature · 1 line
2.55.0.141.g00534a21ce-goog