linux-stable/tools/perf/ui
Namhyung Kim 361459f163 perf tools: Skip dynamic fields not defined for current event
When there are multiple events, each dynamic sort key is defined just
for one event.  In this case other events will always show "N/A" for
those fields.  But they are meaningless and consume precious screen
width.

Let's skip those undefined dynamic fields.

  $ perf record -e kmem:kmalloc,kmem:kfree -a sleep 1

  $ perf report -s 'comm,kmalloc.*' --stdio
  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 20K of event 'kmem:kmalloc'
  # Event count (approx.): 20533
  #
  # Overhead  Command           call_site                 ptr  bytes_req  bytes_alloc            gfp_flags
  # ........  .......  ..................  ..................  .........  ...........  ...................
  #
      99.89%  perf       ffffffffa01d4396  0xffff8803ffb79720         96           96    GFP_NOFS|GFP_ZERO
       0.06%  sleep      ffffffff8114e1cd  0xffff8803d228a000       4096         4096           GFP_KERNEL
       0.03%  perf       ffffffff811d6ae6  0xffff8803f7678f00        240          256  GFP_KERNEL|GFP_ZERO
       0.00%  perf       ffffffff812263c1  0xffff880406172380        128          128           GFP_KERNEL
       0.00%  perf       ffffffff812264b9  0xffff8803ffac1600        504          512           GFP_KERNEL
       0.00%  perf       ffffffff81226634  0xffff880401dc5280         28           32           GFP_KERNEL
       0.00%  sleep      ffffffff81226da9  0xffff8803ffac3a00        392          512           GFP_KERNEL

  # Samples: 20K of event 'kmem:kfree'
  # Event count (approx.): 20597
  #
  # Overhead  Command
  # ........  ..............
  #
      99.63%  perf
       0.14%  sleep
       0.11%  irq/36-iwlwifi
       0.11%  kworker/u16:0
       0.01%  Xorg
       0.00%  firefox

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1450804030-29193-12-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-01-06 20:11:12 -03:00
..
browsers perf tools: Skip dynamic fields not defined for current event 2016-01-06 20:11:12 -03:00
gtk perf tools: Skip dynamic fields not defined for current event 2016-01-06 20:11:12 -03:00
stdio perf tools: Skip dynamic fields not defined for current event 2016-01-06 20:11:12 -03:00
tui perf ui tui: Register the error callbacks before initializing the widgets 2015-10-22 16:44:17 -03:00
browser.c perf tui: Change default selection background color to yellow 2015-12-09 13:41:55 -03:00
browser.h perf ui browser: Optional horizontal scrolling key binding 2015-10-05 17:59:49 -03:00
Build perf build: Add slang objects building 2015-02-12 11:48:13 -03:00
helpline.c perf ui/helpline: Introduce ui_helpline__vshow() 2012-12-09 08:46:04 -03:00
helpline.h perf ui/helpline: Introduce ui_helpline__vshow() 2012-12-09 08:46:04 -03:00
hist.c perf tools: Skip dynamic fields not defined for current event 2016-01-06 20:11:12 -03:00
keysyms.h perf hists browser: Add option for runtime switching perf data file 2013-02-06 18:09:24 -03:00
libslang.h perf ui browser: Introduce ui_browser__printf() 2015-08-12 10:27:05 -03:00
progress.c perf ui progress: Per progress bar state 2013-10-23 15:40:38 -03:00
progress.h perf tools: Remove EOL whitespaces 2015-01-21 13:24:31 -03:00
setup.c perf tools: Call perf_hpp__init() before setting up GUI browsers 2014-05-21 11:45:35 +02:00
ui.h perf tools: Separate out GTK codes to libperf-gtk.so 2013-10-09 15:55:25 -03:00
util.c perf evsel: Introduce perf_evsel__open_strerror method 2013-01-24 16:40:09 -03:00
util.h perf ui: Introduce struct perf_error_ops 2012-06-19 13:06:18 -03:00