Lines Matching refs:proc
98 DEFINE_SHOW_ATTRIBUTE(proc);
328 struct binder_proc *proc; member
413 struct binder_proc *proc; member
556 struct binder_proc *proc; member
657 #define binder_proc_lock(proc) _binder_proc_lock(proc, __LINE__) argument
659 _binder_proc_lock(struct binder_proc *proc, int line) in _binder_proc_lock() argument
660 __acquires(&proc->outer_lock) in _binder_proc_lock()
664 spin_lock(&proc->outer_lock); in _binder_proc_lock()
675 _binder_proc_unlock(struct binder_proc *proc, int line) in _binder_proc_unlock() argument
676 __releases(&proc->outer_lock) in _binder_proc_unlock()
680 spin_unlock(&proc->outer_lock); in _binder_proc_unlock()
689 #define binder_inner_proc_lock(proc) _binder_inner_proc_lock(proc, __LINE__) argument
691 _binder_inner_proc_lock(struct binder_proc *proc, int line) in _binder_inner_proc_lock() argument
692 __acquires(&proc->inner_lock) in _binder_inner_proc_lock()
696 spin_lock(&proc->inner_lock); in _binder_inner_proc_lock()
705 #define binder_inner_proc_unlock(proc) _binder_inner_proc_unlock(proc, __LINE__) argument
707 _binder_inner_proc_unlock(struct binder_proc *proc, int line) in _binder_inner_proc_unlock() argument
708 __releases(&proc->inner_lock) in _binder_inner_proc_unlock()
712 spin_unlock(&proc->inner_lock); in _binder_inner_proc_unlock()
757 __acquires(&node->lock) __acquires(&node->proc->inner_lock) in _binder_node_inner_lock()
762 if (node->proc) in _binder_node_inner_lock()
763 binder_inner_proc_lock(node->proc); in _binder_node_inner_lock()
766 __acquire(&node->proc->inner_lock); in _binder_node_inner_lock()
778 __releases(&node->lock) __releases(&node->proc->inner_lock) in _binder_node_inner_unlock()
780 struct binder_proc *proc = node->proc; in _binder_node_inner_unlock() local
784 if (proc) in _binder_node_inner_unlock()
785 binder_inner_proc_unlock(proc); in _binder_node_inner_unlock()
788 __release(&node->proc->inner_lock); in _binder_node_inner_unlock()
804 static bool binder_worklist_empty(struct binder_proc *proc, in binder_worklist_empty() argument
809 binder_inner_proc_lock(proc); in binder_worklist_empty()
811 binder_inner_proc_unlock(proc); in binder_worklist_empty()
884 binder_inner_proc_lock(thread->proc); in binder_enqueue_thread_work()
886 binder_inner_proc_unlock(thread->proc); in binder_enqueue_thread_work()
904 binder_dequeue_work(struct binder_proc *proc, struct binder_work *work) in binder_dequeue_work() argument
906 binder_inner_proc_lock(proc); in binder_dequeue_work()
908 binder_inner_proc_unlock(proc); in binder_dequeue_work()
923 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
925 static void binder_free_proc(struct binder_proc *proc);
944 !binder_worklist_empty_ilocked(&thread->proc->todo)); in binder_has_work_ilocked()
951 binder_inner_proc_lock(thread->proc); in binder_has_work()
953 binder_inner_proc_unlock(thread->proc); in binder_has_work()
966 static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc, in binder_wakeup_poll_threads_ilocked() argument
972 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_wakeup_poll_threads_ilocked()
997 binder_select_thread_ilocked(struct binder_proc *proc) in binder_select_thread_ilocked() argument
1001 assert_spin_locked(&proc->inner_lock); in binder_select_thread_ilocked()
1002 thread = list_first_entry_or_null(&proc->waiting_threads, in binder_select_thread_ilocked()
1028 static void binder_wakeup_thread_ilocked(struct binder_proc *proc, in binder_wakeup_thread_ilocked() argument
1032 assert_spin_locked(&proc->inner_lock); in binder_wakeup_thread_ilocked()
1055 binder_wakeup_poll_threads_ilocked(proc, sync); in binder_wakeup_thread_ilocked()
1058 static void binder_wakeup_proc_ilocked(struct binder_proc *proc) in binder_wakeup_proc_ilocked() argument
1060 struct binder_thread *thread = binder_select_thread_ilocked(proc); in binder_wakeup_proc_ilocked()
1062 binder_wakeup_thread_ilocked(proc, thread, /* sync = */false); in binder_wakeup_proc_ilocked()
1083 static struct binder_node *binder_get_node_ilocked(struct binder_proc *proc, in binder_get_node_ilocked() argument
1086 struct rb_node *n = proc->nodes.rb_node; in binder_get_node_ilocked()
1089 assert_spin_locked(&proc->inner_lock); in binder_get_node_ilocked()
1111 static struct binder_node *binder_get_node(struct binder_proc *proc, in binder_get_node() argument
1116 binder_inner_proc_lock(proc); in binder_get_node()
1117 node = binder_get_node_ilocked(proc, ptr); in binder_get_node()
1118 binder_inner_proc_unlock(proc); in binder_get_node()
1123 struct binder_proc *proc, in binder_init_node_ilocked() argument
1127 struct rb_node **p = &proc->nodes.rb_node; in binder_init_node_ilocked()
1134 assert_spin_locked(&proc->inner_lock); in binder_init_node_ilocked()
1159 rb_insert_color(&node->rb_node, &proc->nodes); in binder_init_node_ilocked()
1161 node->proc = proc; in binder_init_node_ilocked()
1173 proc->pid, current->pid, node->debug_id, in binder_init_node_ilocked()
1179 static struct binder_node *binder_new_node(struct binder_proc *proc, in binder_new_node() argument
1187 binder_inner_proc_lock(proc); in binder_new_node()
1188 node = binder_init_node_ilocked(proc, new_node, fp); in binder_new_node()
1189 binder_inner_proc_unlock(proc); in binder_new_node()
1209 struct binder_proc *proc = node->proc; in binder_inc_node_nilocked() local
1212 if (proc) in binder_inc_node_nilocked()
1213 assert_spin_locked(&proc->inner_lock); in binder_inc_node_nilocked()
1218 !(node->proc && in binder_inc_node_nilocked()
1219 node == node->proc->context->binder_context_mgr_node && in binder_inc_node_nilocked()
1269 struct binder_proc *proc = node->proc; in binder_dec_node_nilocked() local
1272 if (proc) in binder_dec_node_nilocked()
1273 assert_spin_locked(&proc->inner_lock); in binder_dec_node_nilocked()
1289 if (proc && (node->has_strong_ref || node->has_weak_ref)) { in binder_dec_node_nilocked()
1291 binder_enqueue_work_ilocked(&node->work, &proc->todo); in binder_dec_node_nilocked()
1292 binder_wakeup_proc_ilocked(proc); in binder_dec_node_nilocked()
1297 if (proc) { in binder_dec_node_nilocked()
1299 rb_erase(&node->rb_node, &proc->nodes); in binder_dec_node_nilocked()
1363 if (node->proc) in binder_inc_node_tmpref()
1364 binder_inner_proc_lock(node->proc); in binder_inc_node_tmpref()
1368 if (node->proc) in binder_inc_node_tmpref()
1369 binder_inner_proc_unlock(node->proc); in binder_inc_node_tmpref()
1386 if (!node->proc) in binder_dec_node_tmpref()
1392 if (!node->proc) in binder_dec_node_tmpref()
1413 static struct binder_ref *binder_get_ref_olocked(struct binder_proc *proc, in binder_get_ref_olocked() argument
1416 struct rb_node *n = proc->refs_by_desc.rb_node; in binder_get_ref_olocked()
1455 struct binder_proc *proc, in binder_get_ref_for_node_olocked() argument
1459 struct binder_context *context = proc->context; in binder_get_ref_for_node_olocked()
1460 struct rb_node **p = &proc->refs_by_node.rb_node; in binder_get_ref_for_node_olocked()
1481 new_ref->proc = proc; in binder_get_ref_for_node_olocked()
1484 rb_insert_color(&new_ref->rb_node_node, &proc->refs_by_node); in binder_get_ref_for_node_olocked()
1487 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in binder_get_ref_for_node_olocked()
1494 p = &proc->refs_by_desc.rb_node; in binder_get_ref_for_node_olocked()
1507 rb_insert_color(&new_ref->rb_node_desc, &proc->refs_by_desc); in binder_get_ref_for_node_olocked()
1514 proc->pid, new_ref->data.debug_id, new_ref->data.desc, in binder_get_ref_for_node_olocked()
1526 ref->proc->pid, ref->data.debug_id, ref->data.desc, in binder_cleanup_ref_olocked()
1529 rb_erase(&ref->rb_node_desc, &ref->proc->refs_by_desc); in binder_cleanup_ref_olocked()
1530 rb_erase(&ref->rb_node_node, &ref->proc->refs_by_node); in binder_cleanup_ref_olocked()
1554 ref->proc->pid, ref->data.debug_id, in binder_cleanup_ref_olocked()
1556 binder_dequeue_work(ref->proc, &ref->death->work); in binder_cleanup_ref_olocked()
1609 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1620 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1646 struct binder_proc *proc, in binder_get_node_from_ref() argument
1653 binder_proc_lock(proc); in binder_get_node_from_ref()
1654 ref = binder_get_ref_olocked(proc, desc, need_strong_ref); in binder_get_node_from_ref()
1665 binder_proc_unlock(proc); in binder_get_node_from_ref()
1670 binder_proc_unlock(proc); in binder_get_node_from_ref()
1702 static int binder_update_ref_for_handle(struct binder_proc *proc, in binder_update_ref_for_handle() argument
1710 binder_proc_lock(proc); in binder_update_ref_for_handle()
1711 ref = binder_get_ref_olocked(proc, desc, strong); in binder_update_ref_for_handle()
1723 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1730 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1745 static int binder_dec_ref_for_handle(struct binder_proc *proc, in binder_dec_ref_for_handle() argument
1748 return binder_update_ref_for_handle(proc, desc, false, strong, rdata); in binder_dec_ref_for_handle()
1765 static int binder_inc_ref_for_node(struct binder_proc *proc, in binder_inc_ref_for_node() argument
1775 binder_proc_lock(proc); in binder_inc_ref_for_node()
1776 ref = binder_get_ref_for_node_olocked(proc, node, NULL); in binder_inc_ref_for_node()
1778 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1782 binder_proc_lock(proc); in binder_inc_ref_for_node()
1783 ref = binder_get_ref_for_node_olocked(proc, node, new_ref); in binder_inc_ref_for_node()
1799 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1813 assert_spin_locked(&target_thread->proc->inner_lock); in binder_pop_transaction_ilocked()
1839 binder_inner_proc_lock(thread->proc); in binder_thread_dec_tmpref()
1842 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1846 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1861 static void binder_proc_dec_tmpref(struct binder_proc *proc) in binder_proc_dec_tmpref() argument
1863 binder_inner_proc_lock(proc); in binder_proc_dec_tmpref()
1864 proc->tmp_ref--; in binder_proc_dec_tmpref()
1865 if (proc->is_dead && RB_EMPTY_ROOT(&proc->threads) && in binder_proc_dec_tmpref()
1866 !proc->tmp_ref) { in binder_proc_dec_tmpref()
1867 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1868 binder_free_proc(proc); in binder_proc_dec_tmpref()
1871 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1910 __acquires(&t->from->proc->inner_lock) in binder_get_txn_from_and_acq_inner()
1916 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
1919 binder_inner_proc_lock(from->proc); in binder_get_txn_from_and_acq_inner()
1924 binder_inner_proc_unlock(from->proc); in binder_get_txn_from_and_acq_inner()
1925 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
1983 target_thread->proc->pid, in binder_send_failed_reply()
2003 binder_inner_proc_unlock(target_thread->proc); in binder_send_failed_reply()
2008 __release(&target_thread->proc->inner_lock); in binder_send_failed_reply()
2064 static size_t binder_get_object(struct binder_proc *proc, in binder_get_object() argument
2081 if (binder_alloc_copy_from_buffer(&proc->alloc, object, buffer, in binder_get_object()
2137 struct binder_proc *proc, in binder_validate_ptr() argument
2153 if (binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_validate_ptr()
2157 object_size = binder_get_object(proc, NULL, b, object_offset, object); in binder_validate_ptr()
2205 static bool binder_validate_fixup(struct binder_proc *proc, in binder_validate_fixup() argument
2222 size_t object_size = binder_get_object(proc, NULL, b, in binder_validate_fixup()
2238 if (binder_alloc_copy_from_buffer(&proc->alloc, in binder_validate_fixup()
2307 static void binder_transaction_buffer_release(struct binder_proc *proc, in binder_transaction_buffer_release() argument
2318 proc->pid, buffer->debug_id, in binder_transaction_buffer_release()
2334 if (!binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_transaction_buffer_release()
2337 object_size = binder_get_object(proc, NULL, buffer, in binder_transaction_buffer_release()
2352 node = binder_get_node(proc, fp->binder); in binder_transaction_buffer_release()
2372 ret = binder_dec_ref_for_handle(proc, fp->handle, in binder_transaction_buffer_release()
2422 parent = binder_validate_ptr(proc, buffer, &ptr_object, in binder_transaction_buffer_release()
2463 &proc->alloc, &fd, buffer, in binder_transaction_buffer_release()
2487 static inline void binder_release_entire_buffer(struct binder_proc *proc, in binder_release_entire_buffer() argument
2497 binder_transaction_buffer_release(proc, thread, buffer, in binder_release_entire_buffer()
2506 struct binder_proc *proc = thread->proc; in binder_translate_binder() local
2511 node = binder_get_node(proc, fp->binder); in binder_translate_binder()
2513 node = binder_new_node(proc, fp); in binder_translate_binder()
2519 proc->pid, thread->pid, (u64)fp->binder, in binder_translate_binder()
2525 if (security_binder_transfer_binder(proc->cred, target_proc->cred)) { in binder_translate_binder()
2558 struct binder_proc *proc = thread->proc; in binder_translate_handle() local
2564 node = binder_get_node_from_ref(proc, fp->handle, in binder_translate_handle()
2568 proc->pid, thread->pid, fp->handle); in binder_translate_handle()
2571 if (security_binder_transfer_binder(proc->cred, target_proc->cred)) { in binder_translate_handle()
2577 if (node->proc == target_proc) { in binder_translate_handle()
2584 if (node->proc) in binder_translate_handle()
2585 binder_inner_proc_lock(node->proc); in binder_translate_handle()
2587 __acquire(&node->proc->inner_lock); in binder_translate_handle()
2591 if (node->proc) in binder_translate_handle()
2592 binder_inner_proc_unlock(node->proc); in binder_translate_handle()
2594 __release(&node->proc->inner_lock); in binder_translate_handle()
2632 struct binder_proc *proc = thread->proc; in binder_translate_fd() local
2645 proc->pid, thread->pid, in binder_translate_fd()
2655 proc->pid, thread->pid, fd); in binder_translate_fd()
2659 ret = security_binder_transfer_file(proc->cred, target_proc->cred, file); in binder_translate_fd()
2945 struct binder_proc *proc = thread->proc; in binder_translate_fd_array() local
2954 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2961 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2979 proc->pid, thread->pid); in binder_translate_fd_array()
3012 struct binder_proc *proc = thread->proc; in binder_fixup_parent() local
3026 proc->pid, thread->pid); in binder_fixup_parent()
3035 proc->pid, thread->pid); in binder_fixup_parent()
3043 proc->pid, thread->pid); in binder_fixup_parent()
3069 struct binder_proc *proc, in binder_proc_transaction() argument
3086 binder_inner_proc_lock(proc); in binder_proc_transaction()
3088 if (proc->is_dead || (thread && thread->is_dead)) { in binder_proc_transaction()
3089 binder_inner_proc_unlock(proc); in binder_proc_transaction()
3095 thread = binder_select_thread_ilocked(proc); in binder_proc_transaction()
3100 binder_enqueue_work_ilocked(&t->work, &proc->todo); in binder_proc_transaction()
3105 binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */); in binder_proc_transaction()
3107 binder_inner_proc_unlock(proc); in binder_proc_transaction()
3142 if (node->proc) { in binder_get_node_refs_for_txn()
3146 node->proc->tmp_ref++; in binder_get_node_refs_for_txn()
3147 *procp = node->proc; in binder_get_node_refs_for_txn()
3155 static void binder_transaction(struct binder_proc *proc, in binder_transaction() argument
3179 struct binder_context *context = proc->context; in binder_transaction()
3193 e->from_proc = proc->pid; in binder_transaction()
3198 strscpy(e->context_name, proc->context->name, BINDERFS_MAX_NAME); in binder_transaction()
3201 binder_inner_proc_lock(proc); in binder_transaction()
3204 binder_inner_proc_unlock(proc); in binder_transaction()
3206 proc->pid, thread->pid); in binder_transaction()
3215 proc->pid, thread->pid, in_reply_to->debug_id, in binder_transaction()
3221 binder_inner_proc_unlock(proc); in binder_transaction()
3229 binder_inner_proc_unlock(proc); in binder_transaction()
3234 __release(&target_thread->proc->inner_lock); in binder_transaction()
3241 proc->pid, thread->pid, in binder_transaction()
3245 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
3253 target_proc = target_thread->proc; in binder_transaction()
3255 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
3267 binder_proc_lock(proc); in binder_transaction()
3268 ref = binder_get_ref_olocked(proc, tr->target.handle, in binder_transaction()
3276 proc->pid, thread->pid); in binder_transaction()
3279 binder_proc_unlock(proc); in binder_transaction()
3290 if (target_node && target_proc->pid == proc->pid) { in binder_transaction()
3292 proc->pid, thread->pid); in binder_transaction()
3308 if (WARN_ON(proc == target_proc)) { in binder_transaction()
3314 if (security_binder_transaction(proc->cred, in binder_transaction()
3321 binder_inner_proc_lock(proc); in binder_transaction()
3337 proc->pid, thread->pid); in binder_transaction()
3338 binder_inner_proc_unlock(proc); in binder_transaction()
3352 proc->pid, thread->pid, tmp->debug_id, in binder_transaction()
3357 binder_inner_proc_unlock(proc); in binder_transaction()
3368 if (from && from->proc == target_proc) { in binder_transaction()
3378 binder_inner_proc_unlock(proc); in binder_transaction()
3410 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3419 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3435 t->async_from_pid = thread->proc->pid; in binder_transaction()
3439 t->sender_euid = task_euid(proc->tsk); in binder_transaction()
3454 security_cred_getsecid(proc->cred, &secid); in binder_transaction()
3521 proc->pid, thread->pid); in binder_transaction()
3529 proc->pid, thread->pid, (u64)tr->offsets_size); in binder_transaction()
3537 proc->pid, thread->pid, in binder_transaction()
3582 proc->pid, thread->pid); in binder_transaction()
3592 proc->pid, thread->pid, in binder_transaction()
3682 proc->pid, thread->pid); in binder_transaction()
3695 proc->pid, thread->pid); in binder_transaction()
3706 binder_get_object(proc, user_buffer, t->buffer, in binder_transaction()
3710 proc->pid, thread->pid, in binder_transaction()
3745 proc->pid, thread->pid); in binder_transaction()
3788 proc->pid, thread->pid, hdr->type); in binder_transaction()
3802 proc->pid, thread->pid); in binder_transaction()
3813 proc->pid, thread->pid); in binder_transaction()
3840 binder_inner_proc_lock(proc); in binder_transaction()
3855 binder_inner_proc_unlock(proc); in binder_transaction()
3857 binder_inner_proc_lock(proc); in binder_transaction()
3859 binder_inner_proc_unlock(proc); in binder_transaction()
3888 binder_dequeue_work(proc, tcomplete); in binder_transaction()
3931 proc->pid, thread->pid, return_error, return_error_param, in binder_transaction()
3975 binder_free_buf(struct binder_proc *proc, in binder_free_buf() argument
3979 binder_inner_proc_lock(proc); in binder_free_buf()
3984 binder_inner_proc_unlock(proc); in binder_free_buf()
3992 BUG_ON(buf_node->proc != proc); in binder_free_buf()
3999 w, &proc->todo); in binder_free_buf()
4000 binder_wakeup_proc_ilocked(proc); in binder_free_buf()
4005 binder_release_entire_buffer(proc, thread, buffer, is_failure); in binder_free_buf()
4006 binder_alloc_free_buf(&proc->alloc, buffer); in binder_free_buf()
4009 static int binder_thread_write(struct binder_proc *proc, in binder_thread_write() argument
4015 struct binder_context *context = proc->context; in binder_thread_write()
4029 atomic_inc(&proc->stats.bc[_IOC_NR(cmd)]); in binder_thread_write()
4053 if (ctx_mgr_node->proc == proc) { in binder_thread_write()
4055 proc->pid, thread->pid); in binder_thread_write()
4060 proc, ctx_mgr_node, in binder_thread_write()
4067 proc, target, increment, strong, in binder_thread_write()
4071 proc->pid, thread->pid, in binder_thread_write()
4091 proc->pid, thread->pid, debug_string, in binder_thread_write()
4097 proc->pid, thread->pid, debug_string, in binder_thread_write()
4115 node = binder_get_node(proc, node_ptr); in binder_thread_write()
4118 proc->pid, thread->pid, in binder_thread_write()
4127 proc->pid, thread->pid, in binder_thread_write()
4139 proc->pid, thread->pid, in binder_thread_write()
4149 proc->pid, thread->pid, in binder_thread_write()
4162 proc->pid, thread->pid, in binder_thread_write()
4185 buffer = binder_alloc_prepare_to_free(&proc->alloc, in binder_thread_write()
4191 proc->pid, thread->pid, in binder_thread_write()
4196 proc->pid, thread->pid, in binder_thread_write()
4203 proc->pid, thread->pid, (u64)data_ptr, in binder_thread_write()
4206 binder_free_buf(proc, thread, buffer, false); in binder_thread_write()
4217 binder_transaction(proc, thread, &tr.transaction_data, in binder_thread_write()
4228 binder_transaction(proc, thread, &tr, in binder_thread_write()
4236 proc->pid, thread->pid); in binder_thread_write()
4237 binder_inner_proc_lock(proc); in binder_thread_write()
4241 proc->pid, thread->pid); in binder_thread_write()
4242 } else if (proc->requested_threads == 0) { in binder_thread_write()
4245 proc->pid, thread->pid); in binder_thread_write()
4247 proc->requested_threads--; in binder_thread_write()
4248 proc->requested_threads_started++; in binder_thread_write()
4251 binder_inner_proc_unlock(proc); in binder_thread_write()
4256 proc->pid, thread->pid); in binder_thread_write()
4260 proc->pid, thread->pid); in binder_thread_write()
4267 proc->pid, thread->pid); in binder_thread_write()
4300 proc->pid, thread->pid); in binder_thread_write()
4304 binder_proc_lock(proc); in binder_thread_write()
4305 ref = binder_get_ref_olocked(proc, target, false); in binder_thread_write()
4308 proc->pid, thread->pid, in binder_thread_write()
4313 binder_proc_unlock(proc); in binder_thread_write()
4320 proc->pid, thread->pid, in binder_thread_write()
4332 proc->pid, thread->pid); in binder_thread_write()
4334 binder_proc_unlock(proc); in binder_thread_write()
4342 if (ref->node->proc == NULL) { in binder_thread_write()
4345 binder_inner_proc_lock(proc); in binder_thread_write()
4347 &ref->death->work, &proc->todo); in binder_thread_write()
4348 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
4349 binder_inner_proc_unlock(proc); in binder_thread_write()
4354 proc->pid, thread->pid); in binder_thread_write()
4356 binder_proc_unlock(proc); in binder_thread_write()
4362 proc->pid, thread->pid, in binder_thread_write()
4366 binder_proc_unlock(proc); in binder_thread_write()
4370 binder_inner_proc_lock(proc); in binder_thread_write()
4382 &proc->todo); in binder_thread_write()
4384 proc); in binder_thread_write()
4390 binder_inner_proc_unlock(proc); in binder_thread_write()
4393 binder_proc_unlock(proc); in binder_thread_write()
4404 binder_inner_proc_lock(proc); in binder_thread_write()
4405 list_for_each_entry(w, &proc->delivered_death, in binder_thread_write()
4419 proc->pid, thread->pid, (u64)cookie, in binder_thread_write()
4423 proc->pid, thread->pid, (u64)cookie); in binder_thread_write()
4424 binder_inner_proc_unlock(proc); in binder_thread_write()
4438 &proc->todo); in binder_thread_write()
4439 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
4442 binder_inner_proc_unlock(proc); in binder_thread_write()
4447 proc->pid, thread->pid, cmd); in binder_thread_write()
4455 static void binder_stat_br(struct binder_proc *proc, in binder_stat_br() argument
4461 atomic_inc(&proc->stats.br[_IOC_NR(cmd)]); in binder_stat_br()
4466 static int binder_put_node_cmd(struct binder_proc *proc, in binder_put_node_cmd() argument
4488 binder_stat_br(proc, thread, cmd); in binder_put_node_cmd()
4490 proc->pid, thread->pid, cmd_name, node_debug_id, in binder_put_node_cmd()
4501 struct binder_proc *proc = thread->proc; in binder_wait_for_work() local
4505 binder_inner_proc_lock(proc); in binder_wait_for_work()
4512 &proc->waiting_threads); in binder_wait_for_work()
4513 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4515 binder_inner_proc_lock(proc); in binder_wait_for_work()
4523 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4543 static int binder_apply_fd_fixups(struct binder_proc *proc, in binder_apply_fd_fixups() argument
4565 if (binder_alloc_copy_to_buffer(&proc->alloc, t->buffer, in binder_apply_fd_fixups()
4579 err = binder_alloc_copy_from_buffer(&proc->alloc, &fd, in binder_apply_fd_fixups()
4594 static int binder_thread_read(struct binder_proc *proc, in binder_thread_read() argument
4613 binder_inner_proc_lock(proc); in binder_thread_read()
4615 binder_inner_proc_unlock(proc); in binder_thread_read()
4621 !binder_worklist_empty(proc, &thread->todo)); in binder_thread_read()
4626 proc->pid, thread->pid, thread->looper); in binder_thread_read()
4630 binder_set_nice(proc->default_priority); in binder_thread_read()
4655 binder_inner_proc_lock(proc); in binder_thread_read()
4658 else if (!binder_worklist_empty_ilocked(&proc->todo) && in binder_thread_read()
4660 list = &proc->todo; in binder_thread_read()
4662 binder_inner_proc_unlock(proc); in binder_thread_read()
4671 binder_inner_proc_unlock(proc); in binder_thread_read()
4680 binder_inner_proc_unlock(proc); in binder_thread_read()
4688 binder_inner_proc_unlock(proc); in binder_thread_read()
4695 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4698 binder_inner_proc_unlock(proc); in binder_thread_read()
4706 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4709 proc->pid, thread->pid); in binder_thread_read()
4721 BUG_ON(proc != node->proc); in binder_thread_read()
4747 proc->pid, thread->pid, in binder_thread_read()
4751 rb_erase(&node->rb_node, &proc->nodes); in binder_thread_read()
4752 binder_inner_proc_unlock(proc); in binder_thread_read()
4766 binder_inner_proc_unlock(proc); in binder_thread_read()
4770 proc, thread, &ptr, node_ptr, in binder_thread_read()
4775 proc, thread, &ptr, node_ptr, in binder_thread_read()
4780 proc, thread, &ptr, node_ptr, in binder_thread_read()
4785 proc, thread, &ptr, node_ptr, in binder_thread_read()
4791 proc->pid, thread->pid, in binder_thread_read()
4814 proc->pid, thread->pid, in binder_thread_read()
4820 binder_inner_proc_unlock(proc); in binder_thread_read()
4825 w, &proc->delivered_death); in binder_thread_read()
4826 binder_inner_proc_unlock(proc); in binder_thread_read()
4835 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4840 binder_inner_proc_unlock(proc); in binder_thread_read()
4842 proc->pid, thread->pid, w->type); in binder_thread_read()
4874 struct task_struct *sender = t_from->proc->tsk; in binder_thread_read()
4883 ret = binder_apply_fd_fixups(proc, t); in binder_thread_read()
4894 binder_free_buf(proc, thread, buffer, true); in binder_thread_read()
4897 proc->pid, thread->pid, in binder_thread_read()
4906 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4945 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4948 proc->pid, thread->pid, in binder_thread_read()
4952 t->debug_id, t_from ? t_from->proc->pid : 0, in binder_thread_read()
4962 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4965 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4968 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4972 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4982 binder_inner_proc_lock(proc); in binder_thread_read()
4983 if (proc->requested_threads == 0 && in binder_thread_read()
4984 list_empty(&thread->proc->waiting_threads) && in binder_thread_read()
4985 proc->requested_threads_started < proc->max_threads && in binder_thread_read()
4989 proc->requested_threads++; in binder_thread_read()
4990 binder_inner_proc_unlock(proc); in binder_thread_read()
4993 proc->pid, thread->pid); in binder_thread_read()
4996 binder_stat_br(proc, thread, BR_SPAWN_LOOPER); in binder_thread_read()
4998 binder_inner_proc_unlock(proc); in binder_thread_read()
5002 static void binder_release_work(struct binder_proc *proc, in binder_release_work() argument
5009 binder_inner_proc_lock(proc); in binder_release_work()
5012 binder_inner_proc_unlock(proc); in binder_release_work()
5062 struct binder_proc *proc, struct binder_thread *new_thread) in binder_get_thread_ilocked() argument
5066 struct rb_node **p = &proc->threads.rb_node; in binder_get_thread_ilocked()
5083 thread->proc = proc; in binder_get_thread_ilocked()
5089 rb_insert_color(&thread->rb_node, &proc->threads); in binder_get_thread_ilocked()
5099 static struct binder_thread *binder_get_thread(struct binder_proc *proc) in binder_get_thread() argument
5104 binder_inner_proc_lock(proc); in binder_get_thread()
5105 thread = binder_get_thread_ilocked(proc, NULL); in binder_get_thread()
5106 binder_inner_proc_unlock(proc); in binder_get_thread()
5111 binder_inner_proc_lock(proc); in binder_get_thread()
5112 thread = binder_get_thread_ilocked(proc, new_thread); in binder_get_thread()
5113 binder_inner_proc_unlock(proc); in binder_get_thread()
5120 static void binder_free_proc(struct binder_proc *proc) in binder_free_proc() argument
5124 BUG_ON(!list_empty(&proc->todo)); in binder_free_proc()
5125 BUG_ON(!list_empty(&proc->delivered_death)); in binder_free_proc()
5126 device = container_of(proc->context, struct binder_device, context); in binder_free_proc()
5128 kfree(proc->context->name); in binder_free_proc()
5131 binder_alloc_deferred_release(&proc->alloc); in binder_free_proc()
5132 put_task_struct(proc->tsk); in binder_free_proc()
5133 put_cred(proc->cred); in binder_free_proc()
5135 kfree(proc); in binder_free_proc()
5142 binder_proc_dec_tmpref(thread->proc); in binder_free_thread()
5146 static int binder_thread_release(struct binder_proc *proc, in binder_thread_release() argument
5154 binder_inner_proc_lock(thread->proc); in binder_thread_release()
5161 proc->tmp_ref++; in binder_thread_release()
5167 rb_erase(&thread->rb_node, &proc->threads); in binder_thread_release()
5183 proc->pid, thread->pid, in binder_thread_release()
5220 binder_inner_proc_unlock(thread->proc); in binder_thread_release()
5234 binder_release_work(proc, &thread->todo); in binder_thread_release()
5242 struct binder_proc *proc = filp->private_data; in binder_poll() local
5246 thread = binder_get_thread(proc); in binder_poll()
5250 binder_inner_proc_lock(thread->proc); in binder_poll()
5254 binder_inner_proc_unlock(thread->proc); in binder_poll()
5269 struct binder_proc *proc = filp->private_data; in binder_ioctl_write_read() local
5284 proc->pid, thread->pid, in binder_ioctl_write_read()
5289 ret = binder_thread_write(proc, thread, in binder_ioctl_write_read()
5302 ret = binder_thread_read(proc, thread, bwr.read_buffer, in binder_ioctl_write_read()
5307 binder_inner_proc_lock(proc); in binder_ioctl_write_read()
5308 if (!binder_worklist_empty_ilocked(&proc->todo)) in binder_ioctl_write_read()
5309 binder_wakeup_proc_ilocked(proc); in binder_ioctl_write_read()
5310 binder_inner_proc_unlock(proc); in binder_ioctl_write_read()
5319 proc->pid, thread->pid, in binder_ioctl_write_read()
5334 struct binder_proc *proc = filp->private_data; in binder_ioctl_set_ctx_mgr() local
5335 struct binder_context *context = proc->context; in binder_ioctl_set_ctx_mgr()
5345 ret = security_binder_set_context_mgr(proc->cred); in binder_ioctl_set_ctx_mgr()
5360 new_node = binder_new_node(proc, fbo); in binder_ioctl_set_ctx_mgr()
5378 static int binder_ioctl_get_node_info_for_ref(struct binder_proc *proc, in binder_ioctl_get_node_info_for_ref() argument
5382 struct binder_context *context = proc->context; in binder_ioctl_get_node_info_for_ref()
5388 proc->pid); in binder_ioctl_get_node_info_for_ref()
5395 context->binder_context_mgr_node->proc != proc) { in binder_ioctl_get_node_info_for_ref()
5401 node = binder_get_node_from_ref(proc, handle, true, NULL); in binder_ioctl_get_node_info_for_ref()
5414 static int binder_ioctl_get_node_debug_info(struct binder_proc *proc, in binder_ioctl_get_node_debug_info() argument
5422 binder_inner_proc_lock(proc); in binder_ioctl_get_node_debug_info()
5423 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in binder_ioctl_get_node_debug_info()
5434 binder_inner_proc_unlock(proc); in binder_ioctl_get_node_debug_info()
5442 struct binder_proc *proc = filp->private_data; in binder_ioctl() local
5450 binder_selftest_alloc(&proc->alloc); in binder_ioctl()
5458 thread = binder_get_thread(proc); in binder_ioctl()
5478 binder_inner_proc_lock(proc); in binder_ioctl()
5479 proc->max_threads = max_threads; in binder_ioctl()
5480 binder_inner_proc_unlock(proc); in binder_ioctl()
5502 proc->pid, thread->pid); in binder_ioctl()
5503 binder_thread_release(proc, thread); in binder_ioctl()
5528 ret = binder_ioctl_get_node_info_for_ref(proc, &info); in binder_ioctl()
5547 ret = binder_ioctl_get_node_debug_info(proc, &info); in binder_ioctl()
5579 binder_inner_proc_lock(proc); in binder_ioctl()
5582 binder_inner_proc_unlock(proc); in binder_ioctl()
5604 pr_info("%d:%d ioctl %x %lx returned %d\n", proc->pid, current->pid, cmd, arg, ret); in binder_ioctl()
5612 struct binder_proc *proc = vma->vm_private_data; in binder_vma_open() local
5616 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_open()
5623 struct binder_proc *proc = vma->vm_private_data; in binder_vma_close() local
5627 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_close()
5630 binder_alloc_vma_close(&proc->alloc); in binder_vma_close()
5646 struct binder_proc *proc = filp->private_data; in binder_mmap() local
5648 if (proc->tsk != current->group_leader) in binder_mmap()
5653 __func__, proc->pid, vma->vm_start, vma->vm_end, in binder_mmap()
5659 proc->pid, vma->vm_start, vma->vm_end, "bad vm_flags", -EPERM); in binder_mmap()
5666 vma->vm_private_data = proc; in binder_mmap()
5668 return binder_alloc_mmap_handler(&proc->alloc, vma); in binder_mmap()
5673 struct binder_proc *proc, *itr; in binder_open() local
5682 proc = kzalloc(sizeof(*proc), GFP_KERNEL); in binder_open()
5683 if (proc == NULL) in binder_open()
5685 spin_lock_init(&proc->inner_lock); in binder_open()
5686 spin_lock_init(&proc->outer_lock); in binder_open()
5688 proc->tsk = current->group_leader; in binder_open()
5689 proc->cred = get_cred(filp->f_cred); in binder_open()
5690 INIT_LIST_HEAD(&proc->todo); in binder_open()
5691 proc->default_priority = task_nice(current); in binder_open()
5702 proc->context = &binder_dev->context; in binder_open()
5703 binder_alloc_init(&proc->alloc); in binder_open()
5706 proc->pid = current->group_leader->pid; in binder_open()
5707 INIT_LIST_HEAD(&proc->delivered_death); in binder_open()
5708 INIT_LIST_HEAD(&proc->waiting_threads); in binder_open()
5709 filp->private_data = proc; in binder_open()
5713 if (itr->pid == proc->pid) { in binder_open()
5718 hlist_add_head(&proc->proc_node, &binder_procs); in binder_open()
5724 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5731 proc->debugfs_entry = debugfs_create_file(strbuf, 0444, in binder_open()
5733 (void *)(unsigned long)proc->pid, in binder_open()
5741 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5749 strbuf, &proc_fops, (void *)(unsigned long)proc->pid); in binder_open()
5751 proc->binderfs_entry = binderfs_entry; in binder_open()
5766 struct binder_proc *proc = filp->private_data; in binder_flush() local
5768 binder_defer_work(proc, BINDER_DEFERRED_FLUSH); in binder_flush()
5773 static void binder_deferred_flush(struct binder_proc *proc) in binder_deferred_flush() argument
5778 binder_inner_proc_lock(proc); in binder_deferred_flush()
5779 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_deferred_flush()
5788 binder_inner_proc_unlock(proc); in binder_deferred_flush()
5791 "binder_flush: %d woke %d threads\n", proc->pid, in binder_deferred_flush()
5797 struct binder_proc *proc = filp->private_data; in binder_release() local
5799 debugfs_remove(proc->debugfs_entry); in binder_release()
5801 if (proc->binderfs_entry) { in binder_release()
5802 binderfs_remove_file(proc->binderfs_entry); in binder_release()
5803 proc->binderfs_entry = NULL; in binder_release()
5806 binder_defer_work(proc, BINDER_DEFERRED_RELEASE); in binder_release()
5815 struct binder_proc *proc = node->proc; in binder_node_release() local
5817 binder_release_work(proc, &node->async_todo); in binder_node_release()
5820 binder_inner_proc_lock(proc); in binder_node_release()
5827 binder_inner_proc_unlock(proc); in binder_node_release()
5834 node->proc = NULL; in binder_node_release()
5837 binder_inner_proc_unlock(proc); in binder_node_release()
5851 binder_inner_proc_lock(ref->proc); in binder_node_release()
5853 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5862 &ref->proc->todo); in binder_node_release()
5863 binder_wakeup_proc_ilocked(ref->proc); in binder_node_release()
5864 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5876 static void binder_deferred_release(struct binder_proc *proc) in binder_deferred_release() argument
5878 struct binder_context *context = proc->context; in binder_deferred_release()
5883 hlist_del(&proc->proc_node); in binder_deferred_release()
5888 context->binder_context_mgr_node->proc == proc) { in binder_deferred_release()
5891 __func__, proc->pid); in binder_deferred_release()
5895 binder_inner_proc_lock(proc); in binder_deferred_release()
5900 proc->tmp_ref++; in binder_deferred_release()
5902 proc->is_dead = true; in binder_deferred_release()
5905 while ((n = rb_first(&proc->threads))) { in binder_deferred_release()
5909 binder_inner_proc_unlock(proc); in binder_deferred_release()
5911 active_transactions += binder_thread_release(proc, thread); in binder_deferred_release()
5912 binder_inner_proc_lock(proc); in binder_deferred_release()
5917 while ((n = rb_first(&proc->nodes))) { in binder_deferred_release()
5928 rb_erase(&node->rb_node, &proc->nodes); in binder_deferred_release()
5929 binder_inner_proc_unlock(proc); in binder_deferred_release()
5931 binder_inner_proc_lock(proc); in binder_deferred_release()
5933 binder_inner_proc_unlock(proc); in binder_deferred_release()
5936 binder_proc_lock(proc); in binder_deferred_release()
5937 while ((n = rb_first(&proc->refs_by_desc))) { in binder_deferred_release()
5943 binder_proc_unlock(proc); in binder_deferred_release()
5945 binder_proc_lock(proc); in binder_deferred_release()
5947 binder_proc_unlock(proc); in binder_deferred_release()
5949 binder_release_work(proc, &proc->todo); in binder_deferred_release()
5950 binder_release_work(proc, &proc->delivered_death); in binder_deferred_release()
5954 __func__, proc->pid, threads, nodes, incoming_refs, in binder_deferred_release()
5957 binder_proc_dec_tmpref(proc); in binder_deferred_release()
5962 struct binder_proc *proc; in binder_deferred_func() local
5969 proc = hlist_entry(binder_deferred_list.first, in binder_deferred_func()
5971 hlist_del_init(&proc->deferred_work_node); in binder_deferred_func()
5972 defer = proc->deferred_work; in binder_deferred_func()
5973 proc->deferred_work = 0; in binder_deferred_func()
5975 proc = NULL; in binder_deferred_func()
5981 binder_deferred_flush(proc); in binder_deferred_func()
5984 binder_deferred_release(proc); /* frees proc */ in binder_deferred_func()
5985 } while (proc); in binder_deferred_func()
5990 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer) in binder_defer_work() argument
5993 proc->deferred_work |= defer; in binder_defer_work()
5994 if (hlist_unhashed(&proc->deferred_work_node)) { in binder_defer_work()
5995 hlist_add_head(&proc->deferred_work_node, in binder_defer_work()
6003 struct binder_proc *proc, in print_binder_transaction_ilocked() argument
6015 t->from ? t->from->proc->pid : 0, in print_binder_transaction_ilocked()
6022 if (proc != to_proc) { in print_binder_transaction_ilocked()
6043 struct binder_proc *proc, in print_binder_work_ilocked() argument
6055 m, proc, transaction_prefix, t); in print_binder_work_ilocked()
6105 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6109 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6113 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
6119 print_binder_work_ilocked(m, thread->proc, " ", in print_binder_thread_ilocked()
6145 seq_printf(m, " %d", ref->proc->pid); in print_binder_node_nilocked()
6148 if (node->proc) { in print_binder_node_nilocked()
6150 print_binder_work_ilocked(m, node->proc, " ", in print_binder_node_nilocked()
6161 ref->node->proc ? "" : "dead ", in print_binder_ref_olocked()
6168 struct binder_proc *proc, int print_all) in print_binder_proc() argument
6176 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc()
6177 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc()
6180 binder_inner_proc_lock(proc); in print_binder_proc()
6181 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc()
6185 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in print_binder_proc()
6198 binder_inner_proc_unlock(proc); in print_binder_proc()
6205 binder_inner_proc_lock(proc); in print_binder_proc()
6207 binder_inner_proc_unlock(proc); in print_binder_proc()
6212 binder_proc_lock(proc); in print_binder_proc()
6213 for (n = rb_first(&proc->refs_by_desc); in print_binder_proc()
6219 binder_proc_unlock(proc); in print_binder_proc()
6221 binder_alloc_print_allocated(m, &proc->alloc); in print_binder_proc()
6222 binder_inner_proc_lock(proc); in print_binder_proc()
6223 list_for_each_entry(w, &proc->todo, entry) in print_binder_proc()
6224 print_binder_work_ilocked(m, proc, " ", in print_binder_proc()
6226 list_for_each_entry(w, &proc->delivered_death, entry) { in print_binder_proc()
6230 binder_inner_proc_unlock(proc); in print_binder_proc()
6331 struct binder_proc *proc) in print_binder_proc_stats() argument
6338 binder_alloc_get_free_async_space(&proc->alloc); in print_binder_proc_stats()
6340 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc_stats()
6341 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc_stats()
6344 binder_inner_proc_lock(proc); in print_binder_proc_stats()
6345 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
6348 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_stats()
6354 " free async space %zd\n", proc->requested_threads, in print_binder_proc_stats()
6355 proc->requested_threads_started, proc->max_threads, in print_binder_proc_stats()
6359 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
6361 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
6366 binder_proc_lock(proc); in print_binder_proc_stats()
6367 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in print_binder_proc_stats()
6374 binder_proc_unlock(proc); in print_binder_proc_stats()
6377 count = binder_alloc_get_allocated_count(&proc->alloc); in print_binder_proc_stats()
6380 binder_alloc_print_pages(m, &proc->alloc); in print_binder_proc_stats()
6383 binder_inner_proc_lock(proc); in print_binder_proc_stats()
6384 list_for_each_entry(w, &proc->todo, entry) { in print_binder_proc_stats()
6388 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
6391 print_binder_stats(m, " ", &proc->stats); in print_binder_proc_stats()
6397 struct binder_proc *proc; in binder_state_show() local
6427 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_state_show()
6428 print_binder_proc(m, proc, 1); in binder_state_show()
6436 struct binder_proc *proc; in binder_stats_show() local
6443 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_stats_show()
6444 print_binder_proc_stats(m, proc); in binder_stats_show()
6452 struct binder_proc *proc; in binder_transactions_show() local
6456 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_transactions_show()
6457 print_binder_proc(m, proc, 0); in binder_transactions_show()
6554 from_pid = t->from ? (t->from->proc ? t->from->proc->pid : 0) : t->async_from_pid; in print_binder_transaction_brief_ilocked()
6588 struct binder_proc *proc, in print_binder_transaction_brief() argument
6598 binder_inner_proc_lock(proc); in print_binder_transaction_brief()
6599 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in print_binder_transaction_brief()
6615 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in print_binder_transaction_brief()
6624 binder_inner_proc_unlock(proc); in print_binder_transaction_brief()
6632 binder_inner_proc_lock(proc); in print_binder_transaction_brief()
6634 binder_inner_proc_unlock(proc); in print_binder_transaction_brief()
6644 struct binder_proc *proc) in print_binder_proc_brief() argument
6648 size_t free_async_space = binder_alloc_get_free_async_space(&proc->alloc); in print_binder_proc_brief()
6650 seq_printf(m, "%d\t", proc->pid); in print_binder_proc_brief()
6651 seq_printf(m, "%s\t", proc->context->name); in print_binder_proc_brief()
6653 binder_inner_proc_lock(proc); in print_binder_proc_brief()
6654 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_brief()
6658 "\t%zd\n", proc->requested_threads, in print_binder_proc_brief()
6659 proc->requested_threads_started, proc->max_threads, in print_binder_proc_brief()
6662 binder_inner_proc_unlock(proc); in print_binder_proc_brief()
6667 struct binder_proc *proc = NULL; in binder_transaction_proc_show() local
6672 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_transaction_proc_show()
6673 print_binder_transaction_brief(m, proc, now); in binder_transaction_proc_show()
6676 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_transaction_proc_show()
6677 print_binder_proc_brief(m, proc); in binder_transaction_proc_show()