linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET 0/5] perf report: Make --stat output more compact
@ 2021-04-23 18:28 Namhyung Kim
  2021-04-23 18:28 ` [PATCH 1/5] perf top: Use evlist->events_stat to count events Namhyung Kim
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Namhyung Kim @ 2021-04-23 18:28 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Ingo Molnar, Peter Zijlstra, Mark Rutland, Alexander Shishkin,
	LKML, Andi Kleen, Ian Rogers

Hello,

The perf report --stat shows event statistics like below:

  $ perf report --stat

  Aggregated stats:
             TOTAL events:      20064
              MMAP events:        239
              LOST events:          0
              COMM events:       1518
              EXIT events:          1
          THROTTLE events:          0
        UNTHROTTLE events:          0
              FORK events:       1517
              READ events:          0
            SAMPLE events:       4015
             MMAP2 events:      12769
               AUX events:          0
      ITRACE_START events:          0
      LOST_SAMPLES events:          0
            SWITCH events:          0
   SWITCH_CPU_WIDE events:          0
        NAMESPACES events:          0
           KSYMBOL events:          0
         BPF_EVENT events:          0
            CGROUP events:          0
         TEXT_POKE events:          0
              ATTR events:          0
        EVENT_TYPE events:          0
      TRACING_DATA events:          0
          BUILD_ID events:          0
    FINISHED_ROUND events:          2
          ID_INDEX events:          0
     AUXTRACE_INFO events:          0
          AUXTRACE events:          0
    AUXTRACE_ERROR events:          0
        THREAD_MAP events:          1
           CPU_MAP events:          1
       STAT_CONFIG events:          0
              STAT events:          0
        STAT_ROUND events:          0
      EVENT_UPDATE events:          0
         TIME_CONV events:          1
           FEATURE events:          0
        COMPRESSED events:          0

But it's too long and mostly 0 so we can make it more compact.  Also
perf report -D has similar output at the end with each event's sample
count.  It'd be better if we can have the same output in both case.

So I added --skip-empty (and --no-skip-empty automatically) to suppres
the 0 output and add the event stats like below.

  $ perf report --stat --skip-empty
  
  Aggregated stats:
             TOTAL events:      20064
              MMAP events:        239
              COMM events:       1518
              EXIT events:          1
              FORK events:       1517
            SAMPLE events:       4015
             MMAP2 events:      12769
    FINISHED_ROUND events:          2
        THREAD_MAP events:          1
           CPU_MAP events:          1
         TIME_CONV events:          1
  cycles stats:
            SAMPLE events:       2475
  instructions stats:
            SAMPLE events:       1540


And I make it enabled by default with a new config option
report.skip-empty to change the behavior if needed.

Thanks,
Namhyung


Namhyung Kim (5):
  perf top: Use evlist->events_stat to count events
  perf hists: Split hists_stats from events_stats
  perf report: Show event sample counts in --stat output
  perf report: Add --skip-empty option to suppress 0 event stat
  perf report: Make --skip-empty as default

 tools/perf/Documentation/perf-config.txt |  5 ++++
 tools/perf/Documentation/perf-report.txt |  3 ++
 tools/perf/builtin-annotate.c            |  6 ++--
 tools/perf/builtin-report.c              | 38 ++++++++++++++++++++----
 tools/perf/builtin-top.c                 | 20 +++++--------
 tools/perf/tests/hists_filter.c          | 14 ++++-----
 tools/perf/ui/stdio/hist.c               |  5 +++-
 tools/perf/util/events_stats.h           | 13 +++++---
 tools/perf/util/hist.c                   | 26 +++++++++++-----
 tools/perf/util/hist.h                   |  7 +++--
 tools/perf/util/session.c                |  5 ++--
 tools/perf/util/session.h                |  3 +-
 12 files changed, 100 insertions(+), 45 deletions(-)


base-commit: 4c391ea001cb2e7bd9a691a886c0dcb030c1791c
-- 
2.31.1.498.g6c1eba8ee3d-goog


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

end of thread, other threads:[~2021-04-26 12:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 18:28 [PATCHSET 0/5] perf report: Make --stat output more compact Namhyung Kim
2021-04-23 18:28 ` [PATCH 1/5] perf top: Use evlist->events_stat to count events Namhyung Kim
2021-04-23 18:28 ` [PATCH 2/5] perf hists: Split hists_stats from events_stats Namhyung Kim
2021-04-23 18:28 ` [PATCH 3/5] perf report: Show event sample counts in --stat output Namhyung Kim
2021-04-23 18:28 ` [PATCH 4/5] perf report: Add --skip-empty option to suppress 0 event stat Namhyung Kim
2021-04-23 18:28 ` [PATCH 5/5] perf report: Make --skip-empty as default Namhyung Kim
2021-04-23 18:46 ` [PATCHSET 0/5] perf report: Make --stat output more compact Andi Kleen
2021-04-23 19:00   ` Namhyung Kim
2021-04-23 20:20     ` Andi Kleen
2021-04-25 18:07       ` Namhyung Kim
2021-04-26  4:31         ` Andi Kleen
2021-04-26 12:53           ` Arnaldo Carvalho de Melo
2021-04-24 12:23   ` Jiri Olsa
2021-04-25 18:03     ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).