Skip to content

Commit eb1645b

Browse files
iganschel-bitgregkh
authored andcommitted
rust_binder: synchronize Rust Binder stats with freeze commands
Rust Binder stats use BC_COUNT and BR_COUNT to size the command and return counters, and use event string tables when printing debug statistics. The Binder protocol includes freeze-related commands and return codes, but the Rust Binder statistics code was not updated to cover them. As a result, those commands and return codes are not accounted for or printed by the stats debug output. Update the counts and event string tables so these commands and return codes are included in the debug statistics output. Fixes: eafedbc ("rust_binder: add Rust Binder driver") Cc: stable <stable@kernel.org> Acked-by: Carlos Llamas <cmllamas@google.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Keshav Verma <iganschel@gmail.com> Link: https://patch.msgid.link/20260615211743.734-1-iganschel@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b34826e commit eb1645b

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

drivers/android/binder/rust_binder_events.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ const char * const binder_command_strings[] = {
2828
"BC_DEAD_BINDER_DONE",
2929
"BC_TRANSACTION_SG",
3030
"BC_REPLY_SG",
31+
"BC_REQUEST_FREEZE_NOTIFICATION",
32+
"BC_CLEAR_FREEZE_NOTIFICATION",
33+
"BC_FREEZE_NOTIFICATION_DONE",
3134
};
3235

3336
const char * const binder_return_strings[] = {
@@ -51,7 +54,9 @@ const char * const binder_return_strings[] = {
5154
"BR_FAILED_REPLY",
5255
"BR_FROZEN_REPLY",
5356
"BR_ONEWAY_SPAM_SUSPECT",
54-
"BR_TRANSACTION_PENDING_FROZEN"
57+
"BR_TRANSACTION_PENDING_FROZEN",
58+
"BR_FROZEN_BINDER",
59+
"BR_CLEAR_FREEZE_NOTIFICATION_DONE",
5560
};
5661

5762
#define CREATE_TRACE_POINTS

drivers/android/binder/stats.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::defs::*;
88
use kernel::sync::atomic::{ordering::Relaxed, Atomic};
99
use kernel::{ioctl::_IOC_NR, seq_file::SeqFile, seq_print};
1010

11-
const BC_COUNT: usize = _IOC_NR(BC_REPLY_SG) as usize + 1;
12-
const BR_COUNT: usize = _IOC_NR(BR_TRANSACTION_PENDING_FROZEN) as usize + 1;
11+
const BC_COUNT: usize = _IOC_NR(BC_FREEZE_NOTIFICATION_DONE) as usize + 1;
12+
const BR_COUNT: usize = _IOC_NR(BR_CLEAR_FREEZE_NOTIFICATION_DONE) as usize + 1;
1313

1414
pub(crate) static GLOBAL_STATS: BinderStats = BinderStats::new();
1515

0 commit comments

Comments
 (0)