7575#include <linux/syscalls.h>
7676#include <linux/task_work.h>
7777#include <linux/sizes.h>
78- #include <linux/android_vendor.h>
7978
8079#include <uapi/linux/sched/types.h>
8180#include <uapi/linux/android/binder.h>
82- #include "binder_alloc.h"
81+ #include <uapi/linux/eventpoll.h>
82+
83+ #include <asm/cacheflush.h>
84+
8385#include "binder_internal.h"
8486#include "binder_trace.h"
85- #include <trace/hooks/binder.h>
8687
8788static HLIST_HEAD (binder_deferred_list );
8889static DEFINE_MUTEX (binder_deferred_lock );
@@ -845,7 +846,6 @@ static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc,
845846 thread = rb_entry (n , struct binder_thread , rb_node );
846847 if (thread -> looper & BINDER_LOOPER_STATE_POLL &&
847848 binder_available_for_proc_work_ilocked (thread )) {
848- trace_android_vh_binder_wakeup_ilocked (thread -> task , sync , proc );
849849 if (sync )
850850 wake_up_interruptible_sync (& thread -> wait );
851851 else
@@ -905,7 +905,6 @@ static void binder_wakeup_thread_ilocked(struct binder_proc *proc,
905905 assert_spin_locked (& proc -> inner_lock );
906906
907907 if (thread ) {
908- trace_android_vh_binder_wakeup_ilocked (thread -> task , sync , proc );
909908 if (sync )
910909 wake_up_interruptible_sync (& thread -> wait );
911910 else
@@ -1053,7 +1052,6 @@ static void binder_transaction_priority(struct task_struct *task,
10531052 .sched_policy = node -> sched_policy ,
10541053 .prio = node -> min_priority ,
10551054 };
1056- bool skip = false;
10571055
10581056 if (t -> set_priority_called )
10591057 return ;
@@ -1062,10 +1060,6 @@ static void binder_transaction_priority(struct task_struct *task,
10621060 t -> saved_priority .sched_policy = task -> policy ;
10631061 t -> saved_priority .prio = task -> normal_prio ;
10641062
1065- trace_android_vh_binder_priority_skip (task , & skip );
1066- if (skip )
1067- return ;
1068-
10691063 if (!node -> inherit_rt && is_rt_policy (desired .sched_policy )) {
10701064 desired .prio = NICE_TO_PRIO (0 );
10711065 desired .sched_policy = SCHED_NORMAL ;
@@ -1104,7 +1098,6 @@ static void binder_transaction_priority(struct task_struct *task,
11041098 spin_unlock (& thread -> prio_lock );
11051099
11061100 binder_set_priority (thread , & desired );
1107- trace_android_vh_binder_set_priority (t , task );
11081101}
11091102
11101103static struct binder_node * binder_get_node_ilocked (struct binder_proc * proc ,
@@ -1548,7 +1541,6 @@ static struct binder_ref *binder_get_ref_for_node_olocked(
15481541 "%d new ref %d desc %d for node %d\n" ,
15491542 proc -> pid , new_ref -> data .debug_id , new_ref -> data .desc ,
15501543 node -> debug_id );
1551- trace_android_vh_binder_new_ref (proc -> tsk , new_ref -> data .desc , new_ref -> node -> debug_id );
15521544 binder_node_unlock (node );
15531545 return new_ref ;
15541546}
@@ -1716,7 +1708,6 @@ static struct binder_node *binder_get_node_from_ref(
17161708 */
17171709static void binder_free_ref (struct binder_ref * ref )
17181710{
1719- trace_android_vh_binder_del_ref (ref -> proc ? ref -> proc -> tsk : 0 , ref -> data .desc );
17201711 if (ref -> node )
17211712 binder_free_node (ref -> node );
17221713 kfree (ref -> death );
@@ -2319,10 +2310,10 @@ static void binder_deferred_fd_close(int fd)
23192310 if (!twcb )
23202311 return ;
23212312 init_task_work (& twcb -> twork , binder_do_fd_close );
2322- close_fd_get_file (fd , & twcb -> file );
2313+ __close_fd_get_file (fd , & twcb -> file );
23232314 if (twcb -> file ) {
23242315 filp_close (twcb -> file , current -> files );
2325- task_work_add (current , & twcb -> twork , TWA_RESUME );
2316+ task_work_add (current , & twcb -> twork , true );
23262317 } else {
23272318 kfree (twcb );
23282319 }
@@ -3122,9 +3113,6 @@ static int binder_proc_transaction(struct binder_transaction *t,
31223113 if (!thread && !pending_async )
31233114 thread = binder_select_thread_ilocked (proc );
31243115
3125- trace_android_vh_binder_proc_transaction (current , proc -> tsk ,
3126- thread ? thread -> task : 0 , node -> debug_id , t -> code , pending_async );
3127-
31283116 if (thread ) {
31293117 binder_transaction_priority (thread -> task , t , node_prio ,
31303118 node -> inherit_rt );
@@ -3301,7 +3289,6 @@ static void binder_transaction(struct binder_proc *proc,
33013289 target_proc = target_thread -> proc ;
33023290 atomic_inc (& target_proc -> tmp_ref );
33033291 binder_inner_proc_unlock (target_thread -> proc );
3304- trace_android_vh_binder_reply (target_proc , proc , thread , tr );
33053292 } else {
33063293 if (tr -> target .handle ) {
33073294 struct binder_ref * ref ;
@@ -3360,7 +3347,6 @@ static void binder_transaction(struct binder_proc *proc,
33603347 return_error_line = __LINE__ ;
33613348 goto err_invalid_target_handle ;
33623349 }
3363- trace_android_vh_binder_trans (target_proc , proc , thread , tr );
33643350 if (security_binder_transaction (proc -> cred ,
33653351 target_proc -> cred ) < 0 ) {
33663352 return_error = BR_FAILED_REPLY ;
@@ -3418,7 +3404,6 @@ static void binder_transaction(struct binder_proc *proc,
34183404 }
34193405 binder_stats_created (BINDER_STAT_TRANSACTION );
34203406 spin_lock_init (& t -> lock );
3421- trace_android_vh_binder_transaction_init (t );
34223407
34233408 tcomplete = kzalloc (sizeof (* tcomplete ), GFP_KERNEL );
34243409 if (tcomplete == NULL ) {
@@ -3849,7 +3834,6 @@ static void binder_transaction(struct binder_proc *proc,
38493834 target_proc -> outstanding_txns ++ ;
38503835 binder_inner_proc_unlock (target_proc );
38513836 wake_up_interruptible_sync (& target_thread -> wait );
3852- trace_android_vh_binder_restore_priority (in_reply_to , current );
38533837 binder_restore_priority (thread , & in_reply_to -> saved_priority );
38543838 binder_free_transaction (in_reply_to );
38553839 } else if (!(t -> flags & TF_ONE_WAY )) {
@@ -3963,7 +3947,6 @@ static void binder_transaction(struct binder_proc *proc,
39633947
39643948 BUG_ON (thread -> return_error .cmd != BR_OK );
39653949 if (in_reply_to ) {
3966- trace_android_vh_binder_restore_priority (in_reply_to , current );
39673950 binder_restore_priority (thread , & in_reply_to -> saved_priority );
39683951 thread -> return_error .cmd = BR_TRANSACTION_COMPLETE ;
39693952 binder_enqueue_thread_work (thread , & thread -> return_error .work );
@@ -4545,7 +4528,6 @@ static int binder_wait_for_work(struct binder_thread *thread,
45454528 if (do_proc_work )
45464529 list_add (& thread -> waiting_thread_node ,
45474530 & proc -> waiting_threads );
4548- trace_android_vh_binder_wait_for_work (do_proc_work , thread , proc );
45494531 binder_inner_proc_unlock (proc );
45504532 schedule ();
45514533 binder_inner_proc_lock (proc );
@@ -4598,7 +4580,6 @@ static int binder_thread_read(struct binder_proc *proc,
45984580 wait_event_interruptible (binder_user_error_wait ,
45994581 binder_stop_on_user_error < 2 );
46004582 }
4601- trace_android_vh_binder_restore_priority (NULL , current );
46024583 binder_restore_priority (thread , & proc -> default_priority );
46034584 }
46044585
@@ -4846,7 +4827,6 @@ static int binder_thread_read(struct binder_proc *proc,
48464827 trd -> sender_pid =
48474828 task_tgid_nr_ns (sender ,
48484829 task_active_pid_ns (current ));
4849- trace_android_vh_sync_txn_recvd (thread -> task , t_from -> task );
48504830 } else {
48514831 trd -> sender_pid = 0 ;
48524832 }
@@ -5171,7 +5151,7 @@ static int binder_thread_release(struct binder_proc *proc,
51715151 return active_transactions ;
51725152}
51735153
5174- static __poll_t binder_poll (struct file * filp ,
5154+ static unsigned int binder_poll (struct file * filp ,
51755155 struct poll_table_struct * wait )
51765156{
51775157 struct binder_proc * proc = filp -> private_data ;
@@ -5713,7 +5693,7 @@ static void binder_vma_close(struct vm_area_struct *vma)
57135693 binder_defer_work (proc , BINDER_DEFERRED_PUT_FILES );
57145694}
57155695
5716- static vm_fault_t binder_vm_fault (struct vm_fault * vmf )
5696+ static int binder_vm_fault (struct vm_fault * vmf )
57175697{
57185698 return VM_FAULT_SIGBUS ;
57195699}
@@ -5822,7 +5802,7 @@ static int binder_open(struct inode *nodp, struct file *filp)
58225802 mutex_lock (& binder_procs_lock );
58235803 hlist_add_head (& proc -> proc_node , & binder_procs );
58245804 mutex_unlock (& binder_procs_lock );
5825- trace_android_vh_binder_preset ( & binder_procs , & binder_procs_lock );
5805+
58265806 if (binder_debugfs_dir_entry_proc && !existing_pid ) {
58275807 char strbuf [11 ];
58285808
@@ -6137,7 +6117,6 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
61376117 struct binder_buffer * buffer = t -> buffer ;
61386118
61396119 spin_lock (& t -> lock );
6140- trace_android_vh_binder_print_transaction_info (m , proc , prefix , t );
61416120 to_proc = t -> to_proc ;
61426121 seq_printf (m ,
61436122 "%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %d:%d r%d" ,
0 commit comments