mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/3] ring-buffer: Add uname to match criteria for persistent ring buffer
Date: Tue, 17 Dec 2024 14:22:22 -0500	[thread overview]
Message-ID: <c320510d-c0ec-4c4c-98b5-457c193cae6d@efficios.com> (raw)
In-Reply-To: <CAHk-=wjThke2-HB_Zi35xHe9ayTPk=zB_kjd0Hr-Yn1oV0ZSsg@mail.gmail.com>

On 2024-12-17 13:24, Linus Torvalds wrote:
> On Tue, 17 Dec 2024 at 10:19, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>>
>> What *woiuld* have been an acceptable model is to actually modify the
>> boot-time buffers in place, using actual real heuristics that look at
>> whether a pointer was IN THE CODE SECTION OR THE STATIC DATA section
>> of the previous boot.
>>
>> But you never did that. All this delta code has always been complete
>> and utter garbage, and complete hacks.
> 
> Actually, I think the proper model isn't even that "modify boot time
> buffers in place" thing.
> 
> The proper model was probably always to just do the "give the raw
> data, and analyze the previous boot data in user mode".

It appears that you just summarized the LTTng (out-of-tree) kernel
tracer [1] model in one short sentence.

If this can help in some way, within the LTTng model, here is how
we're solving the problem of mapping addresses to symbols:

1- We have a statedump infrastructure, which dumps internal kernel
    state. It could dump the kernel and each module base addresses
    into the trace. (we do it for userspace tracing)

2- We can hook on module load/unload to insert event about insertion
    and removal of those base addresses into the trace buffers.
    (we do it for userspace tracing)

3- We augment the traces at post-processing with DWARF and ELF parsers
    in Babeltrace [2] to augment the trace with symbolic information
    using the ELF or DWARF files as inputs in addition to the traces.
    (this already exists, and is used for userspace traces)

4- We already have the integration of the LTTng Userspace tracer
    with PMEM and DAX to recover traces after a machine crash.
    Those buffers are self-described with an ABI which allows a
    userspace tool (lttng-crash) to extract well-formed Common
    Trace Format [3] traces from the buffers after reboot. We've
    never had the incentive to port this facility to the kernel
    tracer so far though.

Thanks,

Mathieu

[1] https://lttng.org
[2] https://babeltrace.org
[3] https://diamon.org/ctf

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com


  parent reply	other threads:[~2024-12-17 19:22 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-17 17:32 [PATCH 0/3] ring-buffer: Hardening of the persistent buffer Steven Rostedt
2024-12-17 17:32 ` [PATCH 1/3] ring-buffer: Add uname to match criteria for persistent ring buffer Steven Rostedt
2024-12-17 17:46   ` Linus Torvalds
2024-12-17 18:04     ` Steven Rostedt
2024-12-17 18:19       ` Linus Torvalds
2024-12-17 18:24         ` Linus Torvalds
2024-12-17 18:42           ` Steven Rostedt
2024-12-17 19:22           ` Mathieu Desnoyers [this message]
2024-12-17 18:33         ` Steven Rostedt
2024-12-17 18:42           ` Linus Torvalds
2024-12-17 19:01             ` Steven Rostedt
2024-12-17 19:38               ` Linus Torvalds
2024-12-17 19:44                 ` Steven Rostedt
2024-12-17 22:24                   ` Linus Torvalds
2024-12-17 22:53                     ` Steven Rostedt
2024-12-17 23:32                       ` Linus Torvalds
2024-12-18  0:02                         ` Linus Torvalds
2024-12-18  0:48                           ` Steven Rostedt
2024-12-18  0:47                         ` Alexei Starovoitov
2024-12-18  1:26                           ` Linus Torvalds
2024-12-18  1:32                             ` [PATCH] vsprintf: simplify number handling Linus Torvalds
2024-12-18  9:19                               ` Rasmus Villemoes
2024-12-18 15:32                               ` Steven Rostedt
2024-12-18 17:32                                 ` Linus Torvalds
2024-12-18 18:04                                   ` Steven Rostedt
2024-12-18 18:31                                     ` Steven Rostedt
2024-12-23 20:11                               ` Linus Torvalds
2024-12-18  1:39                             ` [PATCH 1/3] ring-buffer: Add uname to match criteria for persistent ring buffer Linus Torvalds
2024-12-18  1:53                               ` Alexei Starovoitov
2024-12-17 19:03             ` Linus Torvalds
2024-12-17 19:07               ` Steven Rostedt
2024-12-17 19:14                 ` Steven Rostedt
2024-12-17 18:17     ` Steven Rostedt
2024-12-17 17:32 ` [PATCH 2/3] trace/ring-buffer: Do not create module or dynamic events in boot mapped buffers Steven Rostedt
2024-12-17 17:32 ` [PATCH 3/3] trace/ring-buffer: Do not use TP_printk() formatting for " Steven Rostedt

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=c320510d-c0ec-4c4c-98b5-457c193cae6d@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®