Linux Modules
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Petr Pavlu <petr.pavlu@suse.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Daniel Gomez <da.gomez@samsung.com>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	linux-modules@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] tracing: Introduce relative stacktrace
Date: Wed, 29 Jan 2025 09:23:17 +0900	[thread overview]
Message-ID: <20250129092317.c0c58eb62fa7b74133eb4d51@kernel.org> (raw)
In-Reply-To: <a7a171c4-7feb-4f26-a832-18d38a3ee973@efficios.com>

On Tue, 28 Jan 2025 10:46:21 -0500
Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:

> On 2025-01-28 10:36, Masami Hiramatsu (Google) wrote:
> > Hi,
> > 
> > This introduces relative stacktrace, which records stacktrace entry as
> > the offset from _stext instead of raw address. User can enable this
> > format by setting options/relative-stacktrace.
> > 
> > Basically, this does not change anything for users who are using ftrace
> > with 'trace' text-formatted interface. This changes how each stacktrace
> > entry address is stored, so users who is using 'trace_pipe_raw' needs
> > to change how to decode the stacktrace.
> > 
> > Currently, the stacktrace is stored as raw kernel address. Thus, for
> > decoding the binary trace data, we need to refer the kallsyms. But this
> > is not useful on the platform which prohibits to access /proc/kallsyms
> > for security reason. Since KASLR will change the kernel text address,
> > we can not decode symbols without kallsyms in userspace.
> > 
> > On the other hand, if we record the stacktrace entries in the offset
> > from _stext, we can use System.map file to decode it. This is also good
> > for the stacktrace in the persistent ring buffer, because we don't need
> > to save the kallsyms before crash anymore.
> > 
> > The problem is to decode the address in the modules because it will be
> > loaded in the different place. To solve this issue, I also introduced
> > 'module_text_offsets' event, which records module's text and init_text
> > info as the offset from _stext when loading it. User can store this
> > event in the (another) persistent ring buffer for decoding.
> 
> This does not handle the situation where a module is already loaded
> before tracing starts. In LTTng we have a statedump facility for this,
> where we can iterate on all modules at trace start and dump the relevant
> information.

BTW, if we only covers the crash by watchdog or oops, we can dump the
all loaded module info at the panic code.

Thank you,



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

      parent reply	other threads:[~2025-01-29  0:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28 15:36 [RFC PATCH 0/3] tracing: Introduce relative stacktrace Masami Hiramatsu (Google)
2025-01-28 15:37 ` [RFC PATCH 1/3] tracing: Record stacktrace as the offset from _stext Masami Hiramatsu (Google)
2025-01-28 15:37 ` [RFC PATCH 2/3] tracing: Introduce "rel_stack" option Masami Hiramatsu (Google)
2025-01-28 16:07   ` Steven Rostedt
2025-01-29  0:14     ` Masami Hiramatsu
2025-01-28 15:37 ` [RFC PATCH 3/3] modules: tracing: Add module_text_offsets event Masami Hiramatsu (Google)
2025-01-28 15:46 ` [RFC PATCH 0/3] tracing: Introduce relative stacktrace Mathieu Desnoyers
2025-01-28 16:27   ` Steven Rostedt
2025-01-28 16:46     ` Mathieu Desnoyers
2025-01-28 17:30       ` Steven Rostedt
2025-01-29  0:58       ` Masami Hiramatsu
2025-01-29  1:09         ` Steven Rostedt
2025-01-29  7:25           ` Masami Hiramatsu
2025-01-29 14:42             ` Steven Rostedt
2025-01-29  0:17     ` Masami Hiramatsu
2025-01-29  0:19   ` Masami Hiramatsu
2025-01-29  0:23   ` Masami Hiramatsu [this message]

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=20250129092317.c0c58eb62fa7b74133eb4d51@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=da.gomez@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mcgrof@kernel.org \
    --cc=petr.pavlu@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.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