rust_binder: thread: wire up transaction_buffer alloc/release tracepoints

Call `trace_transaction_alloc_buf()` right after a transaction buffer
is successfully allocated in `copy_transaction_data()`, and call
`trace_transaction_buffer_release()` when a buffer is freed via
`BC_FREE_BUFFER` in `Thread::write()`.

Signed-off-by: Sagar Taunk <sagartaunk@proton.me>
Link: https://patch.msgid.link/20260927125622.676342-4-sagartaunk@proton.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Sagar Taunk 2026-09-27 12:56:55 +00:00 committed by Greg Kroah-Hartman
parent e2e4a4527d
commit 2f32ed8233

View File

@ -30,6 +30,7 @@
process::{GetWorkOrRegister, Process},
ptr_align,
stats::GLOBAL_STATS,
trace::{trace_transaction_alloc_buf, trace_transaction_buffer_release},
transaction::{Transaction, TransactionFlag, TransactionFlags, TransactionInfo},
BinderReturnWriter, DArc, DLArc, DTRWrap, DeliverCode, DeliverToRead,
};
@ -1076,6 +1077,8 @@ pub(crate) fn copy_transaction_data(
}
};
trace_transaction_alloc_buf(debug_id, data_size, offsets_size, buffers_size);
let mut buffer_reader = UserSlice::new(info.data_ptr, data_size).reader();
let mut end_of_previous_object = 0;
let mut sg_state = None;
@ -1522,6 +1525,7 @@ fn write(self: &Arc<Self>, req: &mut BinderWriteRead) -> Result {
if buffer.looper_need_return_on_free() {
self.inner.lock().looper_need_return = true;
}
trace_transaction_buffer_release(buffer.debug_id);
drop(buffer);
}
}