perf report: Add -q/--quiet option
authorNamhyung Kim <namhyung@kernel.org>
Fri, 17 Feb 2017 08:17:39 +0000 (17:17 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 20 Feb 2017 14:46:58 +0000 (11:46 -0300)
commit27fafab59a60b6f02491f2ff44cafd4f2335e487
treed96a1a229347db59e0fc2bae52efa181e2ebf2fc
parentbb963e16507ca7670f0bb47ccaada8874b2ba6a1
perf report: Add -q/--quiet option

The -q/--quiet option is to suppress any message.  Sometimes users just
want to see the numbers and it can be used for that case.

Before:

  $ perf report | head -15
  Failed to open /lib/modules/3.19.3-3-ARCH/kernel/fs/ext4/ext4.ko.gz, continuing without symbols
  Failed to open /lib/modules/3.19.3-3-ARCH/kernel/fs/jbd2/jbd2.ko.gz, continuing without symbols
  Failed to open /tmp/perf-14507.map, continuing without symbols
  ...
  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 39K of event 'cycles'
  # Event count (approx.): 30444796573
  #
  # Overhead  Command      Shared Object        Symbol
  # ........  ...........  ...................  .........................
  #
       9.28%  swapper    [kernel.vmlinux]     [k] intel_idle
       5.64%  swapper    [kernel.vmlinux]     [k] native_write_msr_safe
       1.93%  swapper    [kernel.vmlinux]     [k] __switch_to
       1.89%  swapper    [kernel.vmlinux]     [k] menu_select
       1.75%  sched-pipe   [kernel.vmlinux]     [k] __switch_to

After:

  $ perf report -q | head
       9.28%  swapper    [kernel.vmlinux]     [k] intel_idle
       5.64%  swapper    [kernel.vmlinux]     [k] native_write_msr_safe
       1.93%  swapper    [kernel.vmlinux]     [k] __switch_to
       1.89%  swapper    [kernel.vmlinux]     [k] menu_select
       1.75%  sched-pipe   [kernel.vmlinux]     [k] __switch_to
       1.67%  swapper    [kernel.vmlinux]     [k] cpu_startup_entry
       1.48%  sched-pipe   [kernel.vmlinux]     [k] enqueue_entity
       1.46%  swapper    [kernel.vmlinux]     [k] __schedule
       1.36%  swapper    [kernel.vmlinux]     [k] native_read_tsc
       1.34%  sched-pipe   [kernel.vmlinux]     [k] __schedule

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Suggested-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: kernel-team@lge.com
Link: http://lkml.kernel.org/r/20170217081742.17417-4-namhyung@kernel.org
[ Removed builtin-report.c verbose > 0 hunk added to the previous patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-report.txt
tools/perf/builtin-report.c