Lines Matching refs:proc

95 DEFINE_SHOW_ATTRIBUTE(proc);
244 #define binder_proc_lock(proc) _binder_proc_lock(proc, __LINE__) argument
246 _binder_proc_lock(struct binder_proc *proc, int line) in _binder_proc_lock() argument
247 __acquires(&proc->outer_lock) in _binder_proc_lock()
251 spin_lock(&proc->outer_lock); in _binder_proc_lock()
262 _binder_proc_unlock(struct binder_proc *proc, int line) in _binder_proc_unlock() argument
263 __releases(&proc->outer_lock) in _binder_proc_unlock()
267 spin_unlock(&proc->outer_lock); in _binder_proc_unlock()
276 #define binder_inner_proc_lock(proc) _binder_inner_proc_lock(proc, __LINE__) argument
278 _binder_inner_proc_lock(struct binder_proc *proc, int line) in _binder_inner_proc_lock() argument
279 __acquires(&proc->inner_lock) in _binder_inner_proc_lock()
283 spin_lock(&proc->inner_lock); in _binder_inner_proc_lock()
292 #define binder_inner_proc_unlock(proc) _binder_inner_proc_unlock(proc, __LINE__) argument
294 _binder_inner_proc_unlock(struct binder_proc *proc, int line) in _binder_inner_proc_unlock() argument
295 __releases(&proc->inner_lock) in _binder_inner_proc_unlock()
299 spin_unlock(&proc->inner_lock); in _binder_inner_proc_unlock()
344 __acquires(&node->lock) __acquires(&node->proc->inner_lock) in _binder_node_inner_lock()
349 if (node->proc) in _binder_node_inner_lock()
350 binder_inner_proc_lock(node->proc); in _binder_node_inner_lock()
353 __acquire(&node->proc->inner_lock); in _binder_node_inner_lock()
365 __releases(&node->lock) __releases(&node->proc->inner_lock) in _binder_node_inner_unlock()
367 struct binder_proc *proc = node->proc; in _binder_node_inner_unlock() local
371 if (proc) in _binder_node_inner_unlock()
372 binder_inner_proc_unlock(proc); in _binder_node_inner_unlock()
375 __release(&node->proc->inner_lock); in _binder_node_inner_unlock()
391 static bool binder_worklist_empty(struct binder_proc *proc, in binder_worklist_empty() argument
396 binder_inner_proc_lock(proc); in binder_worklist_empty()
398 binder_inner_proc_unlock(proc); in binder_worklist_empty()
471 binder_inner_proc_lock(thread->proc); in binder_enqueue_thread_work()
473 binder_inner_proc_unlock(thread->proc); in binder_enqueue_thread_work()
491 binder_dequeue_work(struct binder_proc *proc, struct binder_work *work) in binder_dequeue_work() argument
493 binder_inner_proc_lock(proc); in binder_dequeue_work()
495 binder_inner_proc_unlock(proc); in binder_dequeue_work()
510 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
512 static void binder_free_proc(struct binder_proc *proc);
526 !binder_worklist_empty_ilocked(&thread->proc->todo)); in binder_has_work_ilocked()
533 binder_inner_proc_lock(thread->proc); in binder_has_work()
535 binder_inner_proc_unlock(thread->proc); in binder_has_work()
548 static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc, in binder_wakeup_poll_threads_ilocked() argument
554 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_wakeup_poll_threads_ilocked()
558 trace_android_vh_binder_wakeup_ilocked(thread->task, sync, proc); in binder_wakeup_poll_threads_ilocked()
580 binder_select_thread_ilocked(struct binder_proc *proc) in binder_select_thread_ilocked() argument
584 assert_spin_locked(&proc->inner_lock); in binder_select_thread_ilocked()
585 thread = list_first_entry_or_null(&proc->waiting_threads, in binder_select_thread_ilocked()
611 static void binder_wakeup_thread_ilocked(struct binder_proc *proc, in binder_wakeup_thread_ilocked() argument
615 assert_spin_locked(&proc->inner_lock); in binder_wakeup_thread_ilocked()
618 trace_android_vh_binder_wakeup_ilocked(thread->task, sync, proc); in binder_wakeup_thread_ilocked()
639 binder_wakeup_poll_threads_ilocked(proc, sync); in binder_wakeup_thread_ilocked()
642 static void binder_wakeup_proc_ilocked(struct binder_proc *proc) in binder_wakeup_proc_ilocked() argument
644 struct binder_thread *thread = binder_select_thread_ilocked(proc); in binder_wakeup_proc_ilocked()
646 binder_wakeup_thread_ilocked(proc, thread, /* sync = */false); in binder_wakeup_proc_ilocked()
796 static struct binder_node *binder_get_node_ilocked(struct binder_proc *proc, in binder_get_node_ilocked() argument
799 struct rb_node *n = proc->nodes.rb_node; in binder_get_node_ilocked()
802 assert_spin_locked(&proc->inner_lock); in binder_get_node_ilocked()
824 static struct binder_node *binder_get_node(struct binder_proc *proc, in binder_get_node() argument
829 binder_inner_proc_lock(proc); in binder_get_node()
830 node = binder_get_node_ilocked(proc, ptr); in binder_get_node()
831 binder_inner_proc_unlock(proc); in binder_get_node()
836 struct binder_proc *proc, in binder_init_node_ilocked() argument
840 struct rb_node **p = &proc->nodes.rb_node; in binder_init_node_ilocked()
848 assert_spin_locked(&proc->inner_lock); in binder_init_node_ilocked()
873 rb_insert_color(&node->rb_node, &proc->nodes); in binder_init_node_ilocked()
875 node->proc = proc; in binder_init_node_ilocked()
891 proc->pid, current->pid, node->debug_id, in binder_init_node_ilocked()
897 static struct binder_node *binder_new_node(struct binder_proc *proc, in binder_new_node() argument
905 binder_inner_proc_lock(proc); in binder_new_node()
906 node = binder_init_node_ilocked(proc, new_node, fp); in binder_new_node()
907 binder_inner_proc_unlock(proc); in binder_new_node()
927 struct binder_proc *proc = node->proc; in binder_inc_node_nilocked() local
930 if (proc) in binder_inc_node_nilocked()
931 assert_spin_locked(&proc->inner_lock); in binder_inc_node_nilocked()
936 !(node->proc && in binder_inc_node_nilocked()
937 node == node->proc->context->binder_context_mgr_node && in binder_inc_node_nilocked()
987 struct binder_proc *proc = node->proc; in binder_dec_node_nilocked() local
990 if (proc) in binder_dec_node_nilocked()
991 assert_spin_locked(&proc->inner_lock); in binder_dec_node_nilocked()
1007 if (proc && (node->has_strong_ref || node->has_weak_ref)) { in binder_dec_node_nilocked()
1009 binder_enqueue_work_ilocked(&node->work, &proc->todo); in binder_dec_node_nilocked()
1010 binder_wakeup_proc_ilocked(proc); in binder_dec_node_nilocked()
1015 if (proc) { in binder_dec_node_nilocked()
1017 rb_erase(&node->rb_node, &proc->nodes); in binder_dec_node_nilocked()
1081 if (node->proc) in binder_inc_node_tmpref()
1082 binder_inner_proc_lock(node->proc); in binder_inc_node_tmpref()
1086 if (node->proc) in binder_inc_node_tmpref()
1087 binder_inner_proc_unlock(node->proc); in binder_inc_node_tmpref()
1104 if (!node->proc) in binder_dec_node_tmpref()
1110 if (!node->proc) in binder_dec_node_tmpref()
1131 static struct binder_ref *binder_get_ref_olocked(struct binder_proc *proc, in binder_get_ref_olocked() argument
1134 struct rb_node *n = proc->refs_by_desc.rb_node; in binder_get_ref_olocked()
1173 struct binder_proc *proc, in binder_get_ref_for_node_olocked() argument
1177 struct binder_context *context = proc->context; in binder_get_ref_for_node_olocked()
1178 struct rb_node **p = &proc->refs_by_node.rb_node; in binder_get_ref_for_node_olocked()
1199 new_ref->proc = proc; in binder_get_ref_for_node_olocked()
1202 rb_insert_color(&new_ref->rb_node_node, &proc->refs_by_node); in binder_get_ref_for_node_olocked()
1205 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in binder_get_ref_for_node_olocked()
1212 p = &proc->refs_by_desc.rb_node; in binder_get_ref_for_node_olocked()
1225 rb_insert_color(&new_ref->rb_node_desc, &proc->refs_by_desc); in binder_get_ref_for_node_olocked()
1232 proc->pid, new_ref->data.debug_id, new_ref->data.desc, in binder_get_ref_for_node_olocked()
1234 trace_android_vh_binder_new_ref(proc->tsk, new_ref->data.desc, new_ref->node->debug_id); in binder_get_ref_for_node_olocked()
1245 ref->proc->pid, ref->data.debug_id, ref->data.desc, in binder_cleanup_ref_olocked()
1248 rb_erase(&ref->rb_node_desc, &ref->proc->refs_by_desc); in binder_cleanup_ref_olocked()
1249 rb_erase(&ref->rb_node_node, &ref->proc->refs_by_node); in binder_cleanup_ref_olocked()
1273 ref->proc->pid, ref->data.debug_id, in binder_cleanup_ref_olocked()
1275 binder_dequeue_work(ref->proc, &ref->death->work); in binder_cleanup_ref_olocked()
1328 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1339 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1365 struct binder_proc *proc, in binder_get_node_from_ref() argument
1372 binder_proc_lock(proc); in binder_get_node_from_ref()
1373 ref = binder_get_ref_olocked(proc, desc, need_strong_ref); in binder_get_node_from_ref()
1384 binder_proc_unlock(proc); in binder_get_node_from_ref()
1389 binder_proc_unlock(proc); in binder_get_node_from_ref()
1402 trace_android_vh_binder_del_ref(ref->proc ? ref->proc->tsk : 0, ref->data.desc); in binder_free_ref()
1422 static int binder_update_ref_for_handle(struct binder_proc *proc, in binder_update_ref_for_handle() argument
1430 binder_proc_lock(proc); in binder_update_ref_for_handle()
1431 ref = binder_get_ref_olocked(proc, desc, strong); in binder_update_ref_for_handle()
1443 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1450 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1465 static int binder_dec_ref_for_handle(struct binder_proc *proc, in binder_dec_ref_for_handle() argument
1468 return binder_update_ref_for_handle(proc, desc, false, strong, rdata); in binder_dec_ref_for_handle()
1485 static int binder_inc_ref_for_node(struct binder_proc *proc, in binder_inc_ref_for_node() argument
1495 binder_proc_lock(proc); in binder_inc_ref_for_node()
1496 ref = binder_get_ref_for_node_olocked(proc, node, NULL); in binder_inc_ref_for_node()
1498 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1502 binder_proc_lock(proc); in binder_inc_ref_for_node()
1503 ref = binder_get_ref_for_node_olocked(proc, node, new_ref); in binder_inc_ref_for_node()
1519 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1533 assert_spin_locked(&target_thread->proc->inner_lock); in binder_pop_transaction_ilocked()
1559 binder_inner_proc_lock(thread->proc); in binder_thread_dec_tmpref()
1562 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1566 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1581 static void binder_proc_dec_tmpref(struct binder_proc *proc) in binder_proc_dec_tmpref() argument
1583 binder_inner_proc_lock(proc); in binder_proc_dec_tmpref()
1584 proc->tmp_ref--; in binder_proc_dec_tmpref()
1585 if (proc->is_dead && RB_EMPTY_ROOT(&proc->threads) && in binder_proc_dec_tmpref()
1586 !proc->tmp_ref) { in binder_proc_dec_tmpref()
1587 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1588 binder_free_proc(proc); in binder_proc_dec_tmpref()
1591 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1630 __acquires(&t->from->proc->inner_lock) in binder_get_txn_from_and_acq_inner()
1636 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
1639 binder_inner_proc_lock(from->proc); in binder_get_txn_from_and_acq_inner()
1644 binder_inner_proc_unlock(from->proc); in binder_get_txn_from_and_acq_inner()
1645 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
1709 target_thread->proc->pid, in binder_send_failed_reply()
1729 binder_inner_proc_unlock(target_thread->proc); in binder_send_failed_reply()
1734 __release(&target_thread->proc->inner_lock); in binder_send_failed_reply()
1790 static size_t binder_get_object(struct binder_proc *proc, in binder_get_object() argument
1807 if (binder_alloc_copy_from_buffer(&proc->alloc, object, buffer, in binder_get_object()
1863 struct binder_proc *proc, in binder_validate_ptr() argument
1879 if (binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_validate_ptr()
1883 object_size = binder_get_object(proc, NULL, b, object_offset, object); in binder_validate_ptr()
1931 static bool binder_validate_fixup(struct binder_proc *proc, in binder_validate_fixup() argument
1948 size_t object_size = binder_get_object(proc, NULL, b, in binder_validate_fixup()
1964 if (binder_alloc_copy_from_buffer(&proc->alloc, in binder_validate_fixup()
2033 static void binder_transaction_buffer_release(struct binder_proc *proc, in binder_transaction_buffer_release() argument
2044 proc->pid, buffer->debug_id, in binder_transaction_buffer_release()
2061 if (!binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_transaction_buffer_release()
2064 object_size = binder_get_object(proc, NULL, buffer, in binder_transaction_buffer_release()
2079 node = binder_get_node(proc, fp->binder); in binder_transaction_buffer_release()
2099 ret = binder_dec_ref_for_handle(proc, fp->handle, in binder_transaction_buffer_release()
2149 parent = binder_validate_ptr(proc, buffer, &ptr_object, in binder_transaction_buffer_release()
2190 &proc->alloc, &fd, buffer, in binder_transaction_buffer_release()
2218 struct binder_proc *proc = thread->proc; in binder_translate_binder() local
2223 node = binder_get_node(proc, fp->binder); in binder_translate_binder()
2225 node = binder_new_node(proc, fp); in binder_translate_binder()
2231 proc->pid, thread->pid, (u64)fp->binder, in binder_translate_binder()
2237 if (security_binder_transfer_binder(binder_get_cred(proc), in binder_translate_binder()
2271 struct binder_proc *proc = thread->proc; in binder_translate_handle() local
2277 node = binder_get_node_from_ref(proc, fp->handle, in binder_translate_handle()
2281 proc->pid, thread->pid, fp->handle); in binder_translate_handle()
2284 if (security_binder_transfer_binder(binder_get_cred(proc), in binder_translate_handle()
2291 if (node->proc == target_proc) { in binder_translate_handle()
2298 if (node->proc) in binder_translate_handle()
2299 binder_inner_proc_lock(node->proc); in binder_translate_handle()
2301 __acquire(&node->proc->inner_lock); in binder_translate_handle()
2305 if (node->proc) in binder_translate_handle()
2306 binder_inner_proc_unlock(node->proc); in binder_translate_handle()
2308 __release(&node->proc->inner_lock); in binder_translate_handle()
2346 struct binder_proc *proc = thread->proc; in binder_translate_fd() local
2359 proc->pid, thread->pid, in binder_translate_fd()
2369 proc->pid, thread->pid, fd); in binder_translate_fd()
2373 ret = security_binder_transfer_file(binder_get_cred(proc), in binder_translate_fd()
2660 struct binder_proc *proc = thread->proc; in binder_translate_fd_array() local
2669 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2676 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2694 proc->pid, thread->pid); in binder_translate_fd_array()
2727 struct binder_proc *proc = thread->proc; in binder_fixup_parent() local
2741 proc->pid, thread->pid); in binder_fixup_parent()
2750 proc->pid, thread->pid); in binder_fixup_parent()
2758 proc->pid, thread->pid); in binder_fixup_parent()
2835 struct binder_proc *proc, in binder_proc_transaction() argument
2857 binder_inner_proc_lock(proc); in binder_proc_transaction()
2858 if (proc->is_frozen) { in binder_proc_transaction()
2859 proc->sync_recv |= !oneway; in binder_proc_transaction()
2860 proc->async_recv |= oneway; in binder_proc_transaction()
2863 if ((proc->is_frozen && !oneway) || proc->is_dead || in binder_proc_transaction()
2865 binder_inner_proc_unlock(proc); in binder_proc_transaction()
2867 return proc->is_frozen ? BR_FROZEN_REPLY : BR_DEAD_REPLY; in binder_proc_transaction()
2871 thread = binder_select_thread_ilocked(proc); in binder_proc_transaction()
2873 trace_android_vh_binder_proc_transaction(current, proc->tsk, in binder_proc_transaction()
2881 binder_enqueue_work_ilocked(&t->work, &proc->todo); in binder_proc_transaction()
2883 if ((t->flags & TF_UPDATE_TXN) && proc->is_frozen) { in binder_proc_transaction()
2891 proc->outstanding_txns--; in binder_proc_transaction()
2897 trace_android_vh_binder_proc_transaction_end(current, proc->tsk, in binder_proc_transaction()
2901 binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */); in binder_proc_transaction()
2903 proc->outstanding_txns++; in binder_proc_transaction()
2904 binder_inner_proc_unlock(proc); in binder_proc_transaction()
2917 binder_transaction_buffer_release(proc, NULL, buffer, 0, 0); in binder_proc_transaction()
2918 binder_alloc_free_buf(&proc->alloc, buffer); in binder_proc_transaction()
2955 if (node->proc) { in binder_get_node_refs_for_txn()
2959 node->proc->tmp_ref++; in binder_get_node_refs_for_txn()
2960 *procp = node->proc; in binder_get_node_refs_for_txn()
2968 static void binder_transaction(struct binder_proc *proc, in binder_transaction() argument
2992 struct binder_context *context = proc->context; in binder_transaction()
3006 e->from_proc = proc->pid; in binder_transaction()
3011 strscpy(e->context_name, proc->context->name, BINDERFS_MAX_NAME); in binder_transaction()
3014 binder_inner_proc_lock(proc); in binder_transaction()
3017 binder_inner_proc_unlock(proc); in binder_transaction()
3019 proc->pid, thread->pid); in binder_transaction()
3028 proc->pid, thread->pid, in_reply_to->debug_id, in binder_transaction()
3034 binder_inner_proc_unlock(proc); in binder_transaction()
3042 binder_inner_proc_unlock(proc); in binder_transaction()
3046 __release(&target_thread->proc->inner_lock); in binder_transaction()
3053 proc->pid, thread->pid, in binder_transaction()
3057 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
3065 target_proc = target_thread->proc; in binder_transaction()
3067 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
3068 trace_android_vh_binder_reply(target_proc, proc, thread, tr); in binder_transaction()
3080 binder_proc_lock(proc); in binder_transaction()
3081 ref = binder_get_ref_olocked(proc, tr->target.handle, in binder_transaction()
3089 proc->pid, thread->pid, tr->target.handle); in binder_transaction()
3092 binder_proc_unlock(proc); in binder_transaction()
3103 if (target_node && target_proc->pid == proc->pid) { in binder_transaction()
3105 proc->pid, thread->pid); in binder_transaction()
3121 trace_android_vh_binder_trans(target_proc, proc, thread, tr); in binder_transaction()
3122 if (security_binder_transaction(binder_get_cred(proc), in binder_transaction()
3129 binder_inner_proc_lock(proc); in binder_transaction()
3145 proc->pid, thread->pid); in binder_transaction()
3146 binder_inner_proc_unlock(proc); in binder_transaction()
3160 proc->pid, thread->pid, tmp->debug_id, in binder_transaction()
3165 binder_inner_proc_unlock(proc); in binder_transaction()
3176 if (from && from->proc == target_proc) { in binder_transaction()
3186 binder_inner_proc_unlock(proc); in binder_transaction()
3191 trace_android_rvh_binder_transaction(target_proc, proc, thread, tr); in binder_transaction()
3220 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3229 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3240 t->sender_euid = task_euid(proc->tsk); in binder_transaction()
3260 security_cred_getsecid(binder_get_cred(proc), &secid); in binder_transaction()
3345 proc->pid, thread->pid); in binder_transaction()
3353 proc->pid, thread->pid, (u64)tr->offsets_size); in binder_transaction()
3361 proc->pid, thread->pid, in binder_transaction()
3406 proc->pid, thread->pid); in binder_transaction()
3416 proc->pid, thread->pid, in binder_transaction()
3506 proc->pid, thread->pid); in binder_transaction()
3519 proc->pid, thread->pid); in binder_transaction()
3530 binder_get_object(proc, user_buffer, t->buffer, in binder_transaction()
3534 proc->pid, thread->pid, in binder_transaction()
3569 proc->pid, thread->pid); in binder_transaction()
3612 proc->pid, thread->pid, hdr->type); in binder_transaction()
3626 proc->pid, thread->pid); in binder_transaction()
3637 proc->pid, thread->pid); in binder_transaction()
3668 binder_inner_proc_lock(proc); in binder_transaction()
3680 binder_inner_proc_unlock(proc); in binder_transaction()
3684 binder_inner_proc_lock(proc); in binder_transaction()
3686 binder_inner_proc_unlock(proc); in binder_transaction()
3712 binder_dequeue_work(proc, tcomplete); in binder_transaction()
3755 proc->pid, thread->pid, return_error, return_error_param, in binder_transaction()
3801 binder_free_buf(struct binder_proc *proc, in binder_free_buf() argument
3805 binder_inner_proc_lock(proc); in binder_free_buf()
3810 binder_inner_proc_unlock(proc); in binder_free_buf()
3818 BUG_ON(buf_node->proc != proc); in binder_free_buf()
3825 w, &proc->todo); in binder_free_buf()
3826 binder_wakeup_proc_ilocked(proc); in binder_free_buf()
3831 binder_transaction_buffer_release(proc, thread, buffer, 0, is_failure); in binder_free_buf()
3832 binder_alloc_free_buf(&proc->alloc, buffer); in binder_free_buf()
3835 static int binder_thread_write(struct binder_proc *proc, in binder_thread_write() argument
3841 struct binder_context *context = proc->context; in binder_thread_write()
3855 atomic_inc(&proc->stats.bc[_IOC_NR(cmd)]); in binder_thread_write()
3880 proc, ctx_mgr_node, in binder_thread_write()
3886 proc, target, increment, strong, in binder_thread_write()
3890 proc->pid, thread->pid, in binder_thread_write()
3910 proc->pid, thread->pid, debug_string, in binder_thread_write()
3916 proc->pid, thread->pid, debug_string, in binder_thread_write()
3934 node = binder_get_node(proc, node_ptr); in binder_thread_write()
3937 proc->pid, thread->pid, in binder_thread_write()
3946 proc->pid, thread->pid, in binder_thread_write()
3958 proc->pid, thread->pid, in binder_thread_write()
3968 proc->pid, thread->pid, in binder_thread_write()
3981 proc->pid, thread->pid, in binder_thread_write()
4004 buffer = binder_alloc_prepare_to_free(&proc->alloc, in binder_thread_write()
4010 proc->pid, thread->pid, in binder_thread_write()
4015 proc->pid, thread->pid, in binder_thread_write()
4022 proc->pid, thread->pid, (u64)data_ptr, in binder_thread_write()
4025 binder_free_buf(proc, thread, buffer, false); in binder_thread_write()
4036 binder_transaction(proc, thread, &tr.transaction_data, in binder_thread_write()
4047 binder_transaction(proc, thread, &tr, in binder_thread_write()
4055 proc->pid, thread->pid); in binder_thread_write()
4056 binder_inner_proc_lock(proc); in binder_thread_write()
4060 proc->pid, thread->pid); in binder_thread_write()
4061 } else if (proc->requested_threads == 0) { in binder_thread_write()
4064 proc->pid, thread->pid); in binder_thread_write()
4066 proc->requested_threads--; in binder_thread_write()
4067 proc->requested_threads_started++; in binder_thread_write()
4070 binder_inner_proc_unlock(proc); in binder_thread_write()
4071 trace_android_vh_binder_looper_state_registered(thread, proc); in binder_thread_write()
4076 proc->pid, thread->pid); in binder_thread_write()
4080 proc->pid, thread->pid); in binder_thread_write()
4087 proc->pid, thread->pid); in binder_thread_write()
4120 proc->pid, thread->pid); in binder_thread_write()
4124 binder_proc_lock(proc); in binder_thread_write()
4125 ref = binder_get_ref_olocked(proc, target, false); in binder_thread_write()
4128 proc->pid, thread->pid, in binder_thread_write()
4133 binder_proc_unlock(proc); in binder_thread_write()
4140 proc->pid, thread->pid, in binder_thread_write()
4152 proc->pid, thread->pid); in binder_thread_write()
4154 binder_proc_unlock(proc); in binder_thread_write()
4162 if (ref->node->proc == NULL) { in binder_thread_write()
4165 binder_inner_proc_lock(proc); in binder_thread_write()
4167 &ref->death->work, &proc->todo); in binder_thread_write()
4168 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
4169 binder_inner_proc_unlock(proc); in binder_thread_write()
4174 proc->pid, thread->pid); in binder_thread_write()
4176 binder_proc_unlock(proc); in binder_thread_write()
4182 proc->pid, thread->pid, in binder_thread_write()
4186 binder_proc_unlock(proc); in binder_thread_write()
4190 binder_inner_proc_lock(proc); in binder_thread_write()
4202 &proc->todo); in binder_thread_write()
4204 proc); in binder_thread_write()
4210 binder_inner_proc_unlock(proc); in binder_thread_write()
4213 binder_proc_unlock(proc); in binder_thread_write()
4224 binder_inner_proc_lock(proc); in binder_thread_write()
4225 list_for_each_entry(w, &proc->delivered_death, in binder_thread_write()
4239 proc->pid, thread->pid, (u64)cookie, in binder_thread_write()
4243 proc->pid, thread->pid, (u64)cookie); in binder_thread_write()
4244 binder_inner_proc_unlock(proc); in binder_thread_write()
4258 &proc->todo); in binder_thread_write()
4259 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
4262 binder_inner_proc_unlock(proc); in binder_thread_write()
4267 proc->pid, thread->pid, cmd); in binder_thread_write()
4275 static void binder_stat_br(struct binder_proc *proc, in binder_stat_br() argument
4281 atomic_inc(&proc->stats.br[_IOC_NR(cmd)]); in binder_stat_br()
4286 static int binder_put_node_cmd(struct binder_proc *proc, in binder_put_node_cmd() argument
4308 binder_stat_br(proc, thread, cmd); in binder_put_node_cmd()
4310 proc->pid, thread->pid, cmd_name, node_debug_id, in binder_put_node_cmd()
4321 struct binder_proc *proc = thread->proc; in binder_wait_for_work() local
4325 binder_inner_proc_lock(proc); in binder_wait_for_work()
4332 &proc->waiting_threads); in binder_wait_for_work()
4333 trace_android_vh_binder_wait_for_work(do_proc_work, thread, proc); in binder_wait_for_work()
4334 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4336 binder_inner_proc_lock(proc); in binder_wait_for_work()
4344 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4364 static int binder_apply_fd_fixups(struct binder_proc *proc, in binder_apply_fd_fixups() argument
4386 if (binder_alloc_copy_to_buffer(&proc->alloc, t->buffer, in binder_apply_fd_fixups()
4400 err = binder_alloc_copy_from_buffer(&proc->alloc, &fd, in binder_apply_fd_fixups()
4415 static int binder_thread_read(struct binder_proc *proc, in binder_thread_read() argument
4434 binder_inner_proc_lock(proc); in binder_thread_read()
4436 binder_inner_proc_unlock(proc); in binder_thread_read()
4442 !binder_worklist_empty(proc, &thread->todo)); in binder_thread_read()
4447 proc->pid, thread->pid, thread->looper); in binder_thread_read()
4452 binder_restore_priority(current, proc->default_priority); in binder_thread_read()
4477 binder_inner_proc_lock(proc); in binder_thread_read()
4480 else if (!binder_worklist_empty_ilocked(&proc->todo) && in binder_thread_read()
4482 list = &proc->todo; in binder_thread_read()
4484 binder_inner_proc_unlock(proc); in binder_thread_read()
4493 binder_inner_proc_unlock(proc); in binder_thread_read()
4496 trace_android_vh_binder_thread_read(&list, proc, thread); in binder_thread_read()
4503 binder_inner_proc_unlock(proc); in binder_thread_read()
4511 binder_inner_proc_unlock(proc); in binder_thread_read()
4518 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4522 if (proc->oneway_spam_detection_enabled && in binder_thread_read()
4527 binder_inner_proc_unlock(proc); in binder_thread_read()
4534 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4537 proc->pid, thread->pid); in binder_thread_read()
4549 BUG_ON(proc != node->proc); in binder_thread_read()
4575 proc->pid, thread->pid, in binder_thread_read()
4579 rb_erase(&node->rb_node, &proc->nodes); in binder_thread_read()
4580 binder_inner_proc_unlock(proc); in binder_thread_read()
4594 binder_inner_proc_unlock(proc); in binder_thread_read()
4598 proc, thread, &ptr, node_ptr, in binder_thread_read()
4603 proc, thread, &ptr, node_ptr, in binder_thread_read()
4608 proc, thread, &ptr, node_ptr, in binder_thread_read()
4613 proc, thread, &ptr, node_ptr, in binder_thread_read()
4619 proc->pid, thread->pid, in binder_thread_read()
4642 proc->pid, thread->pid, in binder_thread_read()
4648 binder_inner_proc_unlock(proc); in binder_thread_read()
4653 w, &proc->delivered_death); in binder_thread_read()
4654 binder_inner_proc_unlock(proc); in binder_thread_read()
4663 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4668 binder_inner_proc_unlock(proc); in binder_thread_read()
4670 proc->pid, thread->pid, w->type); in binder_thread_read()
4700 struct task_struct *sender = t_from->proc->tsk; in binder_thread_read()
4710 ret = binder_apply_fd_fixups(proc, t); in binder_thread_read()
4721 binder_free_buf(proc, thread, buffer, true); in binder_thread_read()
4724 proc->pid, thread->pid, in binder_thread_read()
4733 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4772 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4775 proc->pid, thread->pid, in binder_thread_read()
4779 t->debug_id, t_from ? t_from->proc->pid : 0, in binder_thread_read()
4789 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4793 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4803 binder_inner_proc_lock(proc); in binder_thread_read()
4804 if (proc->requested_threads == 0 && in binder_thread_read()
4805 list_empty(&thread->proc->waiting_threads) && in binder_thread_read()
4806 proc->requested_threads_started < proc->max_threads && in binder_thread_read()
4810 proc->requested_threads++; in binder_thread_read()
4811 binder_inner_proc_unlock(proc); in binder_thread_read()
4814 proc->pid, thread->pid); in binder_thread_read()
4817 binder_stat_br(proc, thread, BR_SPAWN_LOOPER); in binder_thread_read()
4819 binder_inner_proc_unlock(proc); in binder_thread_read()
4823 static void binder_release_work(struct binder_proc *proc, in binder_release_work() argument
4830 binder_inner_proc_lock(proc); in binder_release_work()
4833 binder_inner_proc_unlock(proc); in binder_release_work()
4883 struct binder_proc *proc, struct binder_thread *new_thread) in binder_get_thread_ilocked() argument
4887 struct rb_node **p = &proc->threads.rb_node; in binder_get_thread_ilocked()
4904 thread->proc = proc; in binder_get_thread_ilocked()
4912 rb_insert_color(&thread->rb_node, &proc->threads); in binder_get_thread_ilocked()
4922 static struct binder_thread *binder_get_thread(struct binder_proc *proc) in binder_get_thread() argument
4927 binder_inner_proc_lock(proc); in binder_get_thread()
4928 thread = binder_get_thread_ilocked(proc, NULL); in binder_get_thread()
4929 binder_inner_proc_unlock(proc); in binder_get_thread()
4934 binder_inner_proc_lock(proc); in binder_get_thread()
4935 thread = binder_get_thread_ilocked(proc, new_thread); in binder_get_thread()
4936 binder_inner_proc_unlock(proc); in binder_get_thread()
4943 static void binder_free_proc(struct binder_proc *proc) in binder_free_proc() argument
4947 container_of(proc, struct binder_proc_ext, proc); in binder_free_proc()
4949 BUG_ON(!list_empty(&proc->todo)); in binder_free_proc()
4950 BUG_ON(!list_empty(&proc->delivered_death)); in binder_free_proc()
4951 if (proc->outstanding_txns) in binder_free_proc()
4953 __func__, proc->outstanding_txns); in binder_free_proc()
4954 device = container_of(proc->context, struct binder_device, context); in binder_free_proc()
4956 kfree(proc->context->name); in binder_free_proc()
4959 binder_alloc_deferred_release(&proc->alloc); in binder_free_proc()
4960 put_task_struct(proc->tsk); in binder_free_proc()
4963 trace_android_vh_binder_free_proc(proc); in binder_free_proc()
4971 binder_proc_dec_tmpref(thread->proc); in binder_free_thread()
4976 static int binder_thread_release(struct binder_proc *proc, in binder_thread_release() argument
4984 binder_inner_proc_lock(thread->proc); in binder_thread_release()
4991 proc->tmp_ref++; in binder_thread_release()
4997 rb_erase(&thread->rb_node, &proc->threads); in binder_thread_release()
5013 proc->pid, thread->pid, in binder_thread_release()
5018 thread->proc->outstanding_txns--; in binder_thread_release()
5047 binder_inner_proc_unlock(thread->proc); in binder_thread_release()
5061 binder_release_work(proc, &thread->todo); in binder_thread_release()
5062 trace_android_vh_binder_thread_release(proc, thread); in binder_thread_release()
5070 struct binder_proc *proc = filp->private_data; in binder_poll() local
5074 thread = binder_get_thread(proc); in binder_poll()
5078 binder_inner_proc_lock(thread->proc); in binder_poll()
5082 binder_inner_proc_unlock(thread->proc); in binder_poll()
5097 struct binder_proc *proc = filp->private_data; in binder_ioctl_write_read() local
5112 proc->pid, thread->pid, in binder_ioctl_write_read()
5117 ret = binder_thread_write(proc, thread, in binder_ioctl_write_read()
5130 ret = binder_thread_read(proc, thread, bwr.read_buffer, in binder_ioctl_write_read()
5135 binder_inner_proc_lock(proc); in binder_ioctl_write_read()
5136 if (!binder_worklist_empty_ilocked(&proc->todo)) in binder_ioctl_write_read()
5137 binder_wakeup_proc_ilocked(proc); in binder_ioctl_write_read()
5138 binder_inner_proc_unlock(proc); in binder_ioctl_write_read()
5139 trace_android_vh_binder_read_done(proc, thread); in binder_ioctl_write_read()
5148 proc->pid, thread->pid, in binder_ioctl_write_read()
5163 struct binder_proc *proc = filp->private_data; in binder_ioctl_set_ctx_mgr() local
5164 struct binder_context *context = proc->context; in binder_ioctl_set_ctx_mgr()
5174 ret = security_binder_set_context_mgr(binder_get_cred(proc)); in binder_ioctl_set_ctx_mgr()
5189 new_node = binder_new_node(proc, fbo); in binder_ioctl_set_ctx_mgr()
5207 static int binder_ioctl_get_node_info_for_ref(struct binder_proc *proc, in binder_ioctl_get_node_info_for_ref() argument
5211 struct binder_context *context = proc->context; in binder_ioctl_get_node_info_for_ref()
5217 proc->pid); in binder_ioctl_get_node_info_for_ref()
5224 context->binder_context_mgr_node->proc != proc) { in binder_ioctl_get_node_info_for_ref()
5230 node = binder_get_node_from_ref(proc, handle, true, NULL); in binder_ioctl_get_node_info_for_ref()
5243 static int binder_ioctl_get_node_debug_info(struct binder_proc *proc, in binder_ioctl_get_node_debug_info() argument
5251 binder_inner_proc_lock(proc); in binder_ioctl_get_node_debug_info()
5252 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in binder_ioctl_get_node_debug_info()
5263 binder_inner_proc_unlock(proc); in binder_ioctl_get_node_debug_info()
5268 static bool binder_txns_pending_ilocked(struct binder_proc *proc) in binder_txns_pending_ilocked() argument
5273 if (proc->outstanding_txns > 0) in binder_txns_pending_ilocked()
5276 for (n = rb_first(&proc->threads); n; n = rb_next(n)) { in binder_txns_pending_ilocked()
5365 struct binder_proc *proc = filp->private_data; in binder_ioctl() local
5373 binder_selftest_alloc(&proc->alloc); in binder_ioctl()
5381 thread = binder_get_thread(proc); in binder_ioctl()
5401 binder_inner_proc_lock(proc); in binder_ioctl()
5402 proc->max_threads = max_threads; in binder_ioctl()
5403 binder_inner_proc_unlock(proc); in binder_ioctl()
5425 proc->pid, thread->pid); in binder_ioctl()
5426 binder_thread_release(proc, thread); in binder_ioctl()
5451 ret = binder_ioctl_get_node_info_for_ref(proc, &info); in binder_ioctl()
5470 ret = binder_ioctl_get_node_debug_info(proc, &info); in binder_ioctl()
5565 binder_inner_proc_lock(proc); in binder_ioctl()
5566 proc->oneway_spam_detection_enabled = (bool)enable; in binder_ioctl()
5567 binder_inner_proc_unlock(proc); in binder_ioctl()
5580 pr_info("%d:%d ioctl %x %lx returned %d\n", proc->pid, current->pid, cmd, arg, ret); in binder_ioctl()
5588 struct binder_proc *proc = vma->vm_private_data; in binder_vma_open() local
5592 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_open()
5599 struct binder_proc *proc = vma->vm_private_data; in binder_vma_close() local
5603 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_close()
5606 binder_alloc_vma_close(&proc->alloc); in binder_vma_close()
5622 struct binder_proc *proc = filp->private_data; in binder_mmap() local
5624 if (proc->tsk != current->group_leader) in binder_mmap()
5629 __func__, proc->pid, vma->vm_start, vma->vm_end, in binder_mmap()
5635 proc->pid, vma->vm_start, vma->vm_end, "bad vm_flags", -EPERM); in binder_mmap()
5642 vma->vm_private_data = proc; in binder_mmap()
5644 return binder_alloc_mmap_handler(&proc->alloc, vma); in binder_mmap()
5649 struct binder_proc *proc, *itr; in binder_open() local
5660 proc = &eproc->proc; in binder_open()
5661 if (proc == NULL) in binder_open()
5663 spin_lock_init(&proc->inner_lock); in binder_open()
5664 spin_lock_init(&proc->outer_lock); in binder_open()
5666 proc->tsk = current->group_leader; in binder_open()
5668 INIT_LIST_HEAD(&proc->todo); in binder_open()
5669 init_waitqueue_head(&proc->freeze_wait); in binder_open()
5671 proc->default_priority.sched_policy = current->policy; in binder_open()
5672 proc->default_priority.prio = current->normal_prio; in binder_open()
5674 proc->default_priority.sched_policy = SCHED_NORMAL; in binder_open()
5675 proc->default_priority.prio = NICE_TO_PRIO(0); in binder_open()
5688 proc->context = &binder_dev->context; in binder_open()
5689 binder_alloc_init(&proc->alloc); in binder_open()
5692 proc->pid = current->group_leader->pid; in binder_open()
5693 INIT_LIST_HEAD(&proc->delivered_death); in binder_open()
5694 INIT_LIST_HEAD(&proc->waiting_threads); in binder_open()
5695 filp->private_data = proc; in binder_open()
5699 if (itr->pid == proc->pid) { in binder_open()
5704 hlist_add_head(&proc->proc_node, &binder_procs); in binder_open()
5710 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5717 proc->debugfs_entry = debugfs_create_file(strbuf, 0444, in binder_open()
5719 (void *)(unsigned long)proc->pid, in binder_open()
5727 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5735 strbuf, &proc_fops, (void *)(unsigned long)proc->pid); in binder_open()
5737 proc->binderfs_entry = binderfs_entry; in binder_open()
5752 struct binder_proc *proc = filp->private_data; in binder_flush() local
5754 binder_defer_work(proc, BINDER_DEFERRED_FLUSH); in binder_flush()
5759 static void binder_deferred_flush(struct binder_proc *proc) in binder_deferred_flush() argument
5764 binder_inner_proc_lock(proc); in binder_deferred_flush()
5765 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_deferred_flush()
5774 binder_inner_proc_unlock(proc); in binder_deferred_flush()
5777 "binder_flush: %d woke %d threads\n", proc->pid, in binder_deferred_flush()
5783 struct binder_proc *proc = filp->private_data; in binder_release() local
5785 debugfs_remove(proc->debugfs_entry); in binder_release()
5787 if (proc->binderfs_entry) { in binder_release()
5788 binderfs_remove_file(proc->binderfs_entry); in binder_release()
5789 proc->binderfs_entry = NULL; in binder_release()
5792 binder_defer_work(proc, BINDER_DEFERRED_RELEASE); in binder_release()
5801 struct binder_proc *proc = node->proc; in binder_node_release() local
5803 binder_release_work(proc, &node->async_todo); in binder_node_release()
5806 binder_inner_proc_lock(proc); in binder_node_release()
5813 binder_inner_proc_unlock(proc); in binder_node_release()
5820 node->proc = NULL; in binder_node_release()
5823 binder_inner_proc_unlock(proc); in binder_node_release()
5837 binder_inner_proc_lock(ref->proc); in binder_node_release()
5839 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5848 &ref->proc->todo); in binder_node_release()
5849 binder_wakeup_proc_ilocked(ref->proc); in binder_node_release()
5850 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5862 static void binder_deferred_release(struct binder_proc *proc) in binder_deferred_release() argument
5864 struct binder_context *context = proc->context; in binder_deferred_release()
5869 hlist_del(&proc->proc_node); in binder_deferred_release()
5874 context->binder_context_mgr_node->proc == proc) { in binder_deferred_release()
5877 __func__, proc->pid); in binder_deferred_release()
5881 binder_inner_proc_lock(proc); in binder_deferred_release()
5886 proc->tmp_ref++; in binder_deferred_release()
5888 proc->is_dead = true; in binder_deferred_release()
5889 proc->is_frozen = false; in binder_deferred_release()
5890 proc->sync_recv = false; in binder_deferred_release()
5891 proc->async_recv = false; in binder_deferred_release()
5894 while ((n = rb_first(&proc->threads))) { in binder_deferred_release()
5898 binder_inner_proc_unlock(proc); in binder_deferred_release()
5900 active_transactions += binder_thread_release(proc, thread); in binder_deferred_release()
5901 binder_inner_proc_lock(proc); in binder_deferred_release()
5906 while ((n = rb_first(&proc->nodes))) { in binder_deferred_release()
5917 rb_erase(&node->rb_node, &proc->nodes); in binder_deferred_release()
5918 binder_inner_proc_unlock(proc); in binder_deferred_release()
5920 binder_inner_proc_lock(proc); in binder_deferred_release()
5922 binder_inner_proc_unlock(proc); in binder_deferred_release()
5925 binder_proc_lock(proc); in binder_deferred_release()
5926 while ((n = rb_first(&proc->refs_by_desc))) { in binder_deferred_release()
5932 binder_proc_unlock(proc); in binder_deferred_release()
5934 binder_proc_lock(proc); in binder_deferred_release()
5936 binder_proc_unlock(proc); in binder_deferred_release()
5938 binder_release_work(proc, &proc->todo); in binder_deferred_release()
5939 binder_release_work(proc, &proc->delivered_death); in binder_deferred_release()
5943 __func__, proc->pid, threads, nodes, incoming_refs, in binder_deferred_release()
5946 binder_proc_dec_tmpref(proc); in binder_deferred_release()
5951 struct binder_proc *proc; in binder_deferred_func() local
5958 proc = hlist_entry(binder_deferred_list.first, in binder_deferred_func()
5960 hlist_del_init(&proc->deferred_work_node); in binder_deferred_func()
5961 defer = proc->deferred_work; in binder_deferred_func()
5962 proc->deferred_work = 0; in binder_deferred_func()
5964 proc = NULL; in binder_deferred_func()
5970 binder_deferred_flush(proc); in binder_deferred_func()
5973 binder_deferred_release(proc); /* frees proc */ in binder_deferred_func()
5974 } while (proc); in binder_deferred_func()
5979 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer) in binder_defer_work() argument
5982 proc->deferred_work |= defer; in binder_defer_work()
5983 if (hlist_unhashed(&proc->deferred_work_node)) { in binder_defer_work()
5984 hlist_add_head(&proc->deferred_work_node, in binder_defer_work()
5992 struct binder_proc *proc, in print_binder_transaction_ilocked() argument
6000 trace_android_vh_binder_print_transaction_info(m, proc, prefix, t); in print_binder_transaction_ilocked()
6005 t->from ? t->from->proc->pid : 0, in print_binder_transaction_ilocked()
6013 if (proc != to_proc) { in print_binder_transaction_ilocked()
6034 struct binder_proc *proc, in print_binder_work_ilocked() argument
6046 m, proc, transaction_prefix, t); in print_binder_work_ilocked()
6096 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6100 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6104 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6110 print_binder_work_ilocked(m, thread->proc, " ", in print_binder_thread_ilocked()
6137 seq_printf(m, " %d", ref->proc->pid); in print_binder_node_nilocked()
6140 if (node->proc) { in print_binder_node_nilocked()
6142 print_binder_work_ilocked(m, node->proc, " ", in print_binder_node_nilocked()
6153 ref->node->proc ? "" : "dead ", in print_binder_ref_olocked()
6160 struct binder_proc *proc, int print_all) in print_binder_proc() argument
6168 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc()
6169 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc()
6172 binder_inner_proc_lock(proc); in print_binder_proc()
6173 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc()
6177 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in print_binder_proc()
6190 binder_inner_proc_unlock(proc); in print_binder_proc()
6197 binder_inner_proc_lock(proc); in print_binder_proc()
6199 binder_inner_proc_unlock(proc); in print_binder_proc()
6204 binder_proc_lock(proc); in print_binder_proc()
6205 for (n = rb_first(&proc->refs_by_desc); in print_binder_proc()
6211 binder_proc_unlock(proc); in print_binder_proc()
6213 binder_alloc_print_allocated(m, &proc->alloc); in print_binder_proc()
6214 binder_inner_proc_lock(proc); in print_binder_proc()
6215 list_for_each_entry(w, &proc->todo, entry) in print_binder_proc()
6216 print_binder_work_ilocked(m, proc, " ", in print_binder_proc()
6218 list_for_each_entry(w, &proc->delivered_death, entry) { in print_binder_proc()
6222 binder_inner_proc_unlock(proc); in print_binder_proc()
6325 struct binder_proc *proc) in print_binder_proc_stats() argument
6332 binder_alloc_get_free_async_space(&proc->alloc); in print_binder_proc_stats()
6334 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc_stats()
6335 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc_stats()
6338 binder_inner_proc_lock(proc); in print_binder_proc_stats()
6339 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
6342 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_stats()
6348 " free async space %zd\n", proc->requested_threads, in print_binder_proc_stats()
6349 proc->requested_threads_started, proc->max_threads, in print_binder_proc_stats()
6353 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
6355 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
6360 binder_proc_lock(proc); in print_binder_proc_stats()
6361 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in print_binder_proc_stats()
6368 binder_proc_unlock(proc); in print_binder_proc_stats()
6371 count = binder_alloc_get_allocated_count(&proc->alloc); in print_binder_proc_stats()
6374 binder_alloc_print_pages(m, &proc->alloc); in print_binder_proc_stats()
6377 binder_inner_proc_lock(proc); in print_binder_proc_stats()
6378 list_for_each_entry(w, &proc->todo, entry) { in print_binder_proc_stats()
6382 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
6385 print_binder_stats(m, " ", &proc->stats); in print_binder_proc_stats()
6390 struct binder_proc *proc; in state_show() local
6420 hlist_for_each_entry(proc, &binder_procs, proc_node) in state_show()
6421 print_binder_proc(m, proc, 1); in state_show()
6429 struct binder_proc *proc; in stats_show() local
6436 hlist_for_each_entry(proc, &binder_procs, proc_node) in stats_show()
6437 print_binder_proc_stats(m, proc); in stats_show()
6445 struct binder_proc *proc; in transactions_show() local
6449 hlist_for_each_entry(proc, &binder_procs, proc_node) in transactions_show()
6450 print_binder_proc(m, proc, 0); in transactions_show()