This is the result of the summer project of Tanish Desai. It mostly consists of changes to tracetool, which I used to add tracepoint support to the pl011 device. All the backends are supported except dtrace and ust; support for Linux in dtrace should be easy using the "probe" crate, the rest (ust, and dtrace on macOS or Solaris) less so.
Patches 1-2 are cleanups that could be committed separately. Patches 3-5 are tracetool patches that have been posted before, now rebased on top of the "make check-tracetool" series. Their purpose is to simplify .h code generation for tracetool backends, and these simplifications translate directly to the new .rs code generation. Patches 6-7 add the minimal support for adding tracepoint functions in Rust, albeit with no content and thus no actual tracing. Patches 8-9 add back tracepoints to the Rust pl011 device model. Patches 10-14 finally add Rust code generation to the supported tracing backends. Many thanks to Daniel for his tracetool testsuite. It was very useful and did indeed improve reviewability! Paolo Based-on: <20250819161053.464641-1-berra...@redhat.com> Paolo Bonzini (6): treewide: write "unsigned long int" instead of "long unsigned int" rust: move dependencies to rust/Cargo.toml trace/ftrace: move snprintf+write from tracepoints to ftrace.c rust: qdev: add minimal clock bindings rust: pl011: add tracepoints log: change qemu_loglevel to unsigned Tanish Desai (8): tracetool: add CHECK_TRACE_EVENT_GET_STATE tracetool/backend: remove redundant trace event checks tracetool: Add Rust format support rust: add trace crate tracetool/simple: add Rust support tracetool/log: add Rust support tracetool/ftrace: add Rust support tracetool/syslog: add Rust support include/qemu/log-for-trace.h | 4 +- include/qemu/log.h | 44 ++++---- rust/qemu-api/wrapper.h | 1 + tests/tracetool/ftrace.h | 28 +---- tests/tracetool/log.h | 16 ++- trace/ftrace.h | 1 + crypto/pbkdf-gcrypt.c | 2 +- crypto/pbkdf-gnutls.c | 2 +- crypto/pbkdf-nettle.c | 2 +- hw/display/exynos4210_fimd.c | 2 +- hw/misc/imx7_src.c | 4 +- hw/net/can/can_sja1000.c | 4 +- trace/ftrace.c | 15 +++ util/log.c | 2 +- hw/char/trace-events | 14 +-- hw/xen/trace-events | 4 +- rust/Cargo.lock | 8 ++ rust/Cargo.toml | 6 + rust/hw/char/pl011/Cargo.toml | 1 + rust/hw/char/pl011/meson.build | 1 + rust/hw/char/pl011/src/device.rs | 57 +++++++--- rust/meson.build | 2 +- rust/qemu-api/Cargo.toml | 6 +- rust/qemu-api/src/log.rs | 2 +- rust/qemu-api/src/qdev.rs | 33 ++++++ rust/trace/Cargo.toml | 19 ++++ rust/trace/meson.build | 19 ++++ rust/trace/src/lib.rs | 27 +++++ scripts/tracetool/__init__.py | 156 ++++++++++++++++++++++++++ scripts/tracetool/backend/__init__.py | 39 +++++-- scripts/tracetool/backend/ftrace.py | 24 ++-- scripts/tracetool/backend/log.py | 20 ++-- scripts/tracetool/backend/simple.py | 15 ++- scripts/tracetool/backend/syslog.py | 15 +-- scripts/tracetool/format/h.py | 11 +- scripts/tracetool/format/rs.py | 76 +++++++++++++ tests/tracetool/ftrace.rs | 41 +++++++ tests/tracetool/log.rs | 45 ++++++++ tests/tracetool/simple.rs | 41 +++++++ tests/tracetool/syslog.rs | 41 +++++++ tests/tracetool/tracetool-test.py | 2 + trace/meson.build | 8 +- 42 files changed, 718 insertions(+), 142 deletions(-) create mode 100644 rust/trace/Cargo.toml create mode 100644 rust/trace/meson.build create mode 100644 rust/trace/src/lib.rs create mode 100644 scripts/tracetool/format/rs.py create mode 100644 tests/tracetool/ftrace.rs create mode 100644 tests/tracetool/log.rs create mode 100644 tests/tracetool/simple.rs create mode 100644 tests/tracetool/syslog.rs -- 2.50.1