From: Haibo Li <haibo.li@mediatek.com>
To: <tnovak@fb.com>
Cc: <acme@kernel.org>, <alexander.shishkin@linux.intel.com>,
<jolsa@kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
<linux-perf-users@vger.kernel.org>, <linux@armlinux.org.uk>,
<mark.rutland@arm.com>, <mingo@redhat.com>, <namhyung@kernel.org>,
<peterz@infradead.org>, <will@kernel.org>,
<xiaoming.yu@mediatek.com>, Haibo Li <haibo.li@mediatek.com>
Subject: [PATCH] ARM: perf: Use correct unwind info for tracepoint events
Date: Tue, 27 Feb 2024 14:58:28 +0800 [thread overview]
Message-ID: <20240227065828.24598-1-haibo.li@mediatek.com> (raw)
In-Reply-To: <20220921002446.3096120-1-tnovak@fb.com>
>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>
parent reply other threads:[~2024-02-27 6:58 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20220921002446.3096120-1-tnovak@fb.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240227065828.24598-1-haibo.li@mediatek.com \
--to=haibo.li@mediatek.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tnovak@fb.com \
--cc=will@kernel.org \
--cc=xiaoming.yu@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®