diff options
author | Hridya Valsaraju <hridya@google.com> | 2019-09-03 19:16:54 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-04 14:31:22 +0300 |
commit | 03e2e07e38147917482d595ad3cf193212ded8ac (patch) | |
tree | 8b63ad2be74bdf9c9935ee130570bbc0e339af8b /drivers/android/binderfs.c | |
parent | 0e13e452dafc009049a9a5a4153e2f9e51b23915 (diff) | |
download | linux-03e2e07e38147917482d595ad3cf193212ded8ac.tar.xz |
binder: Make transaction_log available in binderfs
Currently, the binder transaction log files 'transaction_log'
and 'failed_transaction_log' live in debugfs at the following locations:
/sys/kernel/debug/binder/failed_transaction_log
/sys/kernel/debug/binder/transaction_log
This patch makes these files also available in a binderfs instance
mounted with the mount option "stats=global".
It does not affect the presence of these files in debugfs.
If a binderfs instance is mounted at path /dev/binderfs, the location of
these files will be as follows:
/dev/binderfs/binder_logs/failed_transaction_log
/dev/binderfs/binder_logs/transaction_log
This change provides an alternate option to access these files when
debugfs is not mounted.
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Hridya Valsaraju <hridya@google.com>
Link: https://lore.kernel.org/r/20190903161655.107408-4-hridya@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binderfs.c')
-rw-r--r-- | drivers/android/binderfs.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index f2539b6a4968..dd5b9f754c7d 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -630,6 +630,24 @@ static int init_binder_logs(struct super_block *sb) dentry = binderfs_create_file(binder_logs_root_dir, "transactions", &binder_transactions_fops, NULL); + if (IS_ERR(dentry)) { + ret = PTR_ERR(dentry); + goto out; + } + + dentry = binderfs_create_file(binder_logs_root_dir, + "transaction_log", + &binder_transaction_log_fops, + &binder_transaction_log); + if (IS_ERR(dentry)) { + ret = PTR_ERR(dentry); + goto out; + } + + dentry = binderfs_create_file(binder_logs_root_dir, + "failed_transaction_log", + &binder_transaction_log_fops, + &binder_transaction_log_failed); if (IS_ERR(dentry)) ret = PTR_ERR(dentry); |