mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ARM: perf: Use correct unwind info for tracepoint events
       [not found] <20220921002446.3096120-1-tnovak@fb.com>
@ 2024-02-27  6:58 ` Haibo Li
  0 siblings, 0 replies; only message in thread
From: Haibo Li @ 2024-02-27  6:58 UTC (permalink / raw)
  To: tnovak
  Cc: acme, alexander.shishkin, jolsa, linux-arm-kernel, linux-kernel,
	linux-perf-users, linux, mark.rutland, mingo, namhyung, peterz,
	will, xiaoming.yu, Haibo Li

>Unwinding tends to work okay in practice 
>because perf_trace_* functions and their callers 
>usually have similar prologues.A common unwind insn sequence
>is "sp=fp, sp-=X, pop_r4_to_rN", so even if prologues don't match exactly,
>stored LR gets correctly popped off the stack.

It does not work well for all tracepoint events.
perf gets incomplete stacktrace after below commands
if CONFIG_ARM_UNWIND is on:

perf record -e block:block_rq_complete  -g sleep 10
perf script
'''
swapper     0 [000] 50333.927556: block:block_rq_complete:
 254,0 WSM () 376888 + 18 [0]
      804ac458 __traceiter_block_rq_complete+0x3c ([kernel.kallsyms])
      806bdd70 virtblk_done+0xc8 ([kernel.kallsyms])
      10 [unknown] ([unknown])
'''
In experiment,
ext4:ext4_da_write_begin,
block:block_rq_complete,
csd:csd_function_entry
suffer from above problem(maybe more).

As you said,it is caused by mismatched ARM_pc.

After apply similar patch,now perf gets correct stacktrace:
swapper     0 [000]   122.003800: block:block_rq_complete:
 254,0 WSM () 377064 + 16 [0]
 804acdd4 perf_trace_block_rq_completion+0x80 ([kernel.kallsyms])
 804ac2b0 __traceiter_block_rq_complete+0x3c ([kernel.kallsyms])
 804b9388 blk_update_request+0x64 ([kernel.kallsyms])
 804b9ab4 blk_mq_end_request+0x14 ([kernel.kallsyms])
 804c0bac blk_done_softirq+0x58 ([kernel.kallsyms])
 8010135c __softirqentry_text_start+0x138 ([kernel.kallsyms])
 801298f8 __irq_exit_rcu+0x58 ([kernel.kallsyms])
 801299a0 irq_exit+0x8 ([kernel.kallsyms])
 80100ba8 __irq_svc+0x88 ([kernel.kallsyms])
 80165628 arch_local_irq_enable+0x4 ([kernel.kallsyms])
 801659d8 do_idle+0xdc ([kernel.kallsyms])
 80165bf4 cpu_startup_entry+0x28 ([kernel.kallsyms])
 809c8764 kernel_init+0x0 ([kernel.kallsyms])

Acked-by: Haibo Li <haibo.li@mediatek.com>


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-27  6:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220921002446.3096120-1-tnovak@fb.com>
2024-02-27  6:58 ` [PATCH] ARM: perf: Use correct unwind info for tracepoint events Haibo Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®