Repository navigation
Description
C Binder has many tracepoints. Here is one:
linux/drivers/android/binder_trace.h
Lines 22 to 35 in 11439c4
| TRACE_EVENT(binder_ioctl, | |
| TP_PROTO(unsigned int cmd, unsigned long arg), | |
| TP_ARGS(cmd, arg), | |
| TP_STRUCT__entry( | |
| __field(unsigned int, cmd) | |
| __field(unsigned long, arg) | |
| ), | |
| TP_fast_assign( | |
| __entry->cmd = cmd; | |
| __entry->arg = arg; | |
| ), | |
| TP_printk("cmd=0x%x arg=0x%lx", __entry->cmd, __entry->arg) | |
| ); |
Rust Binder implements an equivalent one here:
linux/drivers/android/binder/rust_binder_events.h
Lines 18 to 31 in 11439c4
| TRACE_EVENT(rust_binder_ioctl, | |
| TP_PROTO(unsigned int cmd, unsigned long arg), | |
| TP_ARGS(cmd, arg), | |
| TP_STRUCT__entry( | |
| __field(unsigned int, cmd) | |
| __field(unsigned long, arg) | |
| ), | |
| TP_fast_assign( | |
| __entry->cmd = cmd; | |
| __entry->arg = arg; | |
| ), | |
| TP_printk("cmd=0x%x arg=0x%lx", __entry->cmd, __entry->arg) | |
| ); |
together with:
linux/drivers/android/binder/trace.rs
Lines 22 to 26 in 11439c4
| #[inline] | |
| pub(crate) fn trace_ioctl(cmd: u32, arg: usize) { | |
| // SAFETY: Always safe to call. | |
| unsafe { rust_binder_ioctl(cmd, arg as c_ulong) } | |
| } |
However, many tracepoints are missing. To work on this issue, pick one of them and submit a patch adding it. Please compare with the implementation found here in Android's fork, but it may need adjustments when upstreamed.
Oh, also, the current tracepoints are called rust_binder_*, but the rust_ prefix should be removed because the name is part of the uapi, and userspace expects tracepoints to have the old names.
Activity
ojeda commentedon Mar 5, 2026
This requires submitting a proper patch to the LKML and the Rust for Linux mailing list. Please recall to test your changes (including generating the documentation if changed, running the Rust doctests if changed, etc.), to use a proper title for the commit, to sign your commit under the Developer's Certificate of Origin and to add a
Suggested-by:tag, and aLink:tag to this issue. Please see https://docs.kernel.org/process/submitting-patches.html and https://rust-for-linux.com/contributing for details.mqqz commentedon Mar 7, 2026
I submitted a patch that added many of the tracepoints in C Binder but not in Rust 🤓
Link: https://lore.kernel.org/rust-for-linux/20260317-rust-binder-trace-v3-0-6fae4fbcf637@sdhn.cc/
Link: https://lore.kernel.org/rust-for-linux/20260308-rust-binder-trace-v2-0-9e38637a2193@sdhn.cc/rust_binder: remove "rust_" prefix from tracepoints
rust_binder: add Rust binder tracepoints
rust_binder: remove "rust_" prefix from tracepoints
rust_binder: add Rust binder tracepoints
rust_binder: remove "rust_" prefix from tracepoints
rust_binder: remove "rust_" prefix from tracepoints
PlierShounen36 commentedon Aug 14, 2026
hey I am a beginner to systems programming. Can I take this up and contribute?
mqqz commentedon Aug 16, 2026
@PlierShounen36
keep in mind most of the relevant tracepoints have been already added and merged upstream 8f34810
but anyone is welcome to contribute just make sure you follow the guidelines (see @ojeda's comment above).
PlierShounen36 commentedon Aug 16, 2026
Should I take up some other issue then?
mqqz commentedon Aug 16, 2026
up to you, you don't need my permission or anyone else's to work on anything (although it's helpful to know no one else is). IIRC not all tracepoints were added (on purpose). If you think you can make a useful contribution here then by all means go ahead.
rust_binder: add transaction buffer tracepoints