linux/tools/perf
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
..
arch perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
bench perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
config Revert "perf tools: Improve setting of gcc debug option" 2015-12-10 16:09:40 -03:00
Documentation perf report/top: Add --raw-trace option 2016-01-06 20:11:12 -03:00
python perf python: Support the PERF_RECORD_SWITCH event 2015-10-07 19:41:50 -03:00
scripts perf tools: Add more documentation to export-to-postgresql.py script 2015-09-28 16:53:07 -03:00
tests perf tools: Pass evlist to setup_sorting() 2016-01-06 20:11:11 -03:00
trace/strace/groups perf trace: Add read/write to the file group 2015-09-04 13:22:06 -03:00
ui perf tools: Skip dynamic fields not defined for current event 2016-01-06 20:11:12 -03:00
util perf tools: Skip dynamic fields not defined for current event 2016-01-06 20:11:12 -03:00
.gitignore perf tools: Add Intel PT instruction decoder 2015-08-17 11:11:36 -03:00
Build perf tools: Provide subcmd configuration at runtime 2015-12-16 16:18:16 -03:00
builtin-annotate.c perf tools: Pass evlist to setup_sorting() 2016-01-06 20:11:11 -03:00
builtin-bench.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-buildid-cache.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-buildid-list.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-config.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-data.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-diff.c perf tools: Pass evlist to setup_sorting() 2016-01-06 20:11:11 -03:00
builtin-evlist.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-help.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-inject.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-kmem.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-kvm.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-list.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-lock.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-mem.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-probe.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-record.c perf tools: Introduce stat perf.data header feature 2015-12-17 15:15:14 -03:00
builtin-report.c perf report/top: Add --raw-trace option 2016-01-06 20:11:12 -03:00
builtin-sched.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-script.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-stat.c perf stat report: Allow to override aggr_mode 2015-12-17 16:30:30 -03:00
builtin-timechart.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-top.c perf report/top: Add --raw-trace option 2016-01-06 20:11:12 -03:00
builtin-trace.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-version.c perf tools: Move cmd_version() to builtin-version.c 2015-12-09 13:42:03 -03:00
builtin.h perf tools: Add 'perf config' command 2015-11-23 18:31:24 -03:00
command-list.txt perf tools: Add 'perf config' command 2015-11-23 18:31:24 -03:00
CREDITS
design.txt perf tools: Update some code references in design.txt 2014-03-18 18:17:06 -03:00
Makefile perf tools: Allow shuffling the build tests 2015-11-05 11:39:54 -03:00
Makefile.perf perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
MANIFEST perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
perf-archive.sh
perf-completion.sh perf tools: Avoid confusion with preloaded bash function for perf bash completion 2015-03-19 13:53:27 -03:00
perf-read-vdso.c perf tools: Build programs to copy 32-bit compatibility 2014-10-29 10:32:48 -02:00
perf-sys.h perf tools: Move generic barriers out of perf-sys.h 2015-05-08 16:05:08 -03:00
perf-with-kcore.sh perf tools: Fix perf-with-kcore handling of arguments containing spaces 2015-08-06 16:48:27 -03:00
perf.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
perf.h perf record: Add ability to name registers to record 2015-08-31 18:01:33 -03:00