]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
binder: add transaction_report feature entry
authorLi Li <dualli@google.com>
Sun, 27 Jul 2025 18:29:07 +0000 (18:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Aug 2025 10:53:01 +0000 (12:53 +0200)
Add "transaction_report" to the binderfs feature list, to help userspace
determine if the "BINDER_CMD_REPORT" generic netlink api is supported by
the binder driver.

Signed-off-by: Li Li <dualli@google.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20250727182932.2499194-5-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binderfs.c
tools/testing/selftests/filesystems/binderfs/binderfs_test.c

index 0d9d95a7fb603da025672a31ca33c537f2f38e3f..be8e64eb39ec510a38051c2c630a24684cbbc898 100644 (file)
@@ -59,6 +59,7 @@ struct binder_features {
        bool oneway_spam_detection;
        bool extended_error;
        bool freeze_notification;
+       bool transaction_report;
 };
 
 static const struct constant_table binderfs_param_stats[] = {
@@ -76,6 +77,7 @@ static struct binder_features binder_features = {
        .oneway_spam_detection = true,
        .extended_error = true,
        .freeze_notification = true,
+       .transaction_report = true,
 };
 
 static inline struct binderfs_info *BINDERFS_SB(const struct super_block *sb)
@@ -601,6 +603,12 @@ static int init_binder_features(struct super_block *sb)
        if (IS_ERR(dentry))
                return PTR_ERR(dentry);
 
+       dentry = binderfs_create_file(dir, "transaction_report",
+                                     &binder_features_fops,
+                                     &binder_features.transaction_report);
+       if (IS_ERR(dentry))
+               return PTR_ERR(dentry);
+
        return 0;
 }
 
index 81db85a5cc1641faa7d48967330559a3acc5a3fe..39a68078a79b1ec698677856d4414ba076fea6a8 100644 (file)
@@ -65,6 +65,7 @@ static int __do_binderfs_test(struct __test_metadata *_metadata)
                "oneway_spam_detection",
                "extended_error",
                "freeze_notification",
+               "transaction_report",
        };
 
        change_mountns(_metadata);