]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust_binder: synchronize Rust Binder stats with freeze commands
authorKeshav Verma <iganschel@gmail.com>
Mon, 15 Jun 2026 21:17:43 +0000 (02:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Jul 2026 10:27:38 +0000 (12:27 +0200)
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: eafedbc7c050 ("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>
drivers/android/binder/rust_binder_events.c
drivers/android/binder/stats.rs

index 488b1470060cc43f24345e9c32336134f96b0da0..5792aa59cc82507b8fd1933ea8893b7cea031af2 100644 (file)
@@ -28,6 +28,9 @@ const char * const binder_command_strings[] = {
        "BC_DEAD_BINDER_DONE",
        "BC_TRANSACTION_SG",
        "BC_REPLY_SG",
+       "BC_REQUEST_FREEZE_NOTIFICATION",
+       "BC_CLEAR_FREEZE_NOTIFICATION",
+       "BC_FREEZE_NOTIFICATION_DONE",
 };
 
 const char * const binder_return_strings[] = {
@@ -51,7 +54,9 @@ const char * const binder_return_strings[] = {
        "BR_FAILED_REPLY",
        "BR_FROZEN_REPLY",
        "BR_ONEWAY_SPAM_SUSPECT",
-       "BR_TRANSACTION_PENDING_FROZEN"
+       "BR_TRANSACTION_PENDING_FROZEN",
+       "BR_FROZEN_BINDER",
+       "BR_CLEAR_FREEZE_NOTIFICATION_DONE",
 };
 
 #define CREATE_TRACE_POINTS
index ab75e9561cbf4d302d6c3667cdb74b8bbb8a5d30..ec81dc7747db8dc07de646f8ea86ab822f6c6661 100644 (file)
@@ -8,8 +8,8 @@ use crate::defs::*;
 use kernel::sync::atomic::{ordering::Relaxed, Atomic};
 use kernel::{ioctl::_IOC_NR, seq_file::SeqFile, seq_print};
 
-const BC_COUNT: usize = _IOC_NR(BC_REPLY_SG) as usize + 1;
-const BR_COUNT: usize = _IOC_NR(BR_TRANSACTION_PENDING_FROZEN) as usize + 1;
+const BC_COUNT: usize = _IOC_NR(BC_FREEZE_NOTIFICATION_DONE) as usize + 1;
+const BR_COUNT: usize = _IOC_NR(BR_CLEAR_FREEZE_NOTIFICATION_DONE) as usize + 1;
 
 pub(crate) static GLOBAL_STATS: BinderStats = BinderStats::new();