linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] perf report: Omit dummy events in the output (v3)
@ 2024-06-07 20:29 Namhyung Kim
  2024-06-07 20:29 ` [PATCH 1/4] perf hist: Factor out __hpp__fmt_print() Namhyung Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Namhyung Kim @ 2024-06-07 20:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users


Hello,

This work is to make the output compact by removing dummy events in
the output.  The dummy events are used to save side-band information
like task creation or memory address space change using mmap(2).  But
after collecting these, it's not used because it won't have any
samples.

 v2 changes)
 * just hide the (dummy) event instead of removing it from evlist

 v3 changes)
 * rename to struct hpp_fmt_value  (Arnaldo)
 * add Tested-by from Arnaldo
 
Sometimes users want to run perf report --group to show all recorded
events together but they are not interested in those dummy events.
This just wastes the precious screen space so we want to get rid of
them in the output.

perf report already has --skip-empty option to skip 0 result in the
stat output.  I think we can extend it to skip empty events that have
no samples.

Example output:

  $ sudo perf mem record -a sleep 1
  $ sudo perf report --group

Before)
  #
  # Samples: 232  of events 'cpu/mem-loads,ldlat=30/P, cpu/mem-stores/P, dummy:u'
  # Event count (approx.): 3089861
  #
  #                 Overhead  Command      Shared Object      Symbol                               
  # ........................  ...........  .................  .....................................
  #
       9.29%   0.00%   0.00%  swapper      [kernel.kallsyms]  [k] update_blocked_averages
       5.26%   0.15%   0.00%  swapper      [kernel.kallsyms]  [k] __update_load_avg_se
       4.15%   0.00%   0.00%  perf-exec    [kernel.kallsyms]  [k] slab_update_freelist.isra.0
       3.87%   0.00%   0.00%  perf-exec    [kernel.kallsyms]  [k] memcg_slab_post_alloc_hook
       3.79%   0.17%   0.00%  swapper      [kernel.kallsyms]  [k] enqueue_task_fair
       3.63%   0.00%   0.00%  sleep        [kernel.kallsyms]  [k] next_uptodate_page
       2.86%   0.00%   0.00%  swapper      [kernel.kallsyms]  [k] __update_load_avg_cfs_rq
       2.78%   0.00%   0.00%  swapper      [kernel.kallsyms]  [k] __schedule
       2.34%   0.00%   0.00%  swapper      [kernel.kallsyms]  [k] intel_idle
       2.32%   0.97%   0.00%  swapper      [kernel.kallsyms]  [k] psi_group_change

After)
  #
  # Samples: 232  of events 'cpu/mem-loads,ldlat=30/P, cpu/mem-stores/P'
  # Event count (approx.): 3089861
  #
  #         Overhead  Command      Shared Object      Symbol                               
  # ................  ...........  .................  .....................................
  #
       9.29%   0.00%  swapper      [kernel.kallsyms]  [k] update_blocked_averages
       5.26%   0.15%  swapper      [kernel.kallsyms]  [k] __update_load_avg_se
       4.15%   0.00%  perf-exec    [kernel.kallsyms]  [k] slab_update_freelist.isra.0
       3.87%   0.00%  perf-exec    [kernel.kallsyms]  [k] memcg_slab_post_alloc_hook
       3.79%   0.17%  swapper      [kernel.kallsyms]  [k] enqueue_task_fair
       3.63%   0.00%  sleep        [kernel.kallsyms]  [k] next_uptodate_page
       2.86%   0.00%  swapper      [kernel.kallsyms]  [k] __update_load_avg_cfs_rq
       2.78%   0.00%  swapper      [kernel.kallsyms]  [k] __schedule
       2.34%   0.00%  swapper      [kernel.kallsyms]  [k] intel_idle
       2.32%   0.97%  swapper      [kernel.kallsyms]  [k] psi_group_change

Now 'Overhead' column only has two values for mem-loads and mem-stores.

Thanks,
Namhyung


Namhyung Kim (4):
  perf hist: Factor out __hpp__fmt_print()
  perf hist: Simplify __hpp_fmt() using hpp_fmt_data
  perf hist: Add symbol_conf.skip_empty
  perf hist: Honor symbol_conf.skip_empty

 tools/perf/builtin-annotate.c  |   4 +-
 tools/perf/builtin-report.c    |  12 +--
 tools/perf/ui/hist.c           | 144 ++++++++++++++++-----------------
 tools/perf/ui/stdio/hist.c     |   5 +-
 tools/perf/util/events_stats.h |   3 +-
 tools/perf/util/evsel.c        |  13 ++-
 tools/perf/util/hist.c         |   6 +-
 tools/perf/util/hist.h         |   3 +-
 tools/perf/util/python.c       |   3 +
 tools/perf/util/session.c      |   5 +-
 tools/perf/util/session.h      |   3 +-
 tools/perf/util/symbol_conf.h  |   3 +-
 12 files changed, 105 insertions(+), 99 deletions(-)

-- 
2.45.2.505.gda0bf45e8d-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 0/4] perf report: Omit dummy events in the output (v2)
@ 2024-06-03 22:44 Namhyung Kim
  2024-06-03 22:44 ` [PATCH 4/4] perf hist: Honor symbol_conf.skip_empty Namhyung Kim
  0 siblings, 1 reply; 7+ messages in thread
From: Namhyung Kim @ 2024-06-03 22:44 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users

Hello,

This work is to make the output compact by removing dummy events in
the output.  The dummy events are used to save side-band information
like task creation or memory address space change using mmap(2).  But
after collecting these, it's not used because it won't have any
samples.

 v2 changes)
 * just hide the (dummy) event instead of removing it from evlist

Sometimes users want to run perf report --group to show all recorded
events together but they are not interested in those dummy events.
This just wastes the precious screen space so we want to get rid of
them after use.

perf report already has --skip-empty option to skip 0 result in the
stat output.  I think we can extend it to skip empty events that have
no samples.

Example output:

Before)
  #
  # Samples: 232  of events 'cpu/mem-loads,ldlat=30/P, cpu/mem-stores/P, dummy:u'
  # Event count (approx.): 3089861
  #
  #                 Overhead  Command      Shared Object      Symbol                               
  # ........................  ...........  .................  .....................................
  #
       9.29%   0.00%   0.00%  swapper      [kernel.kallsyms]  [k] update_blocked_averages
       5.26%   0.15%   0.00%  swapper      [kernel.kallsyms]  [k] __update_load_avg_se
       4.15%   0.00%   0.00%  perf-exec    [kernel.kallsyms]  [k] slab_update_freelist.isra.0
       3.87%   0.00%   0.00%  perf-exec    [kernel.kallsyms]  [k] memcg_slab_post_alloc_hook
       3.79%   0.17%   0.00%  swapper      [kernel.kallsyms]  [k] enqueue_task_fair
       3.63%   0.00%   0.00%  sleep        [kernel.kallsyms]  [k] next_uptodate_page
       2.86%   0.00%   0.00%  swapper      [kernel.kallsyms]  [k] __update_load_avg_cfs_rq
       2.78%   0.00%   0.00%  swapper      [kernel.kallsyms]  [k] __schedule
       2.34%   0.00%   0.00%  swapper      [kernel.kallsyms]  [k] intel_idle
       2.32%   0.97%   0.00%  swapper      [kernel.kallsyms]  [k] psi_group_change

After)
  #
  # Samples: 232  of events 'cpu/mem-loads,ldlat=30/P, cpu/mem-stores/P'
  # Event count (approx.): 3089861
  #
  #         Overhead  Command      Shared Object      Symbol                               
  # ................  ...........  .................  .....................................
  #
       9.29%   0.00%  swapper      [kernel.kallsyms]  [k] update_blocked_averages
       5.26%   0.15%  swapper      [kernel.kallsyms]  [k] __update_load_avg_se
       4.15%   0.00%  perf-exec    [kernel.kallsyms]  [k] slab_update_freelist.isra.0
       3.87%   0.00%  perf-exec    [kernel.kallsyms]  [k] memcg_slab_post_alloc_hook
       3.79%   0.17%  swapper      [kernel.kallsyms]  [k] enqueue_task_fair
       3.63%   0.00%  sleep        [kernel.kallsyms]  [k] next_uptodate_page
       2.86%   0.00%  swapper      [kernel.kallsyms]  [k] __update_load_avg_cfs_rq
       2.78%   0.00%  swapper      [kernel.kallsyms]  [k] __schedule
       2.34%   0.00%  swapper      [kernel.kallsyms]  [k] intel_idle
       2.32%   0.97%  swapper      [kernel.kallsyms]  [k] psi_group_change

Now 'Overhead' column only has two values for mem-loads and mem-stores.

Thanks,
Namhyung


Namhyung Kim (4):
  perf hist: Factor out __hpp__fmt_print()
  perf hist: Simplify __hpp_fmt() using hpp_fmt_data
  perf hist: Add symbol_conf.skip_empty
  perf hist: Honor symbol_conf.skip_empty

 tools/perf/builtin-annotate.c  |   4 +-
 tools/perf/builtin-report.c    |  12 +--
 tools/perf/ui/hist.c           | 144 ++++++++++++++++-----------------
 tools/perf/ui/stdio/hist.c     |   5 +-
 tools/perf/util/events_stats.h |   3 +-
 tools/perf/util/evsel.c        |  13 ++-
 tools/perf/util/hist.c         |   6 +-
 tools/perf/util/hist.h         |   3 +-
 tools/perf/util/python.c       |   3 +
 tools/perf/util/session.c      |   5 +-
 tools/perf/util/session.h      |   3 +-
 tools/perf/util/symbol_conf.h  |   3 +-
 12 files changed, 105 insertions(+), 99 deletions(-)

-- 
2.45.1.288.g0e0cd299f1-goog


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

end of thread, other threads:[~2024-06-16  4:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-07 20:29 [PATCH 0/4] perf report: Omit dummy events in the output (v3) Namhyung Kim
2024-06-07 20:29 ` [PATCH 1/4] perf hist: Factor out __hpp__fmt_print() Namhyung Kim
2024-06-07 20:29 ` [PATCH 2/4] perf hist: Simplify __hpp_fmt() using hpp_fmt_data Namhyung Kim
2024-06-07 20:29 ` [PATCH 3/4] perf hist: Add symbol_conf.skip_empty Namhyung Kim
2024-06-07 20:29 ` [PATCH 4/4] perf hist: Honor symbol_conf.skip_empty Namhyung Kim
2024-06-16  4:45 ` [PATCH 0/4] perf report: Omit dummy events in the output (v3) Namhyung Kim
  -- strict thread matches above, loose matches on Subject: below --
2024-06-03 22:44 [PATCH 0/4] perf report: Omit dummy events in the output (v2) Namhyung Kim
2024-06-03 22:44 ` [PATCH 4/4] perf hist: Honor symbol_conf.skip_empty 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).