4 ms·
Hello. I assume tracepoints mean kprobes/uprobes or something along those lines? I've just this weekend worked on implementing/adapting a crate for DTrace USDTs
by aapoalas 2y ago
Hello. I assume tracepoints mean kprobes/uprobes or something along those lines? I've just this weekend worked on implementing/adapting a crate for DTrace USDTs aka DTrace probes to also work on Linux and generate SystemTap SDTs (aka USDTs aka dtrace probes).
This is probably a little different from tracepoints in the kernel space but I'm somewhat interested in going deeper and into the kernel side of things. Let me know if you have any pointers as to where I might be of concrete assistance to you!
- bonzini 2y agoQEMU has several tracepoint providers, the main ones are (a slightly fancy version of) printf and USDT. There is a Python program that generates the C code for the chosen backend(s), so the thing to do would be to adjust the script to produce either an FFI bridge or the equivalent Rust code.
- aapoalas 2y agoCan you link the script? This sounds vaguely like something that would be no skin off my back, so I'd be quite happy to help with this.
- bonzini 2y agoYes it's https://github.com/qemu/qemu/tree/master/scripts/tracetool https://github.com/qemu/qemu/tree/master/scripts/tracetool. I also found https://github.com/cuviper/probe-rs/tree/master/src/platform https://github.com/cuviper/probe-rs/tree/master/src/platform which seems interesting.
- aapoalas 2y agoHere's my WIP addition to Oxide Computer's usdt crate: https://github.com/oxidecomputer/usdt/pull/340 https://github.com/oxidecomputer/usdt/pull/340 This crate gives you a nifty macro that translates Rust probe definitions into the correct ELF sections and other related assembly. Other ways to declare probes are also supported, though. Their support is currently only for illumos and OS X but I managed to get Linux SystemTap SDTs working as well, and a PR for FreeBSD exists as well but has been languishing in review purgatory for two years: I imagine QEMU might enjoy this wide support (if they land).