From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael Roth" <michael.roth@amd.com>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Dr. David Alan Gilbert" <dave@treblig.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Eric Blake" <eblake@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>
Subject: Re: [PATCH 00/21] system: introduce a live data recorder facility
Date: Thu, 29 Oct 2026 17:32:44 +0000 [thread overview]
Message-ID: <auODPFwxQ0Bc0oi-@redhat.com> (raw)
In-Reply-To: <CAMxuvayG8mPvVSagb6EyEH-hhA094qw3LPUWdeL_PJ5qeEk3=g@mail.gmail.com>
On Fri, Oct 16, 2026 at 11:20:11AM +0400, Marc-André Lureau wrote:
> Hi
>
> On Thu, Oct 15, 2026 at 4:32 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Thu, Oct 15, 2026 at 04:15:52PM +0400, marcandre.lureau@redhat.com wrote:
> > > > This series introduces a new facility called 'tldr' which is a
> > > > live data recorder. This is intended to aid support of production
> > > > QEMU deployments, by providing a data collection facility that
> > > > can be left "always on", such that in the event of a QEMU crash
> > > > or guest OS crash, certain important information will be recorded.
> > > >
> > > > The data recorder has to be enabled by adding a "tldr-config"
> > > > object instance with -object / object_add.
> > > >
> > > > With this series, the data recorder collects
> > > >
> > > > * error_report/warn_report/error_printf messages
> > > > * QMP events
> > >
> > > It should probably be recorded at emission, not per monitor
> >
> > Opps.
> >
> > > > * QMP errors
> > > > * QMP commands, which are not query-XXX/qom-list,
> > > > or any command associated with a QMP error.
> > > > * qemu_log output
> > > >
> > > > The last item is intended primarily to be used in combination
> > > > with tracing and its 'log' backend, to have continuous
> > > > recording of certain interesting probes.
> > > >
> > > > Each type of data is collected in a distinct circular
> > > > buffer, such that high volumes of one type of data, does
> > > > not result in overwriting other types of low volume data.
> > > >
> > > > The data recorder is set to trigger on SIGBUS, SIGSEGV,
> > > > SIGILL, SIGFPE and SIGABRT, or manually via QMP 'tldr-dump'.
> > >
> > > Instead of allocating and dumping by a signal handler, why not use a file-backed
> > > mmap or a memfd? We would need to define a small fixed header for the file
> > > layout/buckets. This would avoid all the issues with signal handlers.
> >
> > That would impose a continuous I/O workload on data recording, which
> > is something I wanted to explicitly avoid, until the time the data is
>
> Yes, a file-backed mapping shouldn't be the default, but memfd/tmpfs
> should have the same performance.
>
> > needed to be preserved. This only persists the final data, not any
> > intermediate data that is overwritten as the circular buffer wraps.
>
> Same design, the reader would handle the ring data
>
> > Coupling the in-memory layout to the on-disk layout also means that
> > dumps would always be the max size, since we would not have grow-on
> > demand buffers.
>
> The dump output would not be the raw data, a reader would emit the
> same text format, skipping the unused parts.
IMHO that reader has to be QEMU owned code, as otherwise we're
exposing a private data structure to a 3rd party and that makes
it public ABI/API which is highly undesirable for this.
> mapping reserves address space only, pages are allocated on first write.
>
> The benefits:
> - no signal handler, no conflict with MCE, ASAN etc
A signal handler is integral to some extent, as captured info about
the signal is itself is an important part of the data record. IOW,
even if moving writing of the dump out of the signal handler in some
manner, I still want to be able to capture several siginfo_t fields.
You can get that info from a core dump, but the working premise
is that a core dump is not guaranteed available, whereas the data
record dumps are something we can more easily acquire.
> - data survives SIGKILL, OOM, or a crash in the dump path itself
Simplifying the signal handler to just stash the siginfo_t would
help.
> - data can be read from a hung QEMU
Data can always be read from a hung QEMU by sending it a signal.
We could wire up a non-fatal signal for this purpose if we want
to read hung QEMUs without killing them.
> Someone needs to hold the memfd to outlive QEMU, otherwise QEMU could
> create a file under a runtime dir on tmpfs
I wonder if QEMU could simply fork a child process itself that just
hangs around waiting for death, and has a shared memory region with
the main QEMU.
We already have a '-run-with async-teardown' comamnd line, which
forks a child process and uses prctl(PR_SET_PDEATHSIG) to get
notified with the parent goes away. We could expand that child
process to also handle crash dump writing.
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-10-29 17:33 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 11:20 [PATCH 00/21] system: introduce a live data recorder facility Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 01/21] osdep: add 'ignore_value(x)' macro Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 02/21] system: move SIGBUS signal handling to signal.c Daniel P. Berrangé
2026-10-15 12:15 ` marcandre.lureau
2026-10-15 11:20 ` [PATCH 03/21] system: rename qemu_init_sigbus to qemu_init_crash_signals Daniel P. Berrangé
2026-10-15 12:15 ` marcandre.lureau
2026-10-15 11:20 ` [PATCH 04/21] system: run SIGBUS handler on alternate signal stack Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 05/21] util: expand alternate signal stack to all threads Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 06/21] osdep: provide dummy siginfo_t definition Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 07/21] util: introduce 'tldr', a system data recorder for crash handling Daniel P. Berrangé
2026-10-29 8:29 ` Markus Armbruster
2026-10-29 15:35 ` Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 08/21] qapi: add 'tldr-dump' command for on-demand data recorder output Daniel P. Berrangé
2026-10-29 8:35 ` Markus Armbruster
2026-10-29 15:37 ` Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 09/21] system: trigger TLDR crash dump on unhandled SIGBUS Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 10/21] system: simplify signal handler logic Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 11/21] main: allow SIGBUS in the main loop Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 12/21] system: enable SIGBUS handling on non-Linux platforms Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 13/21] system: enable crash dumps on SIGSEGV, SIGILL, SIGFPE and SIGABRT Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 14/21] util: introduce capture of textual messages in data recorder Daniel P. Berrangé
2026-10-29 8:49 ` Markus Armbruster
2026-10-15 11:20 ` [PATCH 15/21] util: capture warnings and errors in the " Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 16/21] monitor: remove obsolete/redundant exports Daniel P. Berrangé
2026-10-29 8:51 ` Markus Armbruster
2026-10-15 11:20 ` [PATCH 17/21] monitor: capture monitor commands and events in data recorder Daniel P. Berrangé
2026-10-15 15:57 ` Dr. David Alan Gilbert
2026-10-15 16:11 ` Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 18/21] log: enable directing log messages to " Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 19/21] tests/qtest: add API to declare an expected crash signal Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 20/21] qtest: add 'crash' command to generate 'authentic' process crashes Daniel P. Berrangé
2026-10-15 11:20 ` [PATCH 21/21] tests/qtest: add test to validate data recorder on crashes Daniel P. Berrangé
2026-10-15 12:15 ` [PATCH 00/21] system: introduce a live data recorder facility marcandre.lureau
2026-10-15 12:32 ` Daniel P. Berrangé
2026-10-16 7:20 ` Marc-André Lureau
2026-10-29 17:32 ` Daniel P. Berrangé [this message]
2026-10-29 18:15 ` Marc-André Lureau
2026-10-29 18:28 ` Daniel P. Berrangé
2026-10-15 17:34 ` Pierrick Bouvier
2026-10-29 17:39 ` Daniel P. Berrangé
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=auODPFwxQ0Bc0oi-@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=eblake@redhat.com \
--cc=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=philmd@oss.qualcomm.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.