Skip to content

Commit b2ed81f

Browse files
committed
rust_binder: Implement BINDER_DEBUG_FAILED_TRANSACTION
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). Change-Id: I2af3e8c9868a40bb4665fa15100bbfde5c64032a Signed-off-by: Jahnavi MN <jahnavimn@google.com>
1 parent 1dd8ad0 commit b2ed81f

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

drivers/android/binder/thread.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,11 +1315,22 @@ impl Thread {
13151315
}
13161316
}
13171317

1318-
pr_warn!(
1319-
"{}:{} transaction to {} failed: {err:?}",
1320-
info.from_pid,
1321-
info.from_tid,
1322-
info.to_pid
1318+
binder_debug!(
1319+
FailedTransaction,
1320+
"transaction {} to {}:{} failed {:?}, code {} size {}-{}",
1321+
if info.is_reply {
1322+
"reply"
1323+
} else if info.is_oneway() {
1324+
"async"
1325+
} else {
1326+
"call"
1327+
},
1328+
info.to_pid,
1329+
info.to_tid,
1330+
err,
1331+
info.code,
1332+
info.data_size,
1333+
info.offsets_size
13231334
);
13241335
}
13251336
}

drivers/android/binder/transaction.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,14 @@ impl DeliverToRead for Transaction {
448448
} else {
449449
// On failure to process the list, we send a reply back to the sender and ignore the
450450
// transaction on the recipient.
451+
binder_debug!(
452+
FailedTransaction,
453+
"transaction {} to {} failed, fd fixups failed, size {}-{}",
454+
self.debug_id,
455+
self.to.task.pid(),
456+
self.data_size,
457+
self.offsets_size
458+
);
451459
return Ok(true);
452460
};
453461

0 commit comments

Comments
 (0)