Sukadev Bhattiprolu <[email protected]> wrote on 05/09/2014
09:46:38 PM:

> From: Sukadev Bhattiprolu <[email protected]>
> To: Arnaldo Carvalho de Melo <[email protected]>,
> Cc: [email protected], Anton Blanchard
> <[email protected]>, [email protected], Michael Ellerman
> <[email protected]>, Maynard Johnson/Rochester/IBM@IBMUS,
> [email protected]
> Date: 05/09/2014 09:46 PM
> Subject: [PATCH 1/1] powerpc/perf: Adjust callchain based on DWARF debug
info
>
> [PATCH 1/1] powerpc/perf: Adjust callchain based on DWARF debug info

Acked-by: Maynard Johnson <[email protected]>

Reviewed and tested.  Thanks, Suka.

-Maynard

>
> When saving the callchain on Power, the kernel conservatively saves
excess
> entries in the callchain. A few of these entries are needed in some cases
> but not others.
>
> Eg: the value in the link register (LR) is needed only when it holds the
> return address of a function. At other times it must be ignored.
>
> If the unnecessary entries are not ignored, we end up with duplicate arcs
> in the call-graphs.
>
> Use DWARF debug information to ignore the unnecessary entries.
>
> Callgraph before the patch:
>
>     14.67%          2234  sprintft  libc-2.18.so       [.] __random
>             |
>             --- __random
>                |
>                |--61.12%-- __random
>                |          |
>                |          |--97.15%-- rand
>                |          |          do_my_sprintf
>                |          |          main
>                |          |          generic_start_main.isra.0
>                |          |          __libc_start_main
>                |          |          0x0
>                |          |
>                |           --2.85%-- do_my_sprintf
>                |                     main
>                |                     generic_start_main.isra.0
>                |                     __libc_start_main
>                |                     0x0
>                |
>                 --38.88%-- rand
>                           |
>                           |--94.01%-- rand
>                           |          do_my_sprintf
>                           |          main
>                           |          generic_start_main.isra.0
>                           |          __libc_start_main
>                           |          0x0
>                           |
>                            --5.99%-- do_my_sprintf
>                                      main
>                                      generic_start_main.isra.0
>                                      __libc_start_main
>                                      0x0
>
> Callgraph after the patch:
>
>     14.67%          2234  sprintft  libc-2.18.so       [.] __random
>             |
>             --- __random
>                |
>                |--95.93%-- rand
>                |          do_my_sprintf
>                |          main
>                |          generic_start_main.isra.0
>                |          __libc_start_main
>                |          0x0
>                |
>                 --4.07%-- do_my_sprintf
>                           main
>                           generic_start_main.isra.0
>                           __libc_start_main
>                           0x0
>
> TODO:   For split-debug info objects like glibc, we can only determine
>    the call-frame-address only when both .eh_frame and .debug_info
>    sections are available. We should be able to determin the CFA
>    even without the .eh_frame section.
>
> Thanks to Ulrich Weigand for help with DWARF debug information.
>
> Fix suggested by Anton Blanchard.
>
> Reported-by: Maynard Johnson <[email protected]>
> Signed-off-by: Sukadev Bhattiprolu <[email protected]>
> ---
>  tools/perf/arch/powerpc/Makefile                |   1 +
>  tools/perf/arch/powerpc/util/adjust-callchain.c | 278 +++++++++++++
> +++++++++++
>  tools/perf/config/Makefile                      |   5 +
>  tools/perf/util/callchain.h                     |  12 +
>  tools/perf/util/machine.c                       |  16 +-
>  5 files changed, 310 insertions(+), 2 deletions(-)
>  create mode 100644 tools/perf/arch/powerpc/util/adjust-callchain.c
>
[snip]
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to