From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Matthieu Baerts <matttbe@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Sasha Levin <sashal@kernel.org>,
Carlos Llamas <cmllamas@google.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] decode_stacktrace: Support heuristic caller address search
Date: Fri, 6 Mar 2026 01:11:12 +0900 [thread overview]
Message-ID: <20260306011112.6f05f1431740e6dd09cb4dee@kernel.org> (raw)
In-Reply-To: <23aaa915-08b4-4f9d-9622-6ee7f770c8be@kernel.org>
On Thu, 5 Mar 2026 15:56:13 +0100
Matthieu Baerts <matttbe@kernel.org> wrote:
> Hi Masami,
>
> On 05/03/2026 06:12, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> >
> > Add -c option to search call address search to decode_stacktrace.
> > This tries to decode line info backwards, starting from 1byte before
> > the return address, and displays the first line info it founds as
> > the caller address.
> > If it tries up to 10bytes before (or the symbol address) and still
> > can not find it, it gives up and decodes the return address.
>
> Thank you for this new option!
>
> > With -c option:
> > Call Trace:
> > <TASK>
> > dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120)
> > lockdep_rcu_suspicious (kernel/locking/lockdep.c:6876)
> > event_filter_pid_sched_process_fork (kernel/trace/trace_events.c:1057)
> > kernel_clone (include/trace/events/sched.h:396 include/trace/events/sched.h:396 kernel/fork.c:2664)
> > __x64_sys_clone (kernel/fork.c:2795 kernel/fork.c:2779 kernel/fork.c:2779)
> > do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
> > ? entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
> > ? trace_irq_disable (include/trace/events/preemptirq.h:36)
> > entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
> >
> >
> > Without -c option:
> > Call Trace:
> > <TASK>
> > dump_stack_lvl (lib/dump_stack.c:122)
> > lockdep_rcu_suspicious (kernel/locking/lockdep.c:6877)
> > event_filter_pid_sched_process_fork (kernel/trace/trace_events.c:?)
> > kernel_clone (include/trace/events/sched.h:? include/trace/events/sched.h:396 kernel/fork.c:2664)
> > __x64_sys_clone (kernel/fork.c:2779)
> > do_syscall_64 (arch/x86/entry/syscall_64.c:?)
> > ? entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
> > ? trace_irq_disable (include/trace/events/preemptirq.h:36)
> > entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
> That's better indeed!
>
> Do we need a new option for that? Could it not be the new default
> behaviour? Or are there any downsides with it?
AFAIK, this may not work well on the architectures which have delay
slot (I have not tested) which will execute one more instruction
after branch before branching. In that case, the return address will
not be the next instruction of the delay slot.
But I think that is not popular anymore, so we can switch the default
behavior and maybe we can switch it based on architecture.
Thank you,
>
> "addr2line" will be called more, but if it is worth it, it is probably
> not an issue, or is it?
>
> Cheers,
> Matt
> --
> Sponsored by the NGI0 Core fund.
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2026-03-05 16:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 5:12 Masami Hiramatsu (Google)
2026-03-05 14:56 ` Matthieu Baerts
2026-03-05 16:11 ` Masami Hiramatsu [this message]
2026-03-05 15:51 ` Sasha Levin
2026-03-05 16:32 ` Masami Hiramatsu
2026-03-05 20:38 ` Sasha Levin
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=20260306011112.6f05f1431740e6dd09cb4dee@kernel.org \
--to=mhiramat@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cmllamas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=matttbe@kernel.org \
--cc=sashal@kernel.org \
/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