qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Mads Ynddal" <mads@ynddal.dk>,
	qemu-rust@nongnu.org, "Josh Stone" <jistone@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: [PATCH 0/2] trace: add Rust DTrace/SystemTap SDT support
Date: Wed, 19 Nov 2025 13:18:19 -0500	[thread overview]
Message-ID: <20251119181821.154833-1-stefanha@redhat.com> (raw)

This series adds SDT probe support so that SystemTap, GDB, etc can trace QEMU's
Rust code when compiled with `./configure --enable-trace-backends=dtrace`.

The dtrace(1) tool that generates the .o and C header file does not support
Rust. Use the probe crate (https://crates.io/crates/probe), which takes care of
emitting SDT probes, and extend tracetool to emit code for the trace events.

While SDT is cross-platform, the probe crate currently only supports Linux
(SystemTap). On other platforms the crate is a nop - it compiles but does
nothing. Future changes to the probe crate may add support for other operating
systems like FreeBSD, macOS, etc without much needed in the way of QEMU code
changes.

Josh: I CCed you just to let you know that QEMU will use the probes
crate. There is no need to review the code unless you want to.

Based-on: <20251106215606.36598-1-stefanha@redhat.com>

Stefan Hajnoczi (2):
  subprojects: add probe crate
  tracetool: add Rust DTrace/SystemTap SDT support

 rust/Cargo.lock                               |  6 ++
 rust/hw/char/pl011/meson.build                |  1 +
 rust/hw/timer/hpet/meson.build                |  1 +
 rust/meson.build                              |  2 +
 rust/trace/Cargo.toml                         |  1 +
 rust/trace/meson.build                        |  2 +-
 scripts/archive-source.sh                     |  1 +
 scripts/make-release                          |  2 +-
 scripts/tracetool/__init__.py                 |  1 +
 scripts/tracetool/backend/dtrace.py           | 32 +++++++++
 scripts/tracetool/format/rs.py                | 27 ++++++--
 subprojects/.gitignore                        |  1 +
 .../packagefiles/probe-0.5-rs/meson.build     | 22 +++++++
 subprojects/probe-0.5-rs.wrap                 |  7 ++
 tests/tracetool/dtrace.rs                     | 65 +++++++++++++++++++
 tests/tracetool/ftrace.rs                     | 21 ++++++
 tests/tracetool/log.rs                        | 21 ++++++
 tests/tracetool/simple.rs                     | 21 ++++++
 tests/tracetool/syslog.rs                     | 21 ++++++
 tests/tracetool/tracetool-test.py             |  2 +-
 20 files changed, 250 insertions(+), 7 deletions(-)
 create mode 100644 subprojects/packagefiles/probe-0.5-rs/meson.build
 create mode 100644 subprojects/probe-0.5-rs.wrap
 create mode 100644 tests/tracetool/dtrace.rs

-- 
2.51.1



             reply	other threads:[~2025-11-19 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 18:18 Stefan Hajnoczi [this message]
2025-11-19 18:18 ` [PATCH 1/2] subprojects: add probe crate Stefan Hajnoczi
2025-11-19 18:18 ` [PATCH 2/2] tracetool: add Rust DTrace/SystemTap SDT support Stefan Hajnoczi
2025-11-19 19:36   ` Paolo Bonzini

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=20251119181821.154833-1-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=jistone@redhat.com \
    --cc=mads@ynddal.dk \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    --cc=thuth@redhat.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;
as well as URLs for NNTP newsgroup(s).