qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] trace: add Rust DTrace/SystemTap SDT support
@ 2025-11-19 20:51 Stefan Hajnoczi
  2025-11-19 20:51 ` [PATCH v2 1/4] hpet: remove unused trace events Stefan Hajnoczi
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2025-11-19 20:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, qemu-rust, Mads Ynddal, Thomas Huth,
	Manos Pitsidianakis, Alex Bennée, Paolo Bonzini, Josh Stone,
	Stefan Hajnoczi

v2:
- Re-export probe::probe!() from the trace crate to avoid the explicit probe
  crate dependency from hpet, pl011, etc. [Paolo]

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.

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

Stefan Hajnoczi (4):
  hpet: remove unused trace events
  rust/hpet: add trace events
  subprojects: add probe crate
  tracetool: add Rust DTrace/SystemTap SDT support

 hw/timer/trace-events                         |  2 -
 rust/Cargo.lock                               |  6 ++
 rust/hw/timer/hpet/Cargo.toml                 |  1 +
 rust/hw/timer/hpet/meson.build                |  1 +
 rust/hw/timer/hpet/src/device.rs              | 45 ++++++++-----
 rust/meson.build                              |  2 +
 rust/trace/Cargo.toml                         |  1 +
 rust/trace/meson.build                        |  2 +-
 rust/trace/src/lib.rs                         |  4 ++
 scripts/archive-source.sh                     |  1 +
 scripts/make-release                          |  2 +-
 scripts/tracetool/__init__.py                 |  1 +
 scripts/tracetool/backend/dtrace.py           | 31 +++++++++
 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 +-
 23 files changed, 280 insertions(+), 27 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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-21 10:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 20:51 [PATCH v2 0/4] trace: add Rust DTrace/SystemTap SDT support Stefan Hajnoczi
2025-11-19 20:51 ` [PATCH v2 1/4] hpet: remove unused trace events Stefan Hajnoczi
2025-11-20 14:49   ` Zhao Liu
2025-11-19 20:51 ` [PATCH v2 2/4] rust/hpet: add " Stefan Hajnoczi
2025-11-20 14:49   ` Zhao Liu
2025-11-19 20:51 ` [PATCH v2 3/4] subprojects: add probe crate Stefan Hajnoczi
2025-11-19 20:52 ` [PATCH v2 4/4] tracetool: add Rust DTrace/SystemTap SDT support Stefan Hajnoczi
2025-11-21 10:02 ` [PATCH v2 0/4] trace: " Paolo Bonzini

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