From: syncrain <iganschel@gmail.com>
To: gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com,
brauner@kernel.org, cmllamas@google.com, aliceryhl@google.com
Cc: ojeda@kernel.org, rust-for-linux@vger.kernel.org,
linux-kernel@vger.kernel.org, Keshav Verma <iganschel@gmail.com>
Subject: [PATCH] binder: synchronize Rust Binder stats with freeze commands
Date: Tue, 16 Jun 2026 01:47:37 +0530 [thread overview]
Message-ID: <20260615201737.262-1-iganschel@gmail.com> (raw)
From: Keshav Verma <iganschel@gmail.com>
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.
Signed-off-by: Keshav Verma <iganschel@gmail.com>
---
drivers/android/binder/rust_binder_events.c | 7 ++++++-
drivers/android/binder/stats.rs | 4 ++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/android/binder/rust_binder_events.c b/drivers/android/binder/rust_binder_events.c
index 488b1470060c..5792aa59cc82 100644
--- a/drivers/android/binder/rust_binder_events.c
+++ b/drivers/android/binder/rust_binder_events.c
@@ -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
diff --git a/drivers/android/binder/stats.rs b/drivers/android/binder/stats.rs
index ab75e9561cbf..ec81dc7747db 100644
--- a/drivers/android/binder/stats.rs
+++ b/drivers/android/binder/stats.rs
@@ -8,8 +8,8 @@
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();
--
2.39.5
next reply other threads:[~2026-06-15 20:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-15 20:17 syncrain [this message]
2026-06-15 20:36 ` [PATCH] binder: synchronize Rust Binder stats with freeze commands Carlos Llamas
2026-06-15 21:09 ` Alice Ryhl
2026-06-15 20:50 ` Greg KH
2026-06-15 20:50 ` [PATCH v2] " Keshav Verma
2026-06-15 21:05 ` [PATCH v3] " Keshav Verma
2026-06-15 21:10 ` Alice Ryhl
2026-06-15 21:17 ` [PATCH v4] rust_binder: " Keshav Verma
-- strict thread matches above, loose matches on Subject: below --
2026-06-15 17:48 [PATCH] binder: " syncrain
2026-06-15 20:05 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260615201737.262-1-iganschel@gmail.com \
--to=iganschel@gmail.com \
--cc=aliceryhl@google.com \
--cc=arve@android.com \
--cc=brauner@kernel.org \
--cc=cmllamas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tkjos@android.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox