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

From: Steven Rostedt
Date: Thu Mar 06 2025 - 19:46:37 EST


On Tue, 11 Feb 2025 00:43:57 +0900
"Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx> wrote:

> From: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> ---
> 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.

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(-)
>