Lines Matching refs:proc
93 DEFINE_SHOW_ATTRIBUTE(proc);
269 #define binder_proc_lock(proc) _binder_proc_lock(proc, __LINE__) argument
271 _binder_proc_lock(struct binder_proc *proc, int line) in _binder_proc_lock() argument
272 __acquires(&proc->outer_lock) in _binder_proc_lock()
276 spin_lock(&proc->outer_lock); in _binder_proc_lock()
285 #define binder_proc_unlock(proc) _binder_proc_unlock(proc, __LINE__) argument
287 _binder_proc_unlock(struct binder_proc *proc, int line) in _binder_proc_unlock() argument
288 __releases(&proc->outer_lock) in _binder_proc_unlock()
292 spin_unlock(&proc->outer_lock); in _binder_proc_unlock()
301 #define binder_inner_proc_lock(proc) _binder_inner_proc_lock(proc, __LINE__) argument
303 _binder_inner_proc_lock(struct binder_proc *proc, int line) in _binder_inner_proc_lock() argument
304 __acquires(&proc->inner_lock) in _binder_inner_proc_lock()
308 spin_lock(&proc->inner_lock); in _binder_inner_proc_lock()
317 #define binder_inner_proc_unlock(proc) _binder_inner_proc_unlock(proc, __LINE__) argument
319 _binder_inner_proc_unlock(struct binder_proc *proc, int line) in _binder_inner_proc_unlock() argument
320 __releases(&proc->inner_lock) in _binder_inner_proc_unlock()
324 spin_unlock(&proc->inner_lock); in _binder_inner_proc_unlock()
369 __acquires(&node->lock) __acquires(&node->proc->inner_lock) in _binder_node_inner_lock()
374 if (node->proc) in _binder_node_inner_lock()
375 binder_inner_proc_lock(node->proc); in _binder_node_inner_lock()
378 __acquire(&node->proc->inner_lock); in _binder_node_inner_lock()
390 __releases(&node->lock) __releases(&node->proc->inner_lock) in _binder_node_inner_unlock()
392 struct binder_proc *proc = node->proc; in _binder_node_inner_unlock() local
396 if (proc) in _binder_node_inner_unlock()
397 binder_inner_proc_unlock(proc); in _binder_node_inner_unlock()
400 __release(&node->proc->inner_lock); in _binder_node_inner_unlock()
416 static bool binder_worklist_empty(struct binder_proc *proc, in binder_worklist_empty() argument
421 binder_inner_proc_lock(proc); in binder_worklist_empty()
423 binder_inner_proc_unlock(proc); in binder_worklist_empty()
496 binder_inner_proc_lock(thread->proc); in binder_enqueue_thread_work()
498 binder_inner_proc_unlock(thread->proc); in binder_enqueue_thread_work()
516 binder_dequeue_work(struct binder_proc *proc, struct binder_work *work) in binder_dequeue_work() argument
518 binder_inner_proc_lock(proc); in binder_dequeue_work()
520 binder_inner_proc_unlock(proc); in binder_dequeue_work()
535 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
537 static void binder_free_proc(struct binder_proc *proc);
546 !binder_worklist_empty_ilocked(&thread->proc->todo)); in binder_has_work_ilocked()
553 binder_inner_proc_lock(thread->proc); in binder_has_work()
555 binder_inner_proc_unlock(thread->proc); in binder_has_work()
568 static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc, in binder_wakeup_poll_threads_ilocked() argument
574 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_wakeup_poll_threads_ilocked()
599 binder_select_thread_ilocked(struct binder_proc *proc) in binder_select_thread_ilocked() argument
603 assert_spin_locked(&proc->inner_lock); in binder_select_thread_ilocked()
604 thread = list_first_entry_or_null(&proc->waiting_threads, in binder_select_thread_ilocked()
630 static void binder_wakeup_thread_ilocked(struct binder_proc *proc, in binder_wakeup_thread_ilocked() argument
634 assert_spin_locked(&proc->inner_lock); in binder_wakeup_thread_ilocked()
657 binder_wakeup_poll_threads_ilocked(proc, sync); in binder_wakeup_thread_ilocked()
660 static void binder_wakeup_proc_ilocked(struct binder_proc *proc) in binder_wakeup_proc_ilocked() argument
662 struct binder_thread *thread = binder_select_thread_ilocked(proc); in binder_wakeup_proc_ilocked()
664 binder_wakeup_thread_ilocked(proc, thread, /* sync = */false); in binder_wakeup_proc_ilocked()
685 static struct binder_node *binder_get_node_ilocked(struct binder_proc *proc, in binder_get_node_ilocked() argument
688 struct rb_node *n = proc->nodes.rb_node; in binder_get_node_ilocked()
691 assert_spin_locked(&proc->inner_lock); in binder_get_node_ilocked()
713 static struct binder_node *binder_get_node(struct binder_proc *proc, in binder_get_node() argument
718 binder_inner_proc_lock(proc); in binder_get_node()
719 node = binder_get_node_ilocked(proc, ptr); in binder_get_node()
720 binder_inner_proc_unlock(proc); in binder_get_node()
725 struct binder_proc *proc, in binder_init_node_ilocked() argument
729 struct rb_node **p = &proc->nodes.rb_node; in binder_init_node_ilocked()
736 assert_spin_locked(&proc->inner_lock); in binder_init_node_ilocked()
761 rb_insert_color(&node->rb_node, &proc->nodes); in binder_init_node_ilocked()
763 node->proc = proc; in binder_init_node_ilocked()
775 proc->pid, current->pid, node->debug_id, in binder_init_node_ilocked()
781 static struct binder_node *binder_new_node(struct binder_proc *proc, in binder_new_node() argument
789 binder_inner_proc_lock(proc); in binder_new_node()
790 node = binder_init_node_ilocked(proc, new_node, fp); in binder_new_node()
791 binder_inner_proc_unlock(proc); in binder_new_node()
811 struct binder_proc *proc = node->proc; in binder_inc_node_nilocked() local
814 if (proc) in binder_inc_node_nilocked()
815 assert_spin_locked(&proc->inner_lock); in binder_inc_node_nilocked()
820 !(node->proc && in binder_inc_node_nilocked()
821 node == node->proc->context->binder_context_mgr_node && in binder_inc_node_nilocked()
871 struct binder_proc *proc = node->proc; in binder_dec_node_nilocked() local
874 if (proc) in binder_dec_node_nilocked()
875 assert_spin_locked(&proc->inner_lock); in binder_dec_node_nilocked()
891 if (proc && (node->has_strong_ref || node->has_weak_ref)) { in binder_dec_node_nilocked()
893 binder_enqueue_work_ilocked(&node->work, &proc->todo); in binder_dec_node_nilocked()
894 binder_wakeup_proc_ilocked(proc); in binder_dec_node_nilocked()
899 if (proc) { in binder_dec_node_nilocked()
901 rb_erase(&node->rb_node, &proc->nodes); in binder_dec_node_nilocked()
965 if (node->proc) in binder_inc_node_tmpref()
966 binder_inner_proc_lock(node->proc); in binder_inc_node_tmpref()
970 if (node->proc) in binder_inc_node_tmpref()
971 binder_inner_proc_unlock(node->proc); in binder_inc_node_tmpref()
988 if (!node->proc) in binder_dec_node_tmpref()
994 if (!node->proc) in binder_dec_node_tmpref()
1015 static struct binder_ref *binder_get_ref_olocked(struct binder_proc *proc, in binder_get_ref_olocked() argument
1018 struct rb_node *n = proc->refs_by_desc.rb_node; in binder_get_ref_olocked()
1057 struct binder_proc *proc, in binder_get_ref_for_node_olocked() argument
1061 struct binder_context *context = proc->context; in binder_get_ref_for_node_olocked()
1062 struct rb_node **p = &proc->refs_by_node.rb_node; in binder_get_ref_for_node_olocked()
1083 new_ref->proc = proc; in binder_get_ref_for_node_olocked()
1086 rb_insert_color(&new_ref->rb_node_node, &proc->refs_by_node); in binder_get_ref_for_node_olocked()
1089 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in binder_get_ref_for_node_olocked()
1096 p = &proc->refs_by_desc.rb_node; in binder_get_ref_for_node_olocked()
1109 rb_insert_color(&new_ref->rb_node_desc, &proc->refs_by_desc); in binder_get_ref_for_node_olocked()
1116 proc->pid, new_ref->data.debug_id, new_ref->data.desc, in binder_get_ref_for_node_olocked()
1128 ref->proc->pid, ref->data.debug_id, ref->data.desc, in binder_cleanup_ref_olocked()
1131 rb_erase(&ref->rb_node_desc, &ref->proc->refs_by_desc); in binder_cleanup_ref_olocked()
1132 rb_erase(&ref->rb_node_node, &ref->proc->refs_by_node); in binder_cleanup_ref_olocked()
1156 ref->proc->pid, ref->data.debug_id, in binder_cleanup_ref_olocked()
1158 binder_dequeue_work(ref->proc, &ref->death->work); in binder_cleanup_ref_olocked()
1211 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1222 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1248 struct binder_proc *proc, in binder_get_node_from_ref() argument
1255 binder_proc_lock(proc); in binder_get_node_from_ref()
1256 ref = binder_get_ref_olocked(proc, desc, need_strong_ref); in binder_get_node_from_ref()
1267 binder_proc_unlock(proc); in binder_get_node_from_ref()
1272 binder_proc_unlock(proc); in binder_get_node_from_ref()
1304 static int binder_update_ref_for_handle(struct binder_proc *proc, in binder_update_ref_for_handle() argument
1312 binder_proc_lock(proc); in binder_update_ref_for_handle()
1313 ref = binder_get_ref_olocked(proc, desc, strong); in binder_update_ref_for_handle()
1325 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1332 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1347 static int binder_dec_ref_for_handle(struct binder_proc *proc, in binder_dec_ref_for_handle() argument
1350 return binder_update_ref_for_handle(proc, desc, false, strong, rdata); in binder_dec_ref_for_handle()
1367 static int binder_inc_ref_for_node(struct binder_proc *proc, in binder_inc_ref_for_node() argument
1377 binder_proc_lock(proc); in binder_inc_ref_for_node()
1378 ref = binder_get_ref_for_node_olocked(proc, node, NULL); in binder_inc_ref_for_node()
1380 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1384 binder_proc_lock(proc); in binder_inc_ref_for_node()
1385 ref = binder_get_ref_for_node_olocked(proc, node, new_ref); in binder_inc_ref_for_node()
1401 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1415 assert_spin_locked(&target_thread->proc->inner_lock); in binder_pop_transaction_ilocked()
1441 binder_inner_proc_lock(thread->proc); in binder_thread_dec_tmpref()
1444 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1448 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1463 static void binder_proc_dec_tmpref(struct binder_proc *proc) in binder_proc_dec_tmpref() argument
1465 binder_inner_proc_lock(proc); in binder_proc_dec_tmpref()
1466 proc->tmp_ref--; in binder_proc_dec_tmpref()
1467 if (proc->is_dead && RB_EMPTY_ROOT(&proc->threads) && in binder_proc_dec_tmpref()
1468 !proc->tmp_ref) { in binder_proc_dec_tmpref()
1469 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1470 binder_free_proc(proc); in binder_proc_dec_tmpref()
1473 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1512 __acquires(&t->from->proc->inner_lock) in binder_get_txn_from_and_acq_inner()
1518 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
1521 binder_inner_proc_lock(from->proc); in binder_get_txn_from_and_acq_inner()
1526 binder_inner_proc_unlock(from->proc); in binder_get_txn_from_and_acq_inner()
1527 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
1560 from_proc = t->from ? t->from->proc->pid : 0; in binder_txn_latency_free()
1609 target_thread->proc->pid, in binder_send_failed_reply()
1629 binder_inner_proc_unlock(target_thread->proc); in binder_send_failed_reply()
1634 __release(&target_thread->proc->inner_lock); in binder_send_failed_reply()
1690 static size_t binder_get_object(struct binder_proc *proc, in binder_get_object() argument
1707 if (binder_alloc_copy_from_buffer(&proc->alloc, object, buffer, in binder_get_object()
1763 struct binder_proc *proc, in binder_validate_ptr() argument
1779 if (binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_validate_ptr()
1783 object_size = binder_get_object(proc, NULL, b, object_offset, object); in binder_validate_ptr()
1831 static bool binder_validate_fixup(struct binder_proc *proc, in binder_validate_fixup() argument
1848 size_t object_size = binder_get_object(proc, NULL, b, in binder_validate_fixup()
1864 if (binder_alloc_copy_from_buffer(&proc->alloc, in binder_validate_fixup()
1935 static void binder_transaction_buffer_release(struct binder_proc *proc, in binder_transaction_buffer_release() argument
1946 proc->pid, buffer->debug_id, in binder_transaction_buffer_release()
1962 if (!binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_transaction_buffer_release()
1965 object_size = binder_get_object(proc, NULL, buffer, in binder_transaction_buffer_release()
1980 node = binder_get_node(proc, fp->binder); in binder_transaction_buffer_release()
2000 ret = binder_dec_ref_for_handle(proc, fp->handle, in binder_transaction_buffer_release()
2050 parent = binder_validate_ptr(proc, buffer, &ptr_object, in binder_transaction_buffer_release()
2091 &proc->alloc, &fd, buffer, in binder_transaction_buffer_release()
2115 static inline void binder_release_entire_buffer(struct binder_proc *proc, in binder_release_entire_buffer() argument
2125 binder_transaction_buffer_release(proc, thread, buffer, in binder_release_entire_buffer()
2134 struct binder_proc *proc = thread->proc; in binder_translate_binder() local
2139 node = binder_get_node(proc, fp->binder); in binder_translate_binder()
2141 node = binder_new_node(proc, fp); in binder_translate_binder()
2147 proc->pid, thread->pid, (u64)fp->binder, in binder_translate_binder()
2153 if (security_binder_transfer_binder(proc->cred, target_proc->cred)) { in binder_translate_binder()
2186 struct binder_proc *proc = thread->proc; in binder_translate_handle() local
2192 node = binder_get_node_from_ref(proc, fp->handle, in binder_translate_handle()
2196 proc->pid, thread->pid, fp->handle); in binder_translate_handle()
2199 if (security_binder_transfer_binder(proc->cred, target_proc->cred)) { in binder_translate_handle()
2205 if (node->proc == target_proc) { in binder_translate_handle()
2212 if (node->proc) in binder_translate_handle()
2213 binder_inner_proc_lock(node->proc); in binder_translate_handle()
2215 __acquire(&node->proc->inner_lock); in binder_translate_handle()
2219 if (node->proc) in binder_translate_handle()
2220 binder_inner_proc_unlock(node->proc); in binder_translate_handle()
2222 __release(&node->proc->inner_lock); in binder_translate_handle()
2260 struct binder_proc *proc = thread->proc; in binder_translate_fd() local
2273 proc->pid, thread->pid, in binder_translate_fd()
2283 proc->pid, thread->pid, fd); in binder_translate_fd()
2287 ret = security_binder_transfer_file(proc->cred, target_proc->cred, file); in binder_translate_fd()
2574 struct binder_proc *proc = thread->proc; in binder_translate_fd_array() local
2583 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2590 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2608 proc->pid, thread->pid); in binder_translate_fd_array()
2641 struct binder_proc *proc = thread->proc; in binder_fixup_parent() local
2655 proc->pid, thread->pid); in binder_fixup_parent()
2664 proc->pid, thread->pid); in binder_fixup_parent()
2672 proc->pid, thread->pid); in binder_fixup_parent()
2752 struct binder_proc *proc, in binder_proc_transaction() argument
2771 binder_inner_proc_lock(proc); in binder_proc_transaction()
2772 if (proc->is_frozen) { in binder_proc_transaction()
2774 proc->sync_recv |= !oneway; in binder_proc_transaction()
2775 proc->async_recv |= oneway; in binder_proc_transaction()
2778 if ((frozen && !oneway) || proc->is_dead || in binder_proc_transaction()
2780 binder_inner_proc_unlock(proc); in binder_proc_transaction()
2786 thread = binder_select_thread_ilocked(proc); in binder_proc_transaction()
2791 binder_enqueue_work_ilocked(&t->work, &proc->todo); in binder_proc_transaction()
2801 proc->outstanding_txns--; in binder_proc_transaction()
2808 binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */); in binder_proc_transaction()
2810 proc->outstanding_txns++; in binder_proc_transaction()
2811 binder_inner_proc_unlock(proc); in binder_proc_transaction()
2824 binder_release_entire_buffer(proc, NULL, buffer, false); in binder_proc_transaction()
2825 binder_alloc_free_buf(&proc->alloc, buffer); in binder_proc_transaction()
2865 if (node->proc) { in binder_get_node_refs_for_txn()
2869 node->proc->tmp_ref++; in binder_get_node_refs_for_txn()
2870 *procp = node->proc; in binder_get_node_refs_for_txn()
2885 __release(&from->proc->inner_lock); in binder_set_txn_from_error()
2892 binder_inner_proc_unlock(from->proc); in binder_set_txn_from_error()
2896 static void binder_transaction(struct binder_proc *proc, in binder_transaction() argument
2920 struct binder_context *context = proc->context; in binder_transaction()
2935 e->from_proc = proc->pid; in binder_transaction()
2940 strscpy(e->context_name, proc->context->name, BINDERFS_MAX_NAME); in binder_transaction()
2942 binder_inner_proc_lock(proc); in binder_transaction()
2944 binder_inner_proc_unlock(proc); in binder_transaction()
2947 binder_inner_proc_lock(proc); in binder_transaction()
2950 binder_inner_proc_unlock(proc); in binder_transaction()
2952 proc->pid, thread->pid); in binder_transaction()
2961 proc->pid, thread->pid, in_reply_to->debug_id, in binder_transaction()
2967 binder_inner_proc_unlock(proc); in binder_transaction()
2975 binder_inner_proc_unlock(proc); in binder_transaction()
2980 __release(&target_thread->proc->inner_lock); in binder_transaction()
2982 thread->pid, proc->pid); in binder_transaction()
2989 proc->pid, thread->pid, in binder_transaction()
2993 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
3001 target_proc = target_thread->proc; in binder_transaction()
3003 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
3015 binder_proc_lock(proc); in binder_transaction()
3016 ref = binder_get_ref_olocked(proc, tr->target.handle, in binder_transaction()
3024 proc->pid, thread->pid, tr->target.handle); in binder_transaction()
3027 binder_proc_unlock(proc); in binder_transaction()
3038 if (target_node && target_proc->pid == proc->pid) { in binder_transaction()
3040 proc->pid, thread->pid); in binder_transaction()
3049 thread->pid, proc->pid); in binder_transaction()
3058 if (WARN_ON(proc == target_proc)) { in binder_transaction()
3060 thread->pid, proc->pid); in binder_transaction()
3066 if (security_binder_transaction(proc->cred, in binder_transaction()
3069 thread->pid, proc->pid); in binder_transaction()
3075 binder_inner_proc_lock(proc); in binder_transaction()
3091 proc->pid, thread->pid); in binder_transaction()
3092 binder_inner_proc_unlock(proc); in binder_transaction()
3106 proc->pid, thread->pid, tmp->debug_id, in binder_transaction()
3111 binder_inner_proc_unlock(proc); in binder_transaction()
3122 if (from && from->proc == target_proc) { in binder_transaction()
3132 binder_inner_proc_unlock(proc); in binder_transaction()
3142 thread->pid, proc->pid); in binder_transaction()
3155 thread->pid, proc->pid); in binder_transaction()
3169 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3178 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3189 t->from_pid = proc->pid; in binder_transaction()
3191 t->sender_euid = task_euid(proc->tsk); in binder_transaction()
3202 security_cred_getsecid(proc->cred, &secid); in binder_transaction()
3206 thread->pid, proc->pid); in binder_transaction()
3216 thread->pid, proc->pid); in binder_transaction()
3278 proc->pid, thread->pid); in binder_transaction()
3286 proc->pid, thread->pid, (u64)tr->offsets_size); in binder_transaction()
3294 proc->pid, thread->pid, in binder_transaction()
3322 thread->pid, proc->pid); in binder_transaction()
3341 proc->pid, thread->pid); in binder_transaction()
3351 proc->pid, thread->pid, in binder_transaction()
3382 thread->pid, proc->pid); in binder_transaction()
3401 thread->pid, proc->pid); in binder_transaction()
3423 thread->pid, proc->pid); in binder_transaction()
3447 proc->pid, thread->pid); in binder_transaction()
3460 proc->pid, thread->pid); in binder_transaction()
3471 binder_get_object(proc, user_buffer, t->buffer, in binder_transaction()
3475 proc->pid, thread->pid, in binder_transaction()
3494 thread->pid, proc->pid); in binder_transaction()
3512 proc->pid, thread->pid); in binder_transaction()
3523 thread->pid, proc->pid); in binder_transaction()
3548 thread->pid, proc->pid); in binder_transaction()
3559 proc->pid, thread->pid, hdr->type); in binder_transaction()
3573 proc->pid, thread->pid); in binder_transaction()
3584 proc->pid, thread->pid); in binder_transaction()
3613 binder_inner_proc_lock(proc); in binder_transaction()
3625 binder_inner_proc_unlock(proc); in binder_transaction()
3629 binder_inner_proc_lock(proc); in binder_transaction()
3631 binder_inner_proc_unlock(proc); in binder_transaction()
3665 thread->pid, proc->pid); in binder_transaction()
3667 binder_dequeue_work(proc, tcomplete); in binder_transaction()
3708 proc->pid, thread->pid, reply ? "reply" : in binder_transaction()
3746 binder_inner_proc_lock(proc); in binder_transaction()
3749 binder_inner_proc_unlock(proc); in binder_transaction()
3767 binder_free_buf(struct binder_proc *proc, in binder_free_buf() argument
3771 binder_inner_proc_lock(proc); in binder_free_buf()
3776 binder_inner_proc_unlock(proc); in binder_free_buf()
3784 BUG_ON(buf_node->proc != proc); in binder_free_buf()
3791 w, &proc->todo); in binder_free_buf()
3792 binder_wakeup_proc_ilocked(proc); in binder_free_buf()
3797 binder_release_entire_buffer(proc, thread, buffer, is_failure); in binder_free_buf()
3798 binder_alloc_free_buf(&proc->alloc, buffer); in binder_free_buf()
3801 static int binder_thread_write(struct binder_proc *proc, in binder_thread_write() argument
3807 struct binder_context *context = proc->context; in binder_thread_write()
3821 atomic_inc(&proc->stats.bc[_IOC_NR(cmd)]); in binder_thread_write()
3846 if (ctx_mgr_node->proc == proc) { in binder_thread_write()
3848 proc->pid, thread->pid); in binder_thread_write()
3853 proc, ctx_mgr_node, in binder_thread_write()
3860 proc, target, increment, strong, in binder_thread_write()
3864 proc->pid, thread->pid, in binder_thread_write()
3884 proc->pid, thread->pid, debug_string, in binder_thread_write()
3890 proc->pid, thread->pid, debug_string, in binder_thread_write()
3908 node = binder_get_node(proc, node_ptr); in binder_thread_write()
3911 proc->pid, thread->pid, in binder_thread_write()
3920 proc->pid, thread->pid, in binder_thread_write()
3932 proc->pid, thread->pid, in binder_thread_write()
3942 proc->pid, thread->pid, in binder_thread_write()
3955 proc->pid, thread->pid, in binder_thread_write()
3978 buffer = binder_alloc_prepare_to_free(&proc->alloc, in binder_thread_write()
3984 proc->pid, thread->pid, in binder_thread_write()
3989 proc->pid, thread->pid, in binder_thread_write()
3996 proc->pid, thread->pid, (u64)data_ptr, in binder_thread_write()
3999 binder_free_buf(proc, thread, buffer, false); in binder_thread_write()
4010 binder_transaction(proc, thread, &tr.transaction_data, in binder_thread_write()
4021 binder_transaction(proc, thread, &tr, in binder_thread_write()
4029 proc->pid, thread->pid); in binder_thread_write()
4030 binder_inner_proc_lock(proc); in binder_thread_write()
4034 proc->pid, thread->pid); in binder_thread_write()
4035 } else if (proc->requested_threads == 0) { in binder_thread_write()
4038 proc->pid, thread->pid); in binder_thread_write()
4040 proc->requested_threads--; in binder_thread_write()
4041 proc->requested_threads_started++; in binder_thread_write()
4044 binder_inner_proc_unlock(proc); in binder_thread_write()
4049 proc->pid, thread->pid); in binder_thread_write()
4053 proc->pid, thread->pid); in binder_thread_write()
4060 proc->pid, thread->pid); in binder_thread_write()
4093 proc->pid, thread->pid); in binder_thread_write()
4097 binder_proc_lock(proc); in binder_thread_write()
4098 ref = binder_get_ref_olocked(proc, target, false); in binder_thread_write()
4101 proc->pid, thread->pid, in binder_thread_write()
4106 binder_proc_unlock(proc); in binder_thread_write()
4113 proc->pid, thread->pid, in binder_thread_write()
4125 proc->pid, thread->pid); in binder_thread_write()
4127 binder_proc_unlock(proc); in binder_thread_write()
4135 if (ref->node->proc == NULL) { in binder_thread_write()
4138 binder_inner_proc_lock(proc); in binder_thread_write()
4140 &ref->death->work, &proc->todo); in binder_thread_write()
4141 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
4142 binder_inner_proc_unlock(proc); in binder_thread_write()
4147 proc->pid, thread->pid); in binder_thread_write()
4149 binder_proc_unlock(proc); in binder_thread_write()
4155 proc->pid, thread->pid, in binder_thread_write()
4159 binder_proc_unlock(proc); in binder_thread_write()
4163 binder_inner_proc_lock(proc); in binder_thread_write()
4175 &proc->todo); in binder_thread_write()
4177 proc); in binder_thread_write()
4183 binder_inner_proc_unlock(proc); in binder_thread_write()
4186 binder_proc_unlock(proc); in binder_thread_write()
4197 binder_inner_proc_lock(proc); in binder_thread_write()
4198 list_for_each_entry(w, &proc->delivered_death, in binder_thread_write()
4212 proc->pid, thread->pid, (u64)cookie, in binder_thread_write()
4216 proc->pid, thread->pid, (u64)cookie); in binder_thread_write()
4217 binder_inner_proc_unlock(proc); in binder_thread_write()
4231 &proc->todo); in binder_thread_write()
4232 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
4235 binder_inner_proc_unlock(proc); in binder_thread_write()
4240 proc->pid, thread->pid, cmd); in binder_thread_write()
4248 static void binder_stat_br(struct binder_proc *proc, in binder_stat_br() argument
4254 atomic_inc(&proc->stats.br[_IOC_NR(cmd)]); in binder_stat_br()
4259 static int binder_put_node_cmd(struct binder_proc *proc, in binder_put_node_cmd() argument
4281 binder_stat_br(proc, thread, cmd); in binder_put_node_cmd()
4283 proc->pid, thread->pid, cmd_name, node_debug_id, in binder_put_node_cmd()
4294 struct binder_proc *proc = thread->proc; in binder_wait_for_work() local
4297 binder_inner_proc_lock(proc); in binder_wait_for_work()
4304 &proc->waiting_threads); in binder_wait_for_work()
4305 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4307 binder_inner_proc_lock(proc); in binder_wait_for_work()
4315 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4333 static int binder_apply_fd_fixups(struct binder_proc *proc, in binder_apply_fd_fixups() argument
4354 if (binder_alloc_copy_to_buffer(&proc->alloc, t->buffer, in binder_apply_fd_fixups()
4374 static int binder_thread_read(struct binder_proc *proc, in binder_thread_read() argument
4393 binder_inner_proc_lock(proc); in binder_thread_read()
4395 binder_inner_proc_unlock(proc); in binder_thread_read()
4401 !binder_worklist_empty(proc, &thread->todo)); in binder_thread_read()
4406 proc->pid, thread->pid, thread->looper); in binder_thread_read()
4410 binder_set_nice(proc->default_priority); in binder_thread_read()
4435 binder_inner_proc_lock(proc); in binder_thread_read()
4438 else if (!binder_worklist_empty_ilocked(&proc->todo) && in binder_thread_read()
4440 list = &proc->todo; in binder_thread_read()
4442 binder_inner_proc_unlock(proc); in binder_thread_read()
4451 binder_inner_proc_unlock(proc); in binder_thread_read()
4460 binder_inner_proc_unlock(proc); in binder_thread_read()
4468 binder_inner_proc_unlock(proc); in binder_thread_read()
4475 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4480 if (proc->oneway_spam_detection_enabled && in binder_thread_read()
4487 binder_inner_proc_unlock(proc); in binder_thread_read()
4494 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4497 proc->pid, thread->pid); in binder_thread_read()
4509 BUG_ON(proc != node->proc); in binder_thread_read()
4535 proc->pid, thread->pid, in binder_thread_read()
4539 rb_erase(&node->rb_node, &proc->nodes); in binder_thread_read()
4540 binder_inner_proc_unlock(proc); in binder_thread_read()
4554 binder_inner_proc_unlock(proc); in binder_thread_read()
4558 proc, thread, &ptr, node_ptr, in binder_thread_read()
4563 proc, thread, &ptr, node_ptr, in binder_thread_read()
4568 proc, thread, &ptr, node_ptr, in binder_thread_read()
4573 proc, thread, &ptr, node_ptr, in binder_thread_read()
4579 proc->pid, thread->pid, in binder_thread_read()
4602 proc->pid, thread->pid, in binder_thread_read()
4608 binder_inner_proc_unlock(proc); in binder_thread_read()
4613 w, &proc->delivered_death); in binder_thread_read()
4614 binder_inner_proc_unlock(proc); in binder_thread_read()
4623 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4628 binder_inner_proc_unlock(proc); in binder_thread_read()
4630 proc->pid, thread->pid, w->type); in binder_thread_read()
4662 struct task_struct *sender = t_from->proc->tsk; in binder_thread_read()
4671 ret = binder_apply_fd_fixups(proc, t); in binder_thread_read()
4682 binder_free_buf(proc, thread, buffer, true); in binder_thread_read()
4685 proc->pid, thread->pid, in binder_thread_read()
4694 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4733 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4736 proc->pid, thread->pid, in binder_thread_read()
4740 t->debug_id, t_from ? t_from->proc->pid : 0, in binder_thread_read()
4750 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4754 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4764 binder_inner_proc_lock(proc); in binder_thread_read()
4765 if (proc->requested_threads == 0 && in binder_thread_read()
4766 list_empty(&thread->proc->waiting_threads) && in binder_thread_read()
4767 proc->requested_threads_started < proc->max_threads && in binder_thread_read()
4771 proc->requested_threads++; in binder_thread_read()
4772 binder_inner_proc_unlock(proc); in binder_thread_read()
4775 proc->pid, thread->pid); in binder_thread_read()
4778 binder_stat_br(proc, thread, BR_SPAWN_LOOPER); in binder_thread_read()
4780 binder_inner_proc_unlock(proc); in binder_thread_read()
4784 static void binder_release_work(struct binder_proc *proc, in binder_release_work() argument
4791 binder_inner_proc_lock(proc); in binder_release_work()
4794 binder_inner_proc_unlock(proc); in binder_release_work()
4846 struct binder_proc *proc, struct binder_thread *new_thread) in binder_get_thread_ilocked() argument
4850 struct rb_node **p = &proc->threads.rb_node; in binder_get_thread_ilocked()
4867 thread->proc = proc; in binder_get_thread_ilocked()
4873 rb_insert_color(&thread->rb_node, &proc->threads); in binder_get_thread_ilocked()
4884 static struct binder_thread *binder_get_thread(struct binder_proc *proc) in binder_get_thread() argument
4889 binder_inner_proc_lock(proc); in binder_get_thread()
4890 thread = binder_get_thread_ilocked(proc, NULL); in binder_get_thread()
4891 binder_inner_proc_unlock(proc); in binder_get_thread()
4896 binder_inner_proc_lock(proc); in binder_get_thread()
4897 thread = binder_get_thread_ilocked(proc, new_thread); in binder_get_thread()
4898 binder_inner_proc_unlock(proc); in binder_get_thread()
4905 static void binder_free_proc(struct binder_proc *proc) in binder_free_proc() argument
4909 BUG_ON(!list_empty(&proc->todo)); in binder_free_proc()
4910 BUG_ON(!list_empty(&proc->delivered_death)); in binder_free_proc()
4911 if (proc->outstanding_txns) in binder_free_proc()
4913 __func__, proc->outstanding_txns); in binder_free_proc()
4914 device = container_of(proc->context, struct binder_device, context); in binder_free_proc()
4916 kfree(proc->context->name); in binder_free_proc()
4919 binder_alloc_deferred_release(&proc->alloc); in binder_free_proc()
4920 put_task_struct(proc->tsk); in binder_free_proc()
4921 put_cred(proc->cred); in binder_free_proc()
4923 kfree(proc); in binder_free_proc()
4930 binder_proc_dec_tmpref(thread->proc); in binder_free_thread()
4934 static int binder_thread_release(struct binder_proc *proc, in binder_thread_release() argument
4942 binder_inner_proc_lock(thread->proc); in binder_thread_release()
4949 proc->tmp_ref++; in binder_thread_release()
4955 rb_erase(&thread->rb_node, &proc->threads); in binder_thread_release()
4971 proc->pid, thread->pid, in binder_thread_release()
4976 thread->proc->outstanding_txns--; in binder_thread_release()
5005 binder_inner_proc_unlock(thread->proc); in binder_thread_release()
5019 binder_release_work(proc, &thread->todo); in binder_thread_release()
5027 struct binder_proc *proc = filp->private_data; in binder_poll() local
5031 thread = binder_get_thread(proc); in binder_poll()
5035 binder_inner_proc_lock(thread->proc); in binder_poll()
5039 binder_inner_proc_unlock(thread->proc); in binder_poll()
5053 struct binder_proc *proc = filp->private_data; in binder_ioctl_write_read() local
5063 proc->pid, thread->pid, in binder_ioctl_write_read()
5068 ret = binder_thread_write(proc, thread, in binder_ioctl_write_read()
5081 ret = binder_thread_read(proc, thread, bwr.read_buffer, in binder_ioctl_write_read()
5086 binder_inner_proc_lock(proc); in binder_ioctl_write_read()
5087 if (!binder_worklist_empty_ilocked(&proc->todo)) in binder_ioctl_write_read()
5088 binder_wakeup_proc_ilocked(proc); in binder_ioctl_write_read()
5089 binder_inner_proc_unlock(proc); in binder_ioctl_write_read()
5098 proc->pid, thread->pid, in binder_ioctl_write_read()
5113 struct binder_proc *proc = filp->private_data; in binder_ioctl_set_ctx_mgr() local
5114 struct binder_context *context = proc->context; in binder_ioctl_set_ctx_mgr()
5124 ret = security_binder_set_context_mgr(proc->cred); in binder_ioctl_set_ctx_mgr()
5139 new_node = binder_new_node(proc, fbo); in binder_ioctl_set_ctx_mgr()
5157 static int binder_ioctl_get_node_info_for_ref(struct binder_proc *proc, in binder_ioctl_get_node_info_for_ref() argument
5161 struct binder_context *context = proc->context; in binder_ioctl_get_node_info_for_ref()
5167 proc->pid); in binder_ioctl_get_node_info_for_ref()
5174 context->binder_context_mgr_node->proc != proc) { in binder_ioctl_get_node_info_for_ref()
5180 node = binder_get_node_from_ref(proc, handle, true, NULL); in binder_ioctl_get_node_info_for_ref()
5193 static int binder_ioctl_get_node_debug_info(struct binder_proc *proc, in binder_ioctl_get_node_debug_info() argument
5201 binder_inner_proc_lock(proc); in binder_ioctl_get_node_debug_info()
5202 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in binder_ioctl_get_node_debug_info()
5213 binder_inner_proc_unlock(proc); in binder_ioctl_get_node_debug_info()
5218 static bool binder_txns_pending_ilocked(struct binder_proc *proc) in binder_txns_pending_ilocked() argument
5223 if (proc->outstanding_txns > 0) in binder_txns_pending_ilocked()
5226 for (n = rb_first(&proc->threads); n; n = rb_next(n)) { in binder_txns_pending_ilocked()
5317 binder_inner_proc_lock(thread->proc); in binder_ioctl_get_extended_error()
5320 binder_inner_proc_unlock(thread->proc); in binder_ioctl_get_extended_error()
5331 struct binder_proc *proc = filp->private_data; in binder_ioctl() local
5338 binder_selftest_alloc(&proc->alloc); in binder_ioctl()
5346 thread = binder_get_thread(proc); in binder_ioctl()
5366 binder_inner_proc_lock(proc); in binder_ioctl()
5367 proc->max_threads = max_threads; in binder_ioctl()
5368 binder_inner_proc_unlock(proc); in binder_ioctl()
5390 proc->pid, thread->pid); in binder_ioctl()
5391 binder_thread_release(proc, thread); in binder_ioctl()
5412 ret = binder_ioctl_get_node_info_for_ref(proc, &info); in binder_ioctl()
5431 ret = binder_ioctl_get_node_debug_info(proc, &info); in binder_ioctl()
5526 binder_inner_proc_lock(proc); in binder_ioctl()
5527 proc->oneway_spam_detection_enabled = (bool)enable; in binder_ioctl()
5528 binder_inner_proc_unlock(proc); in binder_ioctl()
5546 pr_info("%d:%d ioctl %x %lx returned %d\n", proc->pid, current->pid, cmd, arg, ret); in binder_ioctl()
5554 struct binder_proc *proc = vma->vm_private_data; in binder_vma_open() local
5558 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_open()
5565 struct binder_proc *proc = vma->vm_private_data; in binder_vma_close() local
5569 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_close()
5572 binder_alloc_vma_close(&proc->alloc); in binder_vma_close()
5588 struct binder_proc *proc = filp->private_data; in binder_mmap() local
5590 if (proc->tsk != current->group_leader) in binder_mmap()
5595 __func__, proc->pid, vma->vm_start, vma->vm_end, in binder_mmap()
5601 proc->pid, vma->vm_start, vma->vm_end, "bad vm_flags", -EPERM); in binder_mmap()
5607 vma->vm_private_data = proc; in binder_mmap()
5609 return binder_alloc_mmap_handler(&proc->alloc, vma); in binder_mmap()
5614 struct binder_proc *proc, *itr; in binder_open() local
5623 proc = kzalloc(sizeof(*proc), GFP_KERNEL); in binder_open()
5624 if (proc == NULL) in binder_open()
5626 spin_lock_init(&proc->inner_lock); in binder_open()
5627 spin_lock_init(&proc->outer_lock); in binder_open()
5629 proc->tsk = current->group_leader; in binder_open()
5630 proc->cred = get_cred(filp->f_cred); in binder_open()
5631 INIT_LIST_HEAD(&proc->todo); in binder_open()
5632 init_waitqueue_head(&proc->freeze_wait); in binder_open()
5633 proc->default_priority = task_nice(current); in binder_open()
5644 proc->context = &binder_dev->context; in binder_open()
5645 binder_alloc_init(&proc->alloc); in binder_open()
5648 proc->pid = current->group_leader->pid; in binder_open()
5649 INIT_LIST_HEAD(&proc->delivered_death); in binder_open()
5650 INIT_LIST_HEAD(&proc->waiting_threads); in binder_open()
5651 filp->private_data = proc; in binder_open()
5655 if (itr->pid == proc->pid) { in binder_open()
5660 hlist_add_head(&proc->proc_node, &binder_procs); in binder_open()
5666 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5673 proc->debugfs_entry = debugfs_create_file(strbuf, 0444, in binder_open()
5675 (void *)(unsigned long)proc->pid, in binder_open()
5683 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5691 strbuf, &proc_fops, (void *)(unsigned long)proc->pid); in binder_open()
5693 proc->binderfs_entry = binderfs_entry; in binder_open()
5708 struct binder_proc *proc = filp->private_data; in binder_flush() local
5710 binder_defer_work(proc, BINDER_DEFERRED_FLUSH); in binder_flush()
5715 static void binder_deferred_flush(struct binder_proc *proc) in binder_deferred_flush() argument
5720 binder_inner_proc_lock(proc); in binder_deferred_flush()
5721 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_deferred_flush()
5730 binder_inner_proc_unlock(proc); in binder_deferred_flush()
5733 "binder_flush: %d woke %d threads\n", proc->pid, in binder_deferred_flush()
5739 struct binder_proc *proc = filp->private_data; in binder_release() local
5741 debugfs_remove(proc->debugfs_entry); in binder_release()
5743 if (proc->binderfs_entry) { in binder_release()
5744 binderfs_remove_file(proc->binderfs_entry); in binder_release()
5745 proc->binderfs_entry = NULL; in binder_release()
5748 binder_defer_work(proc, BINDER_DEFERRED_RELEASE); in binder_release()
5757 struct binder_proc *proc = node->proc; in binder_node_release() local
5759 binder_release_work(proc, &node->async_todo); in binder_node_release()
5762 binder_inner_proc_lock(proc); in binder_node_release()
5769 binder_inner_proc_unlock(proc); in binder_node_release()
5776 node->proc = NULL; in binder_node_release()
5779 binder_inner_proc_unlock(proc); in binder_node_release()
5793 binder_inner_proc_lock(ref->proc); in binder_node_release()
5795 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5804 &ref->proc->todo); in binder_node_release()
5805 binder_wakeup_proc_ilocked(ref->proc); in binder_node_release()
5806 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5818 static void binder_deferred_release(struct binder_proc *proc) in binder_deferred_release() argument
5820 struct binder_context *context = proc->context; in binder_deferred_release()
5825 hlist_del(&proc->proc_node); in binder_deferred_release()
5830 context->binder_context_mgr_node->proc == proc) { in binder_deferred_release()
5833 __func__, proc->pid); in binder_deferred_release()
5837 binder_inner_proc_lock(proc); in binder_deferred_release()
5842 proc->tmp_ref++; in binder_deferred_release()
5844 proc->is_dead = true; in binder_deferred_release()
5845 proc->is_frozen = false; in binder_deferred_release()
5846 proc->sync_recv = false; in binder_deferred_release()
5847 proc->async_recv = false; in binder_deferred_release()
5850 while ((n = rb_first(&proc->threads))) { in binder_deferred_release()
5854 binder_inner_proc_unlock(proc); in binder_deferred_release()
5856 active_transactions += binder_thread_release(proc, thread); in binder_deferred_release()
5857 binder_inner_proc_lock(proc); in binder_deferred_release()
5862 while ((n = rb_first(&proc->nodes))) { in binder_deferred_release()
5873 rb_erase(&node->rb_node, &proc->nodes); in binder_deferred_release()
5874 binder_inner_proc_unlock(proc); in binder_deferred_release()
5876 binder_inner_proc_lock(proc); in binder_deferred_release()
5878 binder_inner_proc_unlock(proc); in binder_deferred_release()
5881 binder_proc_lock(proc); in binder_deferred_release()
5882 while ((n = rb_first(&proc->refs_by_desc))) { in binder_deferred_release()
5888 binder_proc_unlock(proc); in binder_deferred_release()
5890 binder_proc_lock(proc); in binder_deferred_release()
5892 binder_proc_unlock(proc); in binder_deferred_release()
5894 binder_release_work(proc, &proc->todo); in binder_deferred_release()
5895 binder_release_work(proc, &proc->delivered_death); in binder_deferred_release()
5899 __func__, proc->pid, threads, nodes, incoming_refs, in binder_deferred_release()
5902 binder_proc_dec_tmpref(proc); in binder_deferred_release()
5907 struct binder_proc *proc; in binder_deferred_func() local
5914 proc = hlist_entry(binder_deferred_list.first, in binder_deferred_func()
5916 hlist_del_init(&proc->deferred_work_node); in binder_deferred_func()
5917 defer = proc->deferred_work; in binder_deferred_func()
5918 proc->deferred_work = 0; in binder_deferred_func()
5920 proc = NULL; in binder_deferred_func()
5926 binder_deferred_flush(proc); in binder_deferred_func()
5929 binder_deferred_release(proc); /* frees proc */ in binder_deferred_func()
5930 } while (proc); in binder_deferred_func()
5935 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer) in binder_defer_work() argument
5938 proc->deferred_work |= defer; in binder_defer_work()
5939 if (hlist_unhashed(&proc->deferred_work_node)) { in binder_defer_work()
5940 hlist_add_head(&proc->deferred_work_node, in binder_defer_work()
5948 struct binder_proc *proc, in print_binder_transaction_ilocked() argument
5969 if (proc != to_proc) { in print_binder_transaction_ilocked()
5990 struct binder_proc *proc, in print_binder_work_ilocked() argument
6002 m, proc, transaction_prefix, t); in print_binder_work_ilocked()
6052 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6056 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6060 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6066 print_binder_work_ilocked(m, thread->proc, " ", in print_binder_thread_ilocked()
6092 seq_printf(m, " %d", ref->proc->pid); in print_binder_node_nilocked()
6095 if (node->proc) { in print_binder_node_nilocked()
6097 print_binder_work_ilocked(m, node->proc, " ", in print_binder_node_nilocked()
6108 ref->node->proc ? "" : "dead ", in print_binder_ref_olocked()
6115 struct binder_proc *proc, int print_all) in print_binder_proc() argument
6123 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc()
6124 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc()
6127 binder_inner_proc_lock(proc); in print_binder_proc()
6128 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc()
6132 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in print_binder_proc()
6145 binder_inner_proc_unlock(proc); in print_binder_proc()
6152 binder_inner_proc_lock(proc); in print_binder_proc()
6154 binder_inner_proc_unlock(proc); in print_binder_proc()
6159 binder_proc_lock(proc); in print_binder_proc()
6160 for (n = rb_first(&proc->refs_by_desc); in print_binder_proc()
6166 binder_proc_unlock(proc); in print_binder_proc()
6168 binder_alloc_print_allocated(m, &proc->alloc); in print_binder_proc()
6169 binder_inner_proc_lock(proc); in print_binder_proc()
6170 list_for_each_entry(w, &proc->todo, entry) in print_binder_proc()
6171 print_binder_work_ilocked(m, proc, " ", in print_binder_proc()
6173 list_for_each_entry(w, &proc->delivered_death, entry) { in print_binder_proc()
6177 binder_inner_proc_unlock(proc); in print_binder_proc()
6281 struct binder_proc *proc) in print_binder_proc_stats() argument
6288 binder_alloc_get_free_async_space(&proc->alloc); in print_binder_proc_stats()
6290 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc_stats()
6291 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc_stats()
6294 binder_inner_proc_lock(proc); in print_binder_proc_stats()
6295 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
6298 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_stats()
6304 " free async space %zd\n", proc->requested_threads, in print_binder_proc_stats()
6305 proc->requested_threads_started, proc->max_threads, in print_binder_proc_stats()
6309 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
6311 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
6316 binder_proc_lock(proc); in print_binder_proc_stats()
6317 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in print_binder_proc_stats()
6324 binder_proc_unlock(proc); in print_binder_proc_stats()
6327 count = binder_alloc_get_allocated_count(&proc->alloc); in print_binder_proc_stats()
6330 binder_alloc_print_pages(m, &proc->alloc); in print_binder_proc_stats()
6333 binder_inner_proc_lock(proc); in print_binder_proc_stats()
6334 list_for_each_entry(w, &proc->todo, entry) { in print_binder_proc_stats()
6338 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
6341 print_binder_stats(m, " ", &proc->stats); in print_binder_proc_stats()
6346 struct binder_proc *proc; in state_show() local
6376 hlist_for_each_entry(proc, &binder_procs, proc_node) in state_show()
6377 print_binder_proc(m, proc, 1); in state_show()
6385 struct binder_proc *proc; in stats_show() local
6392 hlist_for_each_entry(proc, &binder_procs, proc_node) in stats_show()
6393 print_binder_proc_stats(m, proc); in stats_show()
6401 struct binder_proc *proc; in transactions_show() local
6405 hlist_for_each_entry(proc, &binder_procs, proc_node) in transactions_show()
6406 print_binder_proc(m, proc, 0); in transactions_show()