Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust_binder: add `transaction_received` tracepoint

Add Rust Binder `transaction_received` tracepoint decalaration and
wire in the corresponding trace call when a transaction work item is
accepted for execution.

Signed-off-by: Mohamad Alsadhan <mo@sdhn.cc>
Link: https://patch.msgid.link/20260317-rust-binder-trace-v3-4-6fae4fbcf637@sdhn.cc
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mohamad Alsadhan and committed by
Greg Kroah-Hartman
caf3719f 2335167a

+21
+12
drivers/android/binder/rust_binder_events.h
··· 99 99 __entry->reply, __entry->flags, __entry->code) 100 100 ); 101 101 102 + TRACE_EVENT(binder_transaction_received, 103 + TP_PROTO(rust_binder_transaction t), 104 + TP_ARGS(t), 105 + TP_STRUCT__entry( 106 + __field(int, debug_id) 107 + ), 108 + TP_fast_assign( 109 + __entry->debug_id = rust_binder_transaction_debug_id(t); 110 + ), 111 + TP_printk("transaction=%d", __entry->debug_id) 112 + ); 113 + 102 114 #endif /* _RUST_BINDER_TRACE_H */ 103 115 104 116 /* This part must be outside protection */
+7
drivers/android/binder/trace.rs
··· 17 17 unsafe fn binder_write_done(ret: c_int); 18 18 unsafe fn binder_wait_for_work(proc_work: bool, transaction_stack: bool, thread_todo: bool); 19 19 unsafe fn binder_transaction(reply: bool, t: rust_binder_transaction, thread: *mut task_struct); 20 + unsafe fn binder_transaction_received(t: rust_binder_transaction); 20 21 } 21 22 22 23 #[inline] ··· 70 69 // SAFETY: The raw transaction is valid for the duration of this call. The thread pointer is 71 70 // valid or null. 72 71 unsafe { binder_transaction(reply, raw_transaction(t), thread) } 72 + } 73 + 74 + #[inline] 75 + pub(crate) fn trace_transaction_received(t: &Transaction) { 76 + // SAFETY: The raw transaction is valid for the duration of this call. 77 + unsafe { binder_transaction_received(raw_transaction(t)) } 73 78 }
+2
drivers/android/binder/transaction.rs
··· 451 451 452 452 self.drop_outstanding_txn(); 453 453 454 + crate::trace::trace_transaction_received(&self); 455 + 454 456 // When this is not a reply and not a oneway transaction, update `current_transaction`. If 455 457 // it's a reply, `current_transaction` has already been updated appropriately. 456 458 if self.target_node.is_some() && tr_sec.transaction_data.flags & TF_ONE_WAY == 0 {