@@ -94,22 +94,8 @@ static struct dentry *binder_debugfs_dir_entry_root;
94
94
static struct dentry * binder_debugfs_dir_entry_proc ;
95
95
static atomic_t binder_last_id ;
96
96
97
- #define BINDER_DEBUG_ENTRY (name ) \
98
- static int binder_##name##_open(struct inode *inode, struct file *file) \
99
- { \
100
- return single_open(file, binder_##name##_show, inode->i_private); \
101
- } \
102
- \
103
- static const struct file_operations binder_##name##_fops = { \
104
- .owner = THIS_MODULE, \
105
- .open = binder_##name##_open, \
106
- .read = seq_read, \
107
- .llseek = seq_lseek, \
108
- .release = single_release, \
109
- }
110
-
111
- static int binder_proc_show (struct seq_file * m , void * unused );
112
- BINDER_DEBUG_ENTRY (proc );
97
+ static int proc_show (struct seq_file * m , void * unused );
98
+ DEFINE_SHOW_ATTRIBUTE (proc );
113
99
114
100
/* This is only defined in include/asm-arm/sizes.h */
115
101
#ifndef SZ_1K
@@ -5008,7 +4994,7 @@ static int binder_open(struct inode *nodp, struct file *filp)
5008
4994
proc -> debugfs_entry = debugfs_create_file (strbuf , 0444 ,
5009
4995
binder_debugfs_dir_entry_proc ,
5010
4996
(void * )(unsigned long )proc -> pid ,
5011
- & binder_proc_fops );
4997
+ & proc_fops );
5012
4998
}
5013
4999
5014
5000
return 0 ;
@@ -5636,7 +5622,7 @@ static void print_binder_proc_stats(struct seq_file *m,
5636
5622
}
5637
5623
5638
5624
5639
- static int binder_state_show (struct seq_file * m , void * unused )
5625
+ static int state_show (struct seq_file * m , void * unused )
5640
5626
{
5641
5627
struct binder_proc * proc ;
5642
5628
struct binder_node * node ;
@@ -5675,7 +5661,7 @@ static int binder_state_show(struct seq_file *m, void *unused)
5675
5661
return 0 ;
5676
5662
}
5677
5663
5678
- static int binder_stats_show (struct seq_file * m , void * unused )
5664
+ static int stats_show (struct seq_file * m , void * unused )
5679
5665
{
5680
5666
struct binder_proc * proc ;
5681
5667
@@ -5691,7 +5677,7 @@ static int binder_stats_show(struct seq_file *m, void *unused)
5691
5677
return 0 ;
5692
5678
}
5693
5679
5694
- static int binder_transactions_show (struct seq_file * m , void * unused )
5680
+ static int transactions_show (struct seq_file * m , void * unused )
5695
5681
{
5696
5682
struct binder_proc * proc ;
5697
5683
@@ -5704,7 +5690,7 @@ static int binder_transactions_show(struct seq_file *m, void *unused)
5704
5690
return 0 ;
5705
5691
}
5706
5692
5707
- static int binder_proc_show (struct seq_file * m , void * unused )
5693
+ static int proc_show (struct seq_file * m , void * unused )
5708
5694
{
5709
5695
struct binder_proc * itr ;
5710
5696
int pid = (unsigned long )m -> private ;
@@ -5747,7 +5733,7 @@ static void print_binder_transaction_log_entry(struct seq_file *m,
5747
5733
"\n" : " (incomplete)\n" );
5748
5734
}
5749
5735
5750
- static int binder_transaction_log_show (struct seq_file * m , void * unused )
5736
+ static int transaction_log_show (struct seq_file * m , void * unused )
5751
5737
{
5752
5738
struct binder_transaction_log * log = m -> private ;
5753
5739
unsigned int log_cur = atomic_read (& log -> cur );
@@ -5779,10 +5765,10 @@ static const struct file_operations binder_fops = {
5779
5765
.release = binder_release ,
5780
5766
};
5781
5767
5782
- BINDER_DEBUG_ENTRY (state );
5783
- BINDER_DEBUG_ENTRY (stats );
5784
- BINDER_DEBUG_ENTRY (transactions );
5785
- BINDER_DEBUG_ENTRY (transaction_log );
5768
+ DEFINE_SHOW_ATTRIBUTE (state );
5769
+ DEFINE_SHOW_ATTRIBUTE (stats );
5770
+ DEFINE_SHOW_ATTRIBUTE (transactions );
5771
+ DEFINE_SHOW_ATTRIBUTE (transaction_log );
5786
5772
5787
5773
static int __init init_binder_device (const char * name )
5788
5774
{
@@ -5836,27 +5822,27 @@ static int __init binder_init(void)
5836
5822
0444 ,
5837
5823
binder_debugfs_dir_entry_root ,
5838
5824
NULL ,
5839
- & binder_state_fops );
5825
+ & state_fops );
5840
5826
debugfs_create_file ("stats" ,
5841
5827
0444 ,
5842
5828
binder_debugfs_dir_entry_root ,
5843
5829
NULL ,
5844
- & binder_stats_fops );
5830
+ & stats_fops );
5845
5831
debugfs_create_file ("transactions" ,
5846
5832
0444 ,
5847
5833
binder_debugfs_dir_entry_root ,
5848
5834
NULL ,
5849
- & binder_transactions_fops );
5835
+ & transactions_fops );
5850
5836
debugfs_create_file ("transaction_log" ,
5851
5837
0444 ,
5852
5838
binder_debugfs_dir_entry_root ,
5853
5839
& binder_transaction_log ,
5854
- & binder_transaction_log_fops );
5840
+ & transaction_log_fops );
5855
5841
debugfs_create_file ("failed_transaction_log" ,
5856
5842
0444 ,
5857
5843
binder_debugfs_dir_entry_root ,
5858
5844
& binder_transaction_log_failed ,
5859
- & binder_transaction_log_fops );
5845
+ & transaction_log_fops );
5860
5846
}
5861
5847
5862
5848
/*
0 commit comments