• Namhyung Kim's avatar
    perf report: Add callchain value option · f2af0086
    Namhyung Kim authored
    Now -g/--call-graph option supports how to display callchain values.
    Possible values are 'percent', 'period' and 'count'.  The percent is
    same as before and it's the default behavior.  The period displays the
    raw period value rather than the percentage.  The count displays the
    number of occurrences.
    
      $ perf report --no-children --stdio -g percent
      ...
        39.93%  swapper  [kernel.vmlinux]  [k] intel_idel
                |
                ---intel_idle
                   cpuidle_enter_state
                   cpuidle_enter
                   call_cpuidle
                   cpu_startup_entry
                   |
                   |--28.63%-- start_secondary
                   |
                    --11.30%-- rest_init
    
      $ perf report --no-children --show-total-period --stdio -g period
      ...
        39.93%   13018705  swapper  [kernel.vmlinux]  [k] intel_idel
                |
                ---intel_idle
                   cpuidle_enter_state
                   cpuidle_enter
                   call_cpuidle
                   cpu_startup_entry
                   |
                   |--9334403-- start_secondary
                   |
                    --3684302-- rest_init
    
      $ perf report --no-children --show-nr-samples --stdio -g count
      ...
        39.93%     80  swapper  [kernel.vmlinux]  [k] intel_idel
                |
                ---intel_idle
                   cpuidle_enter_state
                   cpuidle_enter
                   call_cpuidle
                   cpu_startup_entry
                   |
                   |--57-- start_secondary
                   |
                    --23-- rest_init
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Acked-by: default avatarBrendan Gregg <brendan.d.gregg@gmail.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Kan Liang <kan.liang@intel.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/1447047946-1691-6-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    f2af0086
builtin-report.c 27.9 KB