From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
qemu-devel@nongnu.org, qemu-rust@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
alex.bennee@linaro.org
Subject: Re: [PATCH RFC 0/5] rust: implement tracing
Date: Wed, 6 Aug 2025 12:36:43 +0300 [thread overview]
Message-ID: <CAAjaMXZH75Ooyb+S-qTQfsDgj7VO0ed8fv5S_tYe=VC++ABy4w@mail.gmail.com> (raw)
In-Reply-To: <ad404bb4-93fb-4a27-995f-734e647c1da0@redhat.com>
Hello Paolo,
On Wed, Aug 6, 2025 at 12:03 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 8/5/25 22:06, Manos Pitsidianakis wrote:
> >> If you're thinking this is all rather complicated, you'd be right,
> >> which is why for initial feature parity I figured the simplest is
> >> likely to just wrap the existing QEMU inline probe function, so
> >> Rust doesn't need to know about the different backends... yet...
>
> It's not too hard to add individual backends (other than dtrace---see
> below--and ust which doesn't build for me(*) and I wanted to deprecate).
> Tanish is pretty close to being able to post initial work.
Ack, I look forward to it :) I hope my RFC provides them some
inspiration on what things (not) to do.
Thanks,
>
> > Yes, that indeed makes sense. Generated C trace headers statically
> > linked to a standalone trace crate library for each subsystem, that
> > rust qemu crates can link to in return is the cleanest solution for
> > this approach IMHO, because doing this kind of codegen via macros
> > needs interaction with meson to generate the C sources and then run
> > bindgen all while compiling this one crate which is a single meson lib
> > target.
> >
> > It might be possible to generate the equivalent of the C code for each
> > backend just like this RFC generates only the log backend code, I'll
> > take a look out of curiosity...
> >
> >> FWIW, the original DTrace authors created a Rust crate with native
> >> rust integration of dynamic probes.
> >>
> >> https://github.com/oxidecomputer/usdt
> >>
> >> I think that (somehow) we probably want to integrate that with QEMU
> >> and its tracetool.
>
> This unfortunately only works for macOS and Solaris. It also has quite
> a few dependencies (~25) on other crates. There is also a "probe" crate
> (https://github.com/cuviper/probe-rs) that is minimal and (currently)
> specific to Linux, which is what I planned to use.
>
> By the way, while I like the idea of using Rust format strings, there
> are parts of tracetool (e.g. format/log_stap.py) that need the printf
> strings, and also backends (e.g. backend/syslog.py) that call into libc
> and therefore need to use printf format strings. So I think we're stuck.
>
> Paolo
>
> (*) that's because this tracepoint:
>
> visit_type_str(void *v, const char *name, char **obj) "v=%p name=%s obj=%p
>
> incorrectly handles 'char **' as a string. The breakage has been there
> since 2016, though probably it's only more recent versions of ust that
> actually fail to compile and until then the bug was latent until you
> enabled this tracepoint. But it seems unlikely that anyone has used the
> ust backend recently.
>
--
Manos Pitsidianakis
Emulation and Virtualization Engineer at Linaro Ltd
prev parent reply other threads:[~2025-08-06 9:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 13:47 [PATCH RFC 0/5] rust: implement tracing Manos Pitsidianakis
2025-08-04 13:47 ` [PATCH RFC 1/5] rust/bindings: add trace headers Manos Pitsidianakis
2025-08-04 13:47 ` [PATCH RFC 2/5] rust/qemu-api/log: add Log::Trace variant Manos Pitsidianakis
2025-08-04 13:47 ` [PATCH RFC 3/5] rust/qemu-api-macros: Add #[trace_events] macro Manos Pitsidianakis
2025-08-04 13:47 ` [PATCH RFC 4/5] rust/pl011: impl Copy, Clone for RegisterOffset Manos Pitsidianakis
2025-08-04 13:47 ` [PATCH RFC 5/5] rust/pl011: add trace events Manos Pitsidianakis
2025-08-05 16:04 ` [PATCH RFC 0/5] rust: implement tracing Daniel P. Berrangé
2025-08-05 16:25 ` Manos Pitsidianakis
2025-08-05 16:43 ` Daniel P. Berrangé
2025-08-05 16:47 ` Manos Pitsidianakis
2025-08-05 17:54 ` Daniel P. Berrangé
2025-08-05 20:06 ` Manos Pitsidianakis
2025-08-06 9:02 ` Paolo Bonzini
2025-08-06 9:21 ` Daniel P. Berrangé
2025-08-06 9:34 ` Manos Pitsidianakis
2025-08-06 9:36 ` Manos Pitsidianakis [this message]
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='CAAjaMXZH75Ooyb+S-qTQfsDgj7VO0ed8fv5S_tYe=VC++ABy4w@mail.gmail.com' \
--to=manos.pitsidianakis@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.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;
as well as URLs for NNTP newsgroup(s).