perf hists browser: Print overhead percent value for first-level callchain
authorNamhyung Kim <namhyung@kernel.org>
Mon, 24 Nov 2014 08:13:26 +0000 (17:13 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 24 Nov 2014 14:28:48 +0000 (11:28 -0300)
commit4087d11cd9455cd28da0795504451d1188633a0d
tree26139f34da6ca081fca94c20f0da8b9c03c60ad9
parent4e6e311e596eadba30d4f56f64eae7d45611a01c
perf hists browser: Print overhead percent value for first-level callchain

Currently perf report on TUI doesn't print percent for first-level
callchain entry.

I guess it (wrongly) assumes that there's only a single callchain in the
first level.

This patch fixes it by handling the first level callchains same as
others - if it's not 100% it should print the percent value.

Also it'll affect other callchains in the other way around - if it's
100% (single callchain) it should not print the percentage.

Before:
  -   30.95%     6.84%  abc2     abc2              [.] a
     - a
        - 70.00% c
           - 100.00% apic_timer_interrupt
                smp_apic_timer_interrupt
                local_apic_timer_interrupt
                hrtimer_interrupt
                ...
        + 30.00% b
     + __libc_start_main

After:
  -   30.95%     6.84%  abc2     abc2              [.] a
     - 77.90% a
        - 70.00% c
           - apic_timer_interrupt
             smp_apic_timer_interrupt
             local_apic_timer_interrupt
             hrtimer_interrupt
             ...
        + 30.00% b
     + 22.10% __libc_start_main

Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1416816807-6495-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/hists.c