alistair23-linux/tools
Namhyung Kim 59c624e239 perf hists browser: Fix percent display in callchains
When there's only a single callchain, perf doesn't print its percentage
in front of the symbols.  This is because it assumes that the percentage
is same as parents.  But if a percent limit is applied, it's possible
that there are actually a couple of child nodes but only one of them is
shown.  In this case it should display the percent to prevent
misunderstanding of its percentage is same as the parent's.

For example, let's see the following callchain.

  $ perf report --no-children --percent-limit 0.01 --tui
  ...
  -    0.06%  sleep    [kernel.vmlinux]    [k] kmem_cache_alloc_trace
       kmem_cache_alloc_trace
     - perf_event_mmap
        - 0.04% mmap_region
             do_mmap_pgoff
           - vm_mmap_pgoff
              + 0.02% sys_mmap_pgoff
              + 0.02% vm_mmap
           + 0.02% mprotect_fixup

Current code omits the percent if 'mmap_region' becomes the only node
when percent limit is set to 0.03%, its percent is not 0.06% but users
will assume it incorrectly.

Before:

  $ perf report --no-children --percent-limit 0.03 --tui
  ...
     0.06%  sleep    [kernel.vmlinux]    [k] kmem_cache_alloc_trace
       kmem_cache_alloc_trace
     - perf_event_mmap
        - mmap_region
          do_mmap_pgoff
          vm_mmap_pgoff

After:

  $ perf report --no-children --percent-limit 0.03 --tui
  ...
     0.06%  sleep    [kernel.vmlinux]    [k] kmem_cache_alloc_trace
       kmem_cache_alloc_trace
     - perf_event_mmap
        - 0.04% mmap_region
             do_mmap_pgoff
             vm_mmap_pgoff

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1453909257-26015-10-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-02-01 17:46:27 -03:00
..
arch
build perf build: Fix feature-dump checks, we need to test all features 2016-01-28 19:04:19 -03:00
cgroup
firewire
hv tools: hv: vss: fix the write()'s argument: error -> vss_msg 2015-12-14 19:15:05 -08:00
iio
include tools: Make list.h self-sufficient 2016-01-12 12:42:07 -03:00
laptop/freefall
lguest
lib perf bpf: Check relocation target section 2016-01-26 12:11:01 -03:00
net tools/net: Use include/uapi with __EXPORTED_HEADERS__ 2015-11-15 17:24:33 -05:00
nfsd
perf perf hists browser: Fix percent display in callchains 2016-02-01 17:46:27 -03:00
power Merge branches 'pm-sleep' and 'pm-tools' 2016-01-12 01:12:03 +01:00
scripts tools: Move Makefile.arch from perf/config to tools/scripts 2016-01-11 19:22:20 -03:00
spi spi: spidev_test: Fix typo in error message 2015-12-08 17:58:56 +00:00
testing Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-01-14 11:57:22 -08:00
thermal/tmon
time
usb
virtio tools/virtio: fix byteswap logic 2015-12-07 17:28:10 +02:00
vm tools/vm/page-types.c: support KPF_IDLE 2015-11-20 16:17:32 -08:00
Makefile Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-01-14 11:39:09 -08:00