Re: [RFC PATCH v2 1/3] tracing: Show last module text symbols in the stacktrace

Masami Hiramatsu
2025-03-10T08:59:50Z

On Thu, 6 Mar 2025 19:46:27 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Tue, 11 Feb 2025 00:43:57 +0900
> "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
>
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> >
> > Since the previous boot trace buffer can include module text address in
> > the stacktrace. As same as the kernel text address, convert the module
> > text address using the module address information.
> >
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > ---
> > Changes in v2:
> > - Add LRU based removed module information override.
>
> I don't think we should bother supporting removal of modules yet.
>
> It also makes this patch way too complex for what it should do.
>
> > - Fix to move module_delta initialization after tr->scratch check.
>
> > - Fix to make mod_delta on all loaded modules correctly.
>
> Should be a separate patch.
>
> > - (Note, I don't add uname check yet)
> > - Fix mod_addr_comp() overflow issue.
> > - Add pr_info() when failed to allocate module_delta.
>
> So basically this patch should just add the code to handle finding the
> module for stack traces. Not to mention, I have code that depends on that,
> but this patch currently does way to much.
>
> Can you just send a patch that adds the trace_adjust_address() (although, I
> would shorten it to "trace_addr_adjust()").
>
> And add what is needed to update the trace_stack_print().
>
> You can base it off of the ring-buffer/for-next branch.

OK, BTW, if we always need tscratch, we can move module_delta in it.
Let's reimplement it.

Thanks,

>
> Thanks,
>
> -- Steve
>
>
> > ---
> > kernel/trace/trace.c | 173 ++++++++++++++++++++++++++++++++++++++++---
> > kernel/trace/trace.h | 4 +
> > kernel/trace/trace_output.c | 3 -
> > 3 files changed, 167 insertions(+), 13 deletions(-)
> >

--
Masami Hiramatsu (Google) <mhiramat@kernel.org>