summaryrefslogtreecommitdiff
path: root/drivers/android/binder/trace.rs
diff options
context:
space:
mode:
authorMohamad Alsadhan <mo@sdhn.cc>2026-03-17 17:49:46 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-04-01 12:18:22 +0200
commit25917c05ab477bf60f8cf09acb1e9e89de3df61f (patch)
tree58136fc92814c00b2ba67df74381afc06ea3c28a /drivers/android/binder/trace.rs
parentcaf3719f335dac62e5626baadb66836907176337 (diff)
rust_binder: add fd translation tracepoints
Add Rust Binder tracepoint declarations for both `transaction_fd_send` and `transaction_fd_recv`. Also, wire in the corresponding trace calls where fd objects are serialised/deserialised. Signed-off-by: Mohamad Alsadhan <mo@sdhn.cc> Link: https://patch.msgid.link/20260317-rust-binder-trace-v3-5-6fae4fbcf637@sdhn.cc Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binder/trace.rs')
-rw-r--r--drivers/android/binder/trace.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/android/binder/trace.rs b/drivers/android/binder/trace.rs
index d96afdb79c65..c6f39d83314e 100644
--- a/drivers/android/binder/trace.rs
+++ b/drivers/android/binder/trace.rs
@@ -18,6 +18,8 @@ declare_trace! {
unsafe fn binder_wait_for_work(proc_work: bool, transaction_stack: bool, thread_todo: bool);
unsafe fn binder_transaction(reply: bool, t: rust_binder_transaction, thread: *mut task_struct);
unsafe fn binder_transaction_received(t: rust_binder_transaction);
+ unsafe fn binder_transaction_fd_send(t_debug_id: c_int, fd: c_int, offset: usize);
+ unsafe fn binder_transaction_fd_recv(t_debug_id: c_int, fd: c_int, offset: usize);
}
#[inline]
@@ -77,3 +79,14 @@ pub(crate) fn trace_transaction_received(t: &Transaction) {
// SAFETY: The raw transaction is valid for the duration of this call.
unsafe { binder_transaction_received(raw_transaction(t)) }
}
+
+#[inline]
+pub(crate) fn trace_transaction_fd_send(t_debug_id: usize, fd: u32, offset: usize) {
+ // SAFETY: This function is always safe to call.
+ unsafe { binder_transaction_fd_send(t_debug_id as c_int, fd as c_int, offset) }
+}
+#[inline]
+pub(crate) fn trace_transaction_fd_recv(t_debug_id: usize, fd: u32, offset: usize) {
+ // SAFETY: This function is always safe to call.
+ unsafe { binder_transaction_fd_recv(t_debug_id as c_int, fd as c_int, offset) }
+}