Lines Matching refs:proc
98 DEFINE_SHOW_ATTRIBUTE(proc);
336 struct binder_proc *proc; member
421 struct binder_proc *proc; member
564 struct binder_proc *proc; member
668 #define binder_proc_lock(proc) _binder_proc_lock(proc, __LINE__) argument
670 _binder_proc_lock(struct binder_proc *proc, int line) in _binder_proc_lock() argument
671 __acquires(&proc->outer_lock) in _binder_proc_lock()
675 spin_lock(&proc->outer_lock); in _binder_proc_lock()
686 _binder_proc_unlock(struct binder_proc *proc, int line) in _binder_proc_unlock() argument
687 __releases(&proc->outer_lock) in _binder_proc_unlock()
691 spin_unlock(&proc->outer_lock); in _binder_proc_unlock()
700 #define binder_inner_proc_lock(proc) _binder_inner_proc_lock(proc, __LINE__) argument
702 _binder_inner_proc_lock(struct binder_proc *proc, int line) in _binder_inner_proc_lock() argument
703 __acquires(&proc->inner_lock) in _binder_inner_proc_lock()
707 spin_lock(&proc->inner_lock); in _binder_inner_proc_lock()
716 #define binder_inner_proc_unlock(proc) _binder_inner_proc_unlock(proc, __LINE__) argument
718 _binder_inner_proc_unlock(struct binder_proc *proc, int line) in _binder_inner_proc_unlock() argument
719 __releases(&proc->inner_lock) in _binder_inner_proc_unlock()
723 spin_unlock(&proc->inner_lock); in _binder_inner_proc_unlock()
768 __acquires(&node->lock) __acquires(&node->proc->inner_lock) in _binder_node_inner_lock()
773 if (node->proc) in _binder_node_inner_lock()
774 binder_inner_proc_lock(node->proc); in _binder_node_inner_lock()
777 __acquire(&node->proc->inner_lock); in _binder_node_inner_lock()
789 __releases(&node->lock) __releases(&node->proc->inner_lock) in _binder_node_inner_unlock()
791 struct binder_proc *proc = node->proc; in _binder_node_inner_unlock() local
795 if (proc) in _binder_node_inner_unlock()
796 binder_inner_proc_unlock(proc); in _binder_node_inner_unlock()
799 __release(&node->proc->inner_lock); in _binder_node_inner_unlock()
815 static bool binder_worklist_empty(struct binder_proc *proc, in binder_worklist_empty() argument
820 binder_inner_proc_lock(proc); in binder_worklist_empty()
822 binder_inner_proc_unlock(proc); in binder_worklist_empty()
905 binder_inner_proc_lock(thread->proc); in binder_enqueue_thread_work()
907 binder_inner_proc_unlock(thread->proc); in binder_enqueue_thread_work()
925 binder_dequeue_work(struct binder_proc *proc, struct binder_work *work) in binder_dequeue_work() argument
927 binder_inner_proc_lock(proc); in binder_dequeue_work()
929 binder_inner_proc_unlock(proc); in binder_dequeue_work()
944 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
946 static void binder_free_proc(struct binder_proc *proc);
965 !binder_worklist_empty_ilocked(&thread->proc->todo)); in binder_has_work_ilocked()
972 binder_inner_proc_lock(thread->proc); in binder_has_work()
974 binder_inner_proc_unlock(thread->proc); in binder_has_work()
987 static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc, in binder_wakeup_poll_threads_ilocked() argument
993 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_wakeup_poll_threads_ilocked()
1018 binder_select_thread_ilocked(struct binder_proc *proc) in binder_select_thread_ilocked() argument
1022 assert_spin_locked(&proc->inner_lock); in binder_select_thread_ilocked()
1023 thread = list_first_entry_or_null(&proc->waiting_threads, in binder_select_thread_ilocked()
1049 static void binder_wakeup_thread_ilocked(struct binder_proc *proc, in binder_wakeup_thread_ilocked() argument
1053 assert_spin_locked(&proc->inner_lock); in binder_wakeup_thread_ilocked()
1076 binder_wakeup_poll_threads_ilocked(proc, sync); in binder_wakeup_thread_ilocked()
1079 static void binder_wakeup_proc_ilocked(struct binder_proc *proc) in binder_wakeup_proc_ilocked() argument
1081 struct binder_thread *thread = binder_select_thread_ilocked(proc); in binder_wakeup_proc_ilocked()
1083 binder_wakeup_thread_ilocked(proc, thread, /* sync = */false); in binder_wakeup_proc_ilocked()
1104 static struct binder_node *binder_get_node_ilocked(struct binder_proc *proc, in binder_get_node_ilocked() argument
1107 struct rb_node *n = proc->nodes.rb_node; in binder_get_node_ilocked()
1110 assert_spin_locked(&proc->inner_lock); in binder_get_node_ilocked()
1132 static struct binder_node *binder_get_node(struct binder_proc *proc, in binder_get_node() argument
1137 binder_inner_proc_lock(proc); in binder_get_node()
1138 node = binder_get_node_ilocked(proc, ptr); in binder_get_node()
1139 binder_inner_proc_unlock(proc); in binder_get_node()
1144 struct binder_proc *proc, in binder_init_node_ilocked() argument
1148 struct rb_node **p = &proc->nodes.rb_node; in binder_init_node_ilocked()
1155 assert_spin_locked(&proc->inner_lock); in binder_init_node_ilocked()
1180 rb_insert_color(&node->rb_node, &proc->nodes); in binder_init_node_ilocked()
1182 node->proc = proc; in binder_init_node_ilocked()
1194 proc->pid, current->pid, node->debug_id, in binder_init_node_ilocked()
1200 static struct binder_node *binder_new_node(struct binder_proc *proc, in binder_new_node() argument
1208 binder_inner_proc_lock(proc); in binder_new_node()
1209 node = binder_init_node_ilocked(proc, new_node, fp); in binder_new_node()
1210 binder_inner_proc_unlock(proc); in binder_new_node()
1230 struct binder_proc *proc = node->proc; in binder_inc_node_nilocked() local
1233 if (proc) in binder_inc_node_nilocked()
1234 assert_spin_locked(&proc->inner_lock); in binder_inc_node_nilocked()
1239 !(node->proc && in binder_inc_node_nilocked()
1240 node == node->proc->context->binder_context_mgr_node && in binder_inc_node_nilocked()
1290 struct binder_proc *proc = node->proc; in binder_dec_node_nilocked() local
1293 if (proc) in binder_dec_node_nilocked()
1294 assert_spin_locked(&proc->inner_lock); in binder_dec_node_nilocked()
1310 if (proc && (node->has_strong_ref || node->has_weak_ref)) { in binder_dec_node_nilocked()
1312 binder_enqueue_work_ilocked(&node->work, &proc->todo); in binder_dec_node_nilocked()
1313 binder_wakeup_proc_ilocked(proc); in binder_dec_node_nilocked()
1318 if (proc) { in binder_dec_node_nilocked()
1320 rb_erase(&node->rb_node, &proc->nodes); in binder_dec_node_nilocked()
1384 if (node->proc) in binder_inc_node_tmpref()
1385 binder_inner_proc_lock(node->proc); in binder_inc_node_tmpref()
1389 if (node->proc) in binder_inc_node_tmpref()
1390 binder_inner_proc_unlock(node->proc); in binder_inc_node_tmpref()
1407 if (!node->proc) in binder_dec_node_tmpref()
1413 if (!node->proc) in binder_dec_node_tmpref()
1434 static struct binder_ref *binder_get_ref_olocked(struct binder_proc *proc, in binder_get_ref_olocked() argument
1437 struct rb_node *n = proc->refs_by_desc.rb_node; in binder_get_ref_olocked()
1476 struct binder_proc *proc, in binder_get_ref_for_node_olocked() argument
1480 struct binder_context *context = proc->context; in binder_get_ref_for_node_olocked()
1481 struct rb_node **p = &proc->refs_by_node.rb_node; in binder_get_ref_for_node_olocked()
1502 new_ref->proc = proc; in binder_get_ref_for_node_olocked()
1505 rb_insert_color(&new_ref->rb_node_node, &proc->refs_by_node); in binder_get_ref_for_node_olocked()
1508 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in binder_get_ref_for_node_olocked()
1515 p = &proc->refs_by_desc.rb_node; in binder_get_ref_for_node_olocked()
1528 rb_insert_color(&new_ref->rb_node_desc, &proc->refs_by_desc); in binder_get_ref_for_node_olocked()
1535 proc->pid, new_ref->data.debug_id, new_ref->data.desc, in binder_get_ref_for_node_olocked()
1547 ref->proc->pid, ref->data.debug_id, ref->data.desc, in binder_cleanup_ref_olocked()
1550 rb_erase(&ref->rb_node_desc, &ref->proc->refs_by_desc); in binder_cleanup_ref_olocked()
1551 rb_erase(&ref->rb_node_node, &ref->proc->refs_by_node); in binder_cleanup_ref_olocked()
1575 ref->proc->pid, ref->data.debug_id, in binder_cleanup_ref_olocked()
1577 binder_dequeue_work(ref->proc, &ref->death->work); in binder_cleanup_ref_olocked()
1630 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1641 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1667 struct binder_proc *proc, in binder_get_node_from_ref() argument
1674 binder_proc_lock(proc); in binder_get_node_from_ref()
1675 ref = binder_get_ref_olocked(proc, desc, need_strong_ref); in binder_get_node_from_ref()
1686 binder_proc_unlock(proc); in binder_get_node_from_ref()
1691 binder_proc_unlock(proc); in binder_get_node_from_ref()
1723 static int binder_update_ref_for_handle(struct binder_proc *proc, in binder_update_ref_for_handle() argument
1731 binder_proc_lock(proc); in binder_update_ref_for_handle()
1732 ref = binder_get_ref_olocked(proc, desc, strong); in binder_update_ref_for_handle()
1744 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1751 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1766 static int binder_dec_ref_for_handle(struct binder_proc *proc, in binder_dec_ref_for_handle() argument
1769 return binder_update_ref_for_handle(proc, desc, false, strong, rdata); in binder_dec_ref_for_handle()
1786 static int binder_inc_ref_for_node(struct binder_proc *proc, in binder_inc_ref_for_node() argument
1796 binder_proc_lock(proc); in binder_inc_ref_for_node()
1797 ref = binder_get_ref_for_node_olocked(proc, node, NULL); in binder_inc_ref_for_node()
1799 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1803 binder_proc_lock(proc); in binder_inc_ref_for_node()
1804 ref = binder_get_ref_for_node_olocked(proc, node, new_ref); in binder_inc_ref_for_node()
1820 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1834 assert_spin_locked(&target_thread->proc->inner_lock); in binder_pop_transaction_ilocked()
1860 binder_inner_proc_lock(thread->proc); in binder_thread_dec_tmpref()
1863 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1867 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1882 static void binder_proc_dec_tmpref(struct binder_proc *proc) in binder_proc_dec_tmpref() argument
1884 binder_inner_proc_lock(proc); in binder_proc_dec_tmpref()
1885 proc->tmp_ref--; in binder_proc_dec_tmpref()
1886 if (proc->is_dead && RB_EMPTY_ROOT(&proc->threads) && in binder_proc_dec_tmpref()
1887 !proc->tmp_ref) { in binder_proc_dec_tmpref()
1888 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1889 binder_free_proc(proc); in binder_proc_dec_tmpref()
1892 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1931 __acquires(&t->from->proc->inner_lock) in binder_get_txn_from_and_acq_inner()
1937 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
1940 binder_inner_proc_lock(from->proc); in binder_get_txn_from_and_acq_inner()
1945 binder_inner_proc_unlock(from->proc); in binder_get_txn_from_and_acq_inner()
1946 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
2004 target_thread->proc->pid, in binder_send_failed_reply()
2024 binder_inner_proc_unlock(target_thread->proc); in binder_send_failed_reply()
2029 __release(&target_thread->proc->inner_lock); in binder_send_failed_reply()
2085 static size_t binder_get_object(struct binder_proc *proc, in binder_get_object() argument
2102 if (binder_alloc_copy_from_buffer(&proc->alloc, object, buffer, in binder_get_object()
2158 struct binder_proc *proc, in binder_validate_ptr() argument
2174 if (binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_validate_ptr()
2178 object_size = binder_get_object(proc, NULL, b, object_offset, object); in binder_validate_ptr()
2226 static bool binder_validate_fixup(struct binder_proc *proc, in binder_validate_fixup() argument
2243 size_t object_size = binder_get_object(proc, NULL, b, in binder_validate_fixup()
2259 if (binder_alloc_copy_from_buffer(&proc->alloc, in binder_validate_fixup()
2328 static void binder_transaction_buffer_release(struct binder_proc *proc, in binder_transaction_buffer_release() argument
2339 proc->pid, buffer->debug_id, in binder_transaction_buffer_release()
2355 if (!binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_transaction_buffer_release()
2358 object_size = binder_get_object(proc, NULL, buffer, in binder_transaction_buffer_release()
2373 node = binder_get_node(proc, fp->binder); in binder_transaction_buffer_release()
2393 ret = binder_dec_ref_for_handle(proc, fp->handle, in binder_transaction_buffer_release()
2443 parent = binder_validate_ptr(proc, buffer, &ptr_object, in binder_transaction_buffer_release()
2484 &proc->alloc, &fd, buffer, in binder_transaction_buffer_release()
2508 static inline void binder_release_entire_buffer(struct binder_proc *proc, in binder_release_entire_buffer() argument
2518 binder_transaction_buffer_release(proc, thread, buffer, in binder_release_entire_buffer()
2527 struct binder_proc *proc = thread->proc; in binder_translate_binder() local
2532 node = binder_get_node(proc, fp->binder); in binder_translate_binder()
2534 node = binder_new_node(proc, fp); in binder_translate_binder()
2540 proc->pid, thread->pid, (u64)fp->binder, in binder_translate_binder()
2546 if (security_binder_transfer_binder(proc->cred, target_proc->cred)) { in binder_translate_binder()
2579 struct binder_proc *proc = thread->proc; in binder_translate_handle() local
2585 node = binder_get_node_from_ref(proc, fp->handle, in binder_translate_handle()
2589 proc->pid, thread->pid, fp->handle); in binder_translate_handle()
2592 if (security_binder_transfer_binder(proc->cred, target_proc->cred)) { in binder_translate_handle()
2598 if (node->proc == target_proc) { in binder_translate_handle()
2605 if (node->proc) in binder_translate_handle()
2606 binder_inner_proc_lock(node->proc); in binder_translate_handle()
2608 __acquire(&node->proc->inner_lock); in binder_translate_handle()
2612 if (node->proc) in binder_translate_handle()
2613 binder_inner_proc_unlock(node->proc); in binder_translate_handle()
2615 __release(&node->proc->inner_lock); in binder_translate_handle()
2653 struct binder_proc *proc = thread->proc; in binder_translate_fd() local
2666 proc->pid, thread->pid, in binder_translate_fd()
2676 proc->pid, thread->pid, fd); in binder_translate_fd()
2680 ret = security_binder_transfer_file(proc->cred, target_proc->cred, file); in binder_translate_fd()
2966 struct binder_proc *proc = thread->proc; in binder_translate_fd_array() local
2975 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2982 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
3000 proc->pid, thread->pid); in binder_translate_fd_array()
3033 struct binder_proc *proc = thread->proc; in binder_fixup_parent() local
3047 proc->pid, thread->pid); in binder_fixup_parent()
3056 proc->pid, thread->pid); in binder_fixup_parent()
3064 proc->pid, thread->pid); in binder_fixup_parent()
3090 struct binder_proc *proc, in binder_proc_transaction() argument
3107 binder_inner_proc_lock(proc); in binder_proc_transaction()
3109 if (proc->is_dead || (thread && thread->is_dead)) { in binder_proc_transaction()
3110 binder_inner_proc_unlock(proc); in binder_proc_transaction()
3116 thread = binder_select_thread_ilocked(proc); in binder_proc_transaction()
3121 binder_enqueue_work_ilocked(&t->work, &proc->todo); in binder_proc_transaction()
3126 binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */); in binder_proc_transaction()
3128 binder_inner_proc_unlock(proc); in binder_proc_transaction()
3163 if (node->proc) { in binder_get_node_refs_for_txn()
3167 node->proc->tmp_ref++; in binder_get_node_refs_for_txn()
3168 *procp = node->proc; in binder_get_node_refs_for_txn()
3176 static void binder_transaction(struct binder_proc *proc, in binder_transaction() argument
3200 struct binder_context *context = proc->context; in binder_transaction()
3214 e->from_proc = proc->pid; in binder_transaction()
3219 strscpy(e->context_name, proc->context->name, BINDERFS_MAX_NAME); in binder_transaction()
3222 binder_inner_proc_lock(proc); in binder_transaction()
3225 binder_inner_proc_unlock(proc); in binder_transaction()
3227 proc->pid, thread->pid); in binder_transaction()
3236 proc->pid, thread->pid, in_reply_to->debug_id, in binder_transaction()
3242 binder_inner_proc_unlock(proc); in binder_transaction()
3250 binder_inner_proc_unlock(proc); in binder_transaction()
3255 __release(&target_thread->proc->inner_lock); in binder_transaction()
3262 proc->pid, thread->pid, in binder_transaction()
3266 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
3274 target_proc = target_thread->proc; in binder_transaction()
3276 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
3288 binder_proc_lock(proc); in binder_transaction()
3289 ref = binder_get_ref_olocked(proc, tr->target.handle, in binder_transaction()
3297 proc->pid, thread->pid); in binder_transaction()
3300 binder_proc_unlock(proc); in binder_transaction()
3311 if (target_node && target_proc->pid == proc->pid) { in binder_transaction()
3313 proc->pid, thread->pid); in binder_transaction()
3329 if (WARN_ON(proc == target_proc)) { in binder_transaction()
3335 if (security_binder_transaction(proc->cred, in binder_transaction()
3342 binder_inner_proc_lock(proc); in binder_transaction()
3358 proc->pid, thread->pid); in binder_transaction()
3359 binder_inner_proc_unlock(proc); in binder_transaction()
3373 proc->pid, thread->pid, tmp->debug_id, in binder_transaction()
3378 binder_inner_proc_unlock(proc); in binder_transaction()
3389 if (from && from->proc == target_proc) { in binder_transaction()
3399 binder_inner_proc_unlock(proc); in binder_transaction()
3431 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3440 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3456 t->async_from_pid = thread->proc->pid; in binder_transaction()
3460 t->sender_euid = task_euid(proc->tsk); in binder_transaction()
3475 security_cred_getsecid(proc->cred, &secid); in binder_transaction()
3542 proc->pid, thread->pid); in binder_transaction()
3550 proc->pid, thread->pid, (u64)tr->offsets_size); in binder_transaction()
3558 proc->pid, thread->pid, in binder_transaction()
3603 proc->pid, thread->pid); in binder_transaction()
3613 proc->pid, thread->pid, in binder_transaction()
3703 proc->pid, thread->pid); in binder_transaction()
3716 proc->pid, thread->pid); in binder_transaction()
3727 binder_get_object(proc, user_buffer, t->buffer, in binder_transaction()
3731 proc->pid, thread->pid, in binder_transaction()
3766 proc->pid, thread->pid); in binder_transaction()
3809 proc->pid, thread->pid, hdr->type); in binder_transaction()
3823 proc->pid, thread->pid); in binder_transaction()
3834 proc->pid, thread->pid); in binder_transaction()
3861 binder_inner_proc_lock(proc); in binder_transaction()
3876 binder_inner_proc_unlock(proc); in binder_transaction()
3878 binder_inner_proc_lock(proc); in binder_transaction()
3880 binder_inner_proc_unlock(proc); in binder_transaction()
3909 binder_dequeue_work(proc, tcomplete); in binder_transaction()
3952 proc->pid, thread->pid, return_error, return_error_param, in binder_transaction()
3996 binder_free_buf(struct binder_proc *proc, in binder_free_buf() argument
4000 binder_inner_proc_lock(proc); in binder_free_buf()
4005 binder_inner_proc_unlock(proc); in binder_free_buf()
4013 BUG_ON(buf_node->proc != proc); in binder_free_buf()
4020 w, &proc->todo); in binder_free_buf()
4021 binder_wakeup_proc_ilocked(proc); in binder_free_buf()
4026 binder_release_entire_buffer(proc, thread, buffer, is_failure); in binder_free_buf()
4027 binder_alloc_free_buf(&proc->alloc, buffer); in binder_free_buf()
4030 static int binder_thread_write(struct binder_proc *proc, in binder_thread_write() argument
4036 struct binder_context *context = proc->context; in binder_thread_write()
4050 atomic_inc(&proc->stats.bc[_IOC_NR(cmd)]); in binder_thread_write()
4074 if (ctx_mgr_node->proc == proc) { in binder_thread_write()
4076 proc->pid, thread->pid); in binder_thread_write()
4081 proc, ctx_mgr_node, in binder_thread_write()
4088 proc, target, increment, strong, in binder_thread_write()
4092 proc->pid, thread->pid, in binder_thread_write()
4112 proc->pid, thread->pid, debug_string, in binder_thread_write()
4118 proc->pid, thread->pid, debug_string, in binder_thread_write()
4136 node = binder_get_node(proc, node_ptr); in binder_thread_write()
4139 proc->pid, thread->pid, in binder_thread_write()
4148 proc->pid, thread->pid, in binder_thread_write()
4160 proc->pid, thread->pid, in binder_thread_write()
4170 proc->pid, thread->pid, in binder_thread_write()
4183 proc->pid, thread->pid, in binder_thread_write()
4206 buffer = binder_alloc_prepare_to_free(&proc->alloc, in binder_thread_write()
4212 proc->pid, thread->pid, in binder_thread_write()
4217 proc->pid, thread->pid, in binder_thread_write()
4224 proc->pid, thread->pid, (u64)data_ptr, in binder_thread_write()
4227 binder_free_buf(proc, thread, buffer, false); in binder_thread_write()
4238 binder_transaction(proc, thread, &tr.transaction_data, in binder_thread_write()
4249 binder_transaction(proc, thread, &tr, in binder_thread_write()
4257 proc->pid, thread->pid); in binder_thread_write()
4258 binder_inner_proc_lock(proc); in binder_thread_write()
4262 proc->pid, thread->pid); in binder_thread_write()
4263 } else if (proc->requested_threads == 0) { in binder_thread_write()
4266 proc->pid, thread->pid); in binder_thread_write()
4268 proc->requested_threads--; in binder_thread_write()
4269 proc->requested_threads_started++; in binder_thread_write()
4272 binder_inner_proc_unlock(proc); in binder_thread_write()
4277 proc->pid, thread->pid); in binder_thread_write()
4281 proc->pid, thread->pid); in binder_thread_write()
4288 proc->pid, thread->pid); in binder_thread_write()
4321 proc->pid, thread->pid); in binder_thread_write()
4325 binder_proc_lock(proc); in binder_thread_write()
4326 ref = binder_get_ref_olocked(proc, target, false); in binder_thread_write()
4329 proc->pid, thread->pid, in binder_thread_write()
4334 binder_proc_unlock(proc); in binder_thread_write()
4341 proc->pid, thread->pid, in binder_thread_write()
4353 proc->pid, thread->pid); in binder_thread_write()
4355 binder_proc_unlock(proc); in binder_thread_write()
4363 if (ref->node->proc == NULL) { in binder_thread_write()
4366 binder_inner_proc_lock(proc); in binder_thread_write()
4368 &ref->death->work, &proc->todo); in binder_thread_write()
4369 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
4370 binder_inner_proc_unlock(proc); in binder_thread_write()
4375 proc->pid, thread->pid); in binder_thread_write()
4377 binder_proc_unlock(proc); in binder_thread_write()
4383 proc->pid, thread->pid, in binder_thread_write()
4387 binder_proc_unlock(proc); in binder_thread_write()
4391 binder_inner_proc_lock(proc); in binder_thread_write()
4403 &proc->todo); in binder_thread_write()
4405 proc); in binder_thread_write()
4411 binder_inner_proc_unlock(proc); in binder_thread_write()
4414 binder_proc_unlock(proc); in binder_thread_write()
4425 binder_inner_proc_lock(proc); in binder_thread_write()
4426 list_for_each_entry(w, &proc->delivered_death, in binder_thread_write()
4440 proc->pid, thread->pid, (u64)cookie, in binder_thread_write()
4444 proc->pid, thread->pid, (u64)cookie); in binder_thread_write()
4445 binder_inner_proc_unlock(proc); in binder_thread_write()
4459 &proc->todo); in binder_thread_write()
4460 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
4463 binder_inner_proc_unlock(proc); in binder_thread_write()
4468 proc->pid, thread->pid, cmd); in binder_thread_write()
4476 static void binder_stat_br(struct binder_proc *proc, in binder_stat_br() argument
4482 atomic_inc(&proc->stats.br[_IOC_NR(cmd)]); in binder_stat_br()
4487 static int binder_put_node_cmd(struct binder_proc *proc, in binder_put_node_cmd() argument
4509 binder_stat_br(proc, thread, cmd); in binder_put_node_cmd()
4511 proc->pid, thread->pid, cmd_name, node_debug_id, in binder_put_node_cmd()
4522 struct binder_proc *proc = thread->proc; in binder_wait_for_work() local
4526 binder_inner_proc_lock(proc); in binder_wait_for_work()
4533 &proc->waiting_threads); in binder_wait_for_work()
4534 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4536 binder_inner_proc_lock(proc); in binder_wait_for_work()
4544 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4564 static int binder_apply_fd_fixups(struct binder_proc *proc, in binder_apply_fd_fixups() argument
4586 if (binder_alloc_copy_to_buffer(&proc->alloc, t->buffer, in binder_apply_fd_fixups()
4600 err = binder_alloc_copy_from_buffer(&proc->alloc, &fd, in binder_apply_fd_fixups()
4615 static int binder_thread_read(struct binder_proc *proc, in binder_thread_read() argument
4634 binder_inner_proc_lock(proc); in binder_thread_read()
4636 binder_inner_proc_unlock(proc); in binder_thread_read()
4642 !binder_worklist_empty(proc, &thread->todo)); in binder_thread_read()
4647 proc->pid, thread->pid, thread->looper); in binder_thread_read()
4651 binder_set_nice(proc->default_priority); in binder_thread_read()
4676 binder_inner_proc_lock(proc); in binder_thread_read()
4679 else if (!binder_worklist_empty_ilocked(&proc->todo) && in binder_thread_read()
4681 list = &proc->todo; in binder_thread_read()
4683 binder_inner_proc_unlock(proc); in binder_thread_read()
4692 binder_inner_proc_unlock(proc); in binder_thread_read()
4701 binder_inner_proc_unlock(proc); in binder_thread_read()
4709 binder_inner_proc_unlock(proc); in binder_thread_read()
4716 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4719 binder_inner_proc_unlock(proc); in binder_thread_read()
4727 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4730 proc->pid, thread->pid); in binder_thread_read()
4742 BUG_ON(proc != node->proc); in binder_thread_read()
4768 proc->pid, thread->pid, in binder_thread_read()
4772 rb_erase(&node->rb_node, &proc->nodes); in binder_thread_read()
4773 binder_inner_proc_unlock(proc); in binder_thread_read()
4787 binder_inner_proc_unlock(proc); in binder_thread_read()
4791 proc, thread, &ptr, node_ptr, in binder_thread_read()
4796 proc, thread, &ptr, node_ptr, in binder_thread_read()
4801 proc, thread, &ptr, node_ptr, in binder_thread_read()
4806 proc, thread, &ptr, node_ptr, in binder_thread_read()
4812 proc->pid, thread->pid, in binder_thread_read()
4835 proc->pid, thread->pid, in binder_thread_read()
4841 binder_inner_proc_unlock(proc); in binder_thread_read()
4846 w, &proc->delivered_death); in binder_thread_read()
4847 binder_inner_proc_unlock(proc); in binder_thread_read()
4856 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4861 binder_inner_proc_unlock(proc); in binder_thread_read()
4863 proc->pid, thread->pid, w->type); in binder_thread_read()
4895 struct task_struct *sender = t_from->proc->tsk; in binder_thread_read()
4901 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4903 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4908 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4910 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4914 ret = binder_apply_fd_fixups(proc, t); in binder_thread_read()
4925 binder_free_buf(proc, thread, buffer, true); in binder_thread_read()
4928 proc->pid, thread->pid, in binder_thread_read()
4937 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4976 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4979 proc->pid, thread->pid, in binder_thread_read()
4983 t->debug_id, t_from ? t_from->proc->pid : 0, in binder_thread_read()
4993 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4996 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4999 binder_inner_proc_lock(thread->proc); in binder_thread_read()
5003 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
5013 binder_inner_proc_lock(proc); in binder_thread_read()
5014 if (proc->requested_threads == 0 && in binder_thread_read()
5015 list_empty(&thread->proc->waiting_threads) && in binder_thread_read()
5016 proc->requested_threads_started < proc->max_threads && in binder_thread_read()
5020 proc->requested_threads++; in binder_thread_read()
5021 binder_inner_proc_unlock(proc); in binder_thread_read()
5024 proc->pid, thread->pid); in binder_thread_read()
5027 binder_stat_br(proc, thread, BR_SPAWN_LOOPER); in binder_thread_read()
5029 binder_inner_proc_unlock(proc); in binder_thread_read()
5033 static void binder_release_work(struct binder_proc *proc, in binder_release_work() argument
5040 binder_inner_proc_lock(proc); in binder_release_work()
5043 binder_inner_proc_unlock(proc); in binder_release_work()
5093 struct binder_proc *proc, struct binder_thread *new_thread) in binder_get_thread_ilocked() argument
5097 struct rb_node **p = &proc->threads.rb_node; in binder_get_thread_ilocked()
5114 thread->proc = proc; in binder_get_thread_ilocked()
5120 rb_insert_color(&thread->rb_node, &proc->threads); in binder_get_thread_ilocked()
5130 static struct binder_thread *binder_get_thread(struct binder_proc *proc) in binder_get_thread() argument
5135 binder_inner_proc_lock(proc); in binder_get_thread()
5136 thread = binder_get_thread_ilocked(proc, NULL); in binder_get_thread()
5137 binder_inner_proc_unlock(proc); in binder_get_thread()
5142 binder_inner_proc_lock(proc); in binder_get_thread()
5143 thread = binder_get_thread_ilocked(proc, new_thread); in binder_get_thread()
5144 binder_inner_proc_unlock(proc); in binder_get_thread()
5151 static void binder_free_proc(struct binder_proc *proc) in binder_free_proc() argument
5155 BUG_ON(!list_empty(&proc->todo)); in binder_free_proc()
5156 BUG_ON(!list_empty(&proc->delivered_death)); in binder_free_proc()
5157 device = container_of(proc->context, struct binder_device, context); in binder_free_proc()
5159 kfree(proc->context->name); in binder_free_proc()
5162 binder_alloc_deferred_release(&proc->alloc); in binder_free_proc()
5163 put_task_struct(proc->tsk); in binder_free_proc()
5164 put_cred(proc->cred); in binder_free_proc()
5166 kfree(proc); in binder_free_proc()
5173 binder_proc_dec_tmpref(thread->proc); in binder_free_thread()
5177 static int binder_thread_release(struct binder_proc *proc, in binder_thread_release() argument
5185 binder_inner_proc_lock(thread->proc); in binder_thread_release()
5192 proc->tmp_ref++; in binder_thread_release()
5198 rb_erase(&thread->rb_node, &proc->threads); in binder_thread_release()
5214 proc->pid, thread->pid, in binder_thread_release()
5251 binder_inner_proc_unlock(thread->proc); in binder_thread_release()
5265 binder_release_work(proc, &thread->todo); in binder_thread_release()
5273 struct binder_proc *proc = filp->private_data; in binder_poll() local
5277 thread = binder_get_thread(proc); in binder_poll()
5281 binder_inner_proc_lock(thread->proc); in binder_poll()
5285 binder_inner_proc_unlock(thread->proc); in binder_poll()
5300 struct binder_proc *proc = filp->private_data; in binder_ioctl_write_read() local
5315 proc->pid, thread->pid, in binder_ioctl_write_read()
5320 ret = binder_thread_write(proc, thread, in binder_ioctl_write_read()
5333 ret = binder_thread_read(proc, thread, bwr.read_buffer, in binder_ioctl_write_read()
5338 binder_inner_proc_lock(proc); in binder_ioctl_write_read()
5339 if (!binder_worklist_empty_ilocked(&proc->todo)) in binder_ioctl_write_read()
5340 binder_wakeup_proc_ilocked(proc); in binder_ioctl_write_read()
5341 binder_inner_proc_unlock(proc); in binder_ioctl_write_read()
5350 proc->pid, thread->pid, in binder_ioctl_write_read()
5365 struct binder_proc *proc = filp->private_data; in binder_ioctl_set_ctx_mgr() local
5366 struct binder_context *context = proc->context; in binder_ioctl_set_ctx_mgr()
5376 ret = security_binder_set_context_mgr(proc->cred); in binder_ioctl_set_ctx_mgr()
5391 new_node = binder_new_node(proc, fbo); in binder_ioctl_set_ctx_mgr()
5409 static int binder_ioctl_get_node_info_for_ref(struct binder_proc *proc, in binder_ioctl_get_node_info_for_ref() argument
5413 struct binder_context *context = proc->context; in binder_ioctl_get_node_info_for_ref()
5419 proc->pid); in binder_ioctl_get_node_info_for_ref()
5426 context->binder_context_mgr_node->proc != proc) { in binder_ioctl_get_node_info_for_ref()
5432 node = binder_get_node_from_ref(proc, handle, true, NULL); in binder_ioctl_get_node_info_for_ref()
5445 static int binder_ioctl_get_node_debug_info(struct binder_proc *proc, in binder_ioctl_get_node_debug_info() argument
5453 binder_inner_proc_lock(proc); in binder_ioctl_get_node_debug_info()
5454 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in binder_ioctl_get_node_debug_info()
5465 binder_inner_proc_unlock(proc); in binder_ioctl_get_node_debug_info()
5473 struct binder_proc *proc = filp->private_data; in binder_ioctl() local
5481 binder_selftest_alloc(&proc->alloc); in binder_ioctl()
5489 thread = binder_get_thread(proc); in binder_ioctl()
5509 binder_inner_proc_lock(proc); in binder_ioctl()
5510 proc->max_threads = max_threads; in binder_ioctl()
5511 binder_inner_proc_unlock(proc); in binder_ioctl()
5533 proc->pid, thread->pid); in binder_ioctl()
5534 binder_thread_release(proc, thread); in binder_ioctl()
5559 ret = binder_ioctl_get_node_info_for_ref(proc, &info); in binder_ioctl()
5578 ret = binder_ioctl_get_node_debug_info(proc, &info); in binder_ioctl()
5610 binder_inner_proc_lock(proc); in binder_ioctl()
5613 binder_inner_proc_unlock(proc); in binder_ioctl()
5634 binder_inner_proc_lock(proc); in binder_ioctl()
5640 binder_inner_proc_unlock(proc); in binder_ioctl()
5668 pr_info("%d:%d ioctl %x %lx returned %d\n", proc->pid, current->pid, cmd, arg, ret); in binder_ioctl()
5676 struct binder_proc *proc = vma->vm_private_data; in binder_vma_open() local
5680 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_open()
5687 struct binder_proc *proc = vma->vm_private_data; in binder_vma_close() local
5691 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_close()
5694 binder_alloc_vma_close(&proc->alloc); in binder_vma_close()
5710 struct binder_proc *proc = filp->private_data; in binder_mmap() local
5712 if (proc->tsk != current->group_leader) in binder_mmap()
5717 __func__, proc->pid, vma->vm_start, vma->vm_end, in binder_mmap()
5723 proc->pid, vma->vm_start, vma->vm_end, "bad vm_flags", -EPERM); in binder_mmap()
5730 vma->vm_private_data = proc; in binder_mmap()
5732 return binder_alloc_mmap_handler(&proc->alloc, vma); in binder_mmap()
5737 struct binder_proc *proc, *itr; in binder_open() local
5746 proc = kzalloc(sizeof(*proc), GFP_KERNEL); in binder_open()
5747 if (proc == NULL) in binder_open()
5749 spin_lock_init(&proc->inner_lock); in binder_open()
5750 spin_lock_init(&proc->outer_lock); in binder_open()
5752 proc->tsk = current->group_leader; in binder_open()
5753 proc->cred = get_cred(filp->f_cred); in binder_open()
5754 INIT_LIST_HEAD(&proc->todo); in binder_open()
5755 proc->default_priority = task_nice(current); in binder_open()
5766 proc->context = &binder_dev->context; in binder_open()
5767 binder_alloc_init(&proc->alloc); in binder_open()
5770 proc->pid = current->group_leader->pid; in binder_open()
5771 INIT_LIST_HEAD(&proc->delivered_death); in binder_open()
5772 INIT_LIST_HEAD(&proc->waiting_threads); in binder_open()
5773 filp->private_data = proc; in binder_open()
5777 if (itr->pid == proc->pid) { in binder_open()
5782 hlist_add_head(&proc->proc_node, &binder_procs); in binder_open()
5788 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5795 proc->debugfs_entry = debugfs_create_file(strbuf, 0444, in binder_open()
5797 (void *)(unsigned long)proc->pid, in binder_open()
5805 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5813 strbuf, &proc_fops, (void *)(unsigned long)proc->pid); in binder_open()
5815 proc->binderfs_entry = binderfs_entry; in binder_open()
5830 struct binder_proc *proc = filp->private_data; in binder_flush() local
5832 binder_defer_work(proc, BINDER_DEFERRED_FLUSH); in binder_flush()
5837 static void binder_deferred_flush(struct binder_proc *proc) in binder_deferred_flush() argument
5842 binder_inner_proc_lock(proc); in binder_deferred_flush()
5843 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_deferred_flush()
5852 binder_inner_proc_unlock(proc); in binder_deferred_flush()
5855 "binder_flush: %d woke %d threads\n", proc->pid, in binder_deferred_flush()
5861 struct binder_proc *proc = filp->private_data; in binder_release() local
5863 debugfs_remove(proc->debugfs_entry); in binder_release()
5865 if (proc->binderfs_entry) { in binder_release()
5866 binderfs_remove_file(proc->binderfs_entry); in binder_release()
5867 proc->binderfs_entry = NULL; in binder_release()
5870 binder_defer_work(proc, BINDER_DEFERRED_RELEASE); in binder_release()
5879 struct binder_proc *proc = node->proc; in binder_node_release() local
5881 binder_release_work(proc, &node->async_todo); in binder_node_release()
5884 binder_inner_proc_lock(proc); in binder_node_release()
5891 binder_inner_proc_unlock(proc); in binder_node_release()
5898 node->proc = NULL; in binder_node_release()
5901 binder_inner_proc_unlock(proc); in binder_node_release()
5915 binder_inner_proc_lock(ref->proc); in binder_node_release()
5917 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5926 &ref->proc->todo); in binder_node_release()
5927 binder_wakeup_proc_ilocked(ref->proc); in binder_node_release()
5928 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5940 static void binder_deferred_release(struct binder_proc *proc) in binder_deferred_release() argument
5942 struct binder_context *context = proc->context; in binder_deferred_release()
5947 hlist_del(&proc->proc_node); in binder_deferred_release()
5952 context->binder_context_mgr_node->proc == proc) { in binder_deferred_release()
5955 __func__, proc->pid); in binder_deferred_release()
5959 binder_inner_proc_lock(proc); in binder_deferred_release()
5964 proc->tmp_ref++; in binder_deferred_release()
5966 proc->is_dead = true; in binder_deferred_release()
5969 while ((n = rb_first(&proc->threads))) { in binder_deferred_release()
5973 binder_inner_proc_unlock(proc); in binder_deferred_release()
5975 active_transactions += binder_thread_release(proc, thread); in binder_deferred_release()
5976 binder_inner_proc_lock(proc); in binder_deferred_release()
5981 while ((n = rb_first(&proc->nodes))) { in binder_deferred_release()
5992 rb_erase(&node->rb_node, &proc->nodes); in binder_deferred_release()
5993 binder_inner_proc_unlock(proc); in binder_deferred_release()
5995 binder_inner_proc_lock(proc); in binder_deferred_release()
5997 binder_inner_proc_unlock(proc); in binder_deferred_release()
6000 binder_proc_lock(proc); in binder_deferred_release()
6001 while ((n = rb_first(&proc->refs_by_desc))) { in binder_deferred_release()
6007 binder_proc_unlock(proc); in binder_deferred_release()
6009 binder_proc_lock(proc); in binder_deferred_release()
6011 binder_proc_unlock(proc); in binder_deferred_release()
6013 binder_release_work(proc, &proc->todo); in binder_deferred_release()
6014 binder_release_work(proc, &proc->delivered_death); in binder_deferred_release()
6018 __func__, proc->pid, threads, nodes, incoming_refs, in binder_deferred_release()
6021 binder_proc_dec_tmpref(proc); in binder_deferred_release()
6026 struct binder_proc *proc; in binder_deferred_func() local
6033 proc = hlist_entry(binder_deferred_list.first, in binder_deferred_func()
6035 hlist_del_init(&proc->deferred_work_node); in binder_deferred_func()
6036 defer = proc->deferred_work; in binder_deferred_func()
6037 proc->deferred_work = 0; in binder_deferred_func()
6039 proc = NULL; in binder_deferred_func()
6045 binder_deferred_flush(proc); in binder_deferred_func()
6048 binder_deferred_release(proc); /* frees proc */ in binder_deferred_func()
6049 } while (proc); in binder_deferred_func()
6054 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer) in binder_defer_work() argument
6057 proc->deferred_work |= defer; in binder_defer_work()
6058 if (hlist_unhashed(&proc->deferred_work_node)) { in binder_defer_work()
6059 hlist_add_head(&proc->deferred_work_node, in binder_defer_work()
6067 struct binder_proc *proc, in print_binder_transaction_ilocked() argument
6079 t->from ? t->from->proc->pid : 0, in print_binder_transaction_ilocked()
6086 if (proc != to_proc) { in print_binder_transaction_ilocked()
6107 struct binder_proc *proc, in print_binder_work_ilocked() argument
6119 m, proc, transaction_prefix, t); in print_binder_work_ilocked()
6169 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6173 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6177 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6183 print_binder_work_ilocked(m, thread->proc, " ", in print_binder_thread_ilocked()
6209 seq_printf(m, " %d", ref->proc->pid); in print_binder_node_nilocked()
6212 if (node->proc) { in print_binder_node_nilocked()
6214 print_binder_work_ilocked(m, node->proc, " ", in print_binder_node_nilocked()
6225 ref->node->proc ? "" : "dead ", in print_binder_ref_olocked()
6232 struct binder_proc *proc, int print_all) in print_binder_proc() argument
6240 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc()
6241 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc()
6244 binder_inner_proc_lock(proc); in print_binder_proc()
6245 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc()
6249 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in print_binder_proc()
6262 binder_inner_proc_unlock(proc); in print_binder_proc()
6269 binder_inner_proc_lock(proc); in print_binder_proc()
6271 binder_inner_proc_unlock(proc); in print_binder_proc()
6276 binder_proc_lock(proc); in print_binder_proc()
6277 for (n = rb_first(&proc->refs_by_desc); in print_binder_proc()
6283 binder_proc_unlock(proc); in print_binder_proc()
6285 binder_alloc_print_allocated(m, &proc->alloc); in print_binder_proc()
6286 binder_inner_proc_lock(proc); in print_binder_proc()
6287 list_for_each_entry(w, &proc->todo, entry) in print_binder_proc()
6288 print_binder_work_ilocked(m, proc, " ", in print_binder_proc()
6290 list_for_each_entry(w, &proc->delivered_death, entry) { in print_binder_proc()
6294 binder_inner_proc_unlock(proc); in print_binder_proc()
6395 struct binder_proc *proc) in print_binder_proc_stats() argument
6402 binder_alloc_get_free_async_space(&proc->alloc); in print_binder_proc_stats()
6404 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc_stats()
6405 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc_stats()
6408 binder_inner_proc_lock(proc); in print_binder_proc_stats()
6409 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
6412 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_stats()
6418 " free async space %zd\n", proc->requested_threads, in print_binder_proc_stats()
6419 proc->requested_threads_started, proc->max_threads, in print_binder_proc_stats()
6423 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
6425 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
6430 binder_proc_lock(proc); in print_binder_proc_stats()
6431 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in print_binder_proc_stats()
6438 binder_proc_unlock(proc); in print_binder_proc_stats()
6441 count = binder_alloc_get_allocated_count(&proc->alloc); in print_binder_proc_stats()
6444 binder_alloc_print_pages(m, &proc->alloc); in print_binder_proc_stats()
6447 binder_inner_proc_lock(proc); in print_binder_proc_stats()
6448 list_for_each_entry(w, &proc->todo, entry) { in print_binder_proc_stats()
6452 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
6455 print_binder_stats(m, " ", &proc->stats); in print_binder_proc_stats()
6461 struct binder_proc *proc; in binder_state_show() local
6491 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_state_show()
6492 print_binder_proc(m, proc, 1); in binder_state_show()
6500 struct binder_proc *proc; in binder_stats_show() local
6507 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_stats_show()
6508 print_binder_proc_stats(m, proc); in binder_stats_show()
6516 struct binder_proc *proc; in binder_transactions_show() local
6520 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_transactions_show()
6521 print_binder_proc(m, proc, 0); in binder_transactions_show()
6618 from_pid = t->from ? (t->from->proc ? t->from->proc->pid : 0) : t->async_from_pid; in print_binder_transaction_brief_ilocked()
6652 struct binder_proc *proc, in print_binder_transaction_brief() argument
6662 binder_inner_proc_lock(proc); in print_binder_transaction_brief()
6663 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in print_binder_transaction_brief()
6679 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in print_binder_transaction_brief()
6688 binder_inner_proc_unlock(proc); in print_binder_transaction_brief()
6696 binder_inner_proc_lock(proc); in print_binder_transaction_brief()
6698 binder_inner_proc_unlock(proc); in print_binder_transaction_brief()
6708 struct binder_proc *proc) in print_binder_proc_brief() argument
6712 size_t free_async_space = binder_alloc_get_free_async_space(&proc->alloc); in print_binder_proc_brief()
6714 seq_printf(m, "%d\t", proc->pid); in print_binder_proc_brief()
6715 seq_printf(m, "%s\t", proc->context->name); in print_binder_proc_brief()
6717 binder_inner_proc_lock(proc); in print_binder_proc_brief()
6718 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_brief()
6722 "\t%zd\n", proc->requested_threads, in print_binder_proc_brief()
6723 proc->requested_threads_started, proc->max_threads, in print_binder_proc_brief()
6726 binder_inner_proc_unlock(proc); in print_binder_proc_brief()
6731 struct binder_proc *proc = NULL; in binder_transaction_proc_show() local
6736 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_transaction_proc_show()
6737 print_binder_transaction_brief(m, proc, now); in binder_transaction_proc_show()
6740 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_transaction_proc_show()
6741 print_binder_proc_brief(m, proc); in binder_transaction_proc_show()