Skip to content

perf stat: Improve perf stat output (v2)

Namhyung Kim linux-perf-users lkml 1 version Applied

Status from this message: Thanks, applied the series.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 25 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/15perf stat: Fix cgroup display in JSON outputtools/perf/util/stat-display.c+1 -12 replies
2/15perf stat: Move summary prefix printing logic in CSV outputtools/perf/util/stat-display.c+7 -71 reply
3/15perf stat: Do not align time prefix in CSV outputtools/perf/util/stat-display.c+6 -31 reply
4/15perf stat: Use scnprintf() in prepare_interval()tools/perf/util/stat-display.c+10 -101 reply
5/15perf stat: Remove prefix argument in print_metric_headers()tools/perf/util/stat-display.c+10 -166 replies
6/15perf stat: Remove metric_only argument in print_counter_aggrdata()tools/perf/util/stat-display.c+6 -111 reply
7/15perf stat: Pass const char *prefix to display routinestools/perf/util/iostat.h tools/perf/util/stat-display.c+10 -101 reply
8/15perf stat: Use struct outstate in evlist__print_counters()tools/perf/util/stat-display.c+14 -111 reply
9/15perf stat: Pass struct outstate to print_metric_begin()tools/perf/util/stat-display.c+28 -221 reply
10/15perf stat: Pass struct outstate to printout()tools/perf/util/stat-display.c+18 -201 reply
11/15perf stat: Do not pass runtime_stat to printout()tools/perf/util/stat-display.c+4 -51 reply
12/15perf stat: Pass through struct outstatetools/perf/arch/x86/util/iostat.c tools/perf/util/iostat.c tools/perf/util/iostat.h +1 more+50 -631 reply
13/15perf stat: Fix JSON output in metric-only modetools/perf/util/stat-display.c+24 -181 reply
14/15perf stat: Rename "aggregate-number" to "cpu-count" in JSONtools/perf/util/stat-display.c+4 -45 replies
15/15perf stat: Tidy up JSON metric-only output when no metricstools/perf/util/stat-display.c+17 -101 reply

Reviews trailers per patch

14 of 15 patches have a Reviewed-by or Acked-by.

PatchIan Rogers
1/15A-b
2/15A-b
3/15A-b
4/15A-b
5/15A-b
6/15A-b
7/15A-b
8/15A-b
9/15A-b
10/15A-b
11/15A-b
12/15A-b
13/15A-b
14/15
15/15A-b

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

Read the v1 thread

Cover letter [PATCHSET 00/15] perf stat: Improve perf stat output (v2)

Hello,

This is a continuation of my perf stat cleanup work focusing on the metric-only mode with JSON output now. It's based on the previous patchset which is already merged to acme/perf/core.

The JSON output + metric-only with aggregation has been broken for a while. The last update fixed the crash but it still produced invalid JSON objects. Also having a separate header and objects with their own "metric-value" key is not convenient to process.

  # perf stat -aj --metric-only --per-socket sleep 1
  {"unit" : "GHz"}{"unit" : "insn per cycle"}{"unit" : "branch-misses of all branches"}
  {"socket" : "S0", "aggregate-number" : 8, {"metric-value" : "0.809"}{"metric-value" : "2.10"}{"metric-value" : "0.37"}

So I removed the header and move the metric keys to the object. Then it doesn't need separate objects anymore. The new output looks like:

  # perf stat -aj --metric-only --per-socket sleep 1
  {"socket" : "S0", "cpu-count" : 8, "GHz" : "0.817", "insn per cycle" : "2.15", "branch-misses of all branches" : "0.38"}

You can get it from 'perf/stat-display-v2' branch in

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Namhyung Kim (15):
perf stat: Fix cgroup display in JSON output
perf stat: Move summary prefix printing logic in CSV output perf stat: Do not align time prefix in CSV output
perf stat: Use scnprintf() in prepare_interval()
perf stat: Remove prefix argument in print_metric_headers() perf stat: Remove metric_only argument in print_counter_aggrdata() perf stat: Pass const char *prefix to display routines perf stat: Use struct outstate in evlist__print_counters() perf stat: Pass struct outstate to print_metric_begin() perf stat: Pass struct outstate to printout()
perf stat: Do not pass runtime_stat to printout()
perf stat: Pass through struct outstate
perf stat: Fix JSON output in metric-only mode
perf stat: Rename "aggregate-number" to "cpu-count" in JSON perf stat: Tidy up JSON metric-only output when no metrics

 tools/perf/arch/x86/util/iostat.c |   4 +-
 tools/perf/util/iostat.c          |   3 +-
 tools/perf/util/iostat.h          |   4 +-
 tools/perf/util/stat-display.c    | 257 +++++++++++++++---------------
 4 files changed, 133 insertions(+), 135 deletions(-)

base-commit: 63a3bf5e8d9e79ce456c8f73d4395a5a51d841b1

Signature · 1 line
2.38.1.584.g0f3c55d4c2-goog