Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61c92ff9 authored by Hou Pengyang's avatar Hou Pengyang Committed by Amit Pundir
Browse files

UPSTREAM: arm: perf: Fix callchain parse error with kernel tracepoint events

For ARM, when tracing with tracepoint events, the IP and cpsr are set
to 0, preventing the perf code parsing the callchain and resolving the
symbols correctly.

 ./perf record -e sched:sched_switch -g --call-graph dwarf ls
    [ perf record: Captured and wrote 0.006 MB perf.data ]
 ./perf report -f
    Samples: 5  of event 'sched:sched_switch', Event count (approx.): 5
    Children      Self    Command  Shared Object     Symbol
    100.00%       100.00%  ls       [unknown]         [.] 00000000

The fix is to implement perf_arch_fetch_caller_regs for ARM, which fills
several necessary registers used for callchain unwinding, including pc,sp,
fp and cpsr.

With this patch, callchain can be parsed correctly as :

   .....
-  100.00%   100.00%  ls       [kernel.kallsyms]  [k] __sched_text_start
   + __sched_text_start
+   20.00%     0.00%  ls       libc-2.18.so       [.] _dl_addr
+   20.00%     0.00%  ls       libc-2.18.so       [.] write
   .....

Jean Pihet found this in ARM and come up with a patch:
http://thread.gmane.org/gmane.linux.kernel/1734283/focus=1734280



This patch rewrite Jean's patch in C.

Signed-off-by: default avatarHou Pengyang <houpengyang@huawei.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
(cherry picked from commit b3eac0265bf6258f08dcd4ac7fa7f87cc050defc)
Bug: 29520177
Signed-off-by: default avatarMohan Srinivasan <srmohan@google.com>
Change-Id: Ia87ea58982acdf3bcdfa43bdeed92539f46e8b0c
parent 601e0069
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment