[PATCH v3 5/7] rust_binder: Implement BINDER_DEBUG_FAILED_TRANSACTION
From: Jahnavi MN via B4 Relay
Date: Mon Jul 13 2026 - 08:40:33 EST
From: Jahnavi MN <jahnavimn@xxxxxxxxxx>
This adds dynamic debug logs for:
- Failed replies, target process deaths, and error code deliveries.
- Detailed transaction failure diagnostics (including sender/receiver
PIDs, TIDs, transaction IDs, buffer sizes, and error codes).
Reviewed-by: Carlos Llamas <cmllamas@xxxxxxxxxx>
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
Signed-off-by: Jahnavi MN <jahnavimn@xxxxxxxxxx>
---
drivers/android/binder/thread.rs | 21 ++++++++++++++++-----
drivers/android/binder/transaction.rs | 8 ++++++++
2 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/drivers/android/binder/thread.rs b/drivers/android/binder/thread.rs
index 072cb4674172..26925d094a59 100644
--- a/drivers/android/binder/thread.rs
+++ b/drivers/android/binder/thread.rs
@@ -1254,11 +1254,22 @@ fn transaction(self: &Arc<Self>, cmd: u32, reader: &mut UserSliceReader) -> Resu
ee.param = source.to_errno();
}
- pr_warn!(
- "{}:{} transaction to {} failed: {source:?}",
- info.from_pid,
- info.from_tid,
- info.to_pid
+ binder_debug!(
+ FailedTransaction,
+ "transaction {} to {}:{} failed {:?}, code {} size {}-{}",
+ if info.is_reply {
+ "reply"
+ } else if info.is_oneway() {
+ "async"
+ } else {
+ "call"
+ },
+ info.to_pid,
+ info.to_tid,
+ err,
+ info.code,
+ info.data_size,
+ info.offsets_size
);
}
}
diff --git a/drivers/android/binder/transaction.rs b/drivers/android/binder/transaction.rs
index 38795224a784..b56dca55662d 100644
--- a/drivers/android/binder/transaction.rs
+++ b/drivers/android/binder/transaction.rs
@@ -405,6 +405,14 @@ fn do_work(
} else {
// On failure to process the list, we send a reply back to the sender and ignore the
// transaction on the recipient.
+ binder_debug!(
+ FailedTransaction,
+ "transaction {} to {} failed, fd fixups failed, size {}-{}",
+ self.debug_id,
+ self.to.task.pid(),
+ self.data_size,
+ self.offsets_size
+ );
return Ok(true);
};
--
2.55.0.795.g602f6c329a-goog