Lines Matching full:proc

15  * 1) proc->outer_lock : protects binder_ref
21 * 3) proc->inner_lock : protects the thread and node lists
22 * (proc->threads, proc->waiting_threads, proc->nodes)
24 * (proc->todo, thread->todo, proc->delivered_death and
37 * foo_ilocked() : requires proc->inner_lock
38 * foo_oilocked(): requires proc->outer_lock and proc->inner_lock
39 * foo_nilocked(): requires node->lock and proc->inner_lock
94 DEFINE_SHOW_ATTRIBUTE(proc);
221 * There are separate work lists for proc, thread, and node (async).
248 * (protected by @proc->inner_lock)
249 * @rb_node: element for proc->nodes tree
250 * (protected by @proc->inner_lock)
253 * @proc: binder_proc that owns this node
259 * (protected by @proc->inner_lock if @proc
262 * (protected by @proc->inner_lock if @proc
265 * (protected by @proc->inner_lock if @proc
268 * (protected by @proc->inner_lock while @proc
270 * if @proc is NULL. During inc/dec and node release
272 * as the node dies and @proc becomes NULL)
278 * (protected by @proc->inner_lock if @proc
281 * (protected by @proc->inner_lock if @proc
284 * (protected by @proc->inner_lock if @proc
287 * (protected by @proc->inner_lock if @proc
298 * (protected by @proc->inner_lock)
310 struct binder_proc *proc; member
321 * proc inner_lock
343 * (protected by inner_lock of the proc that
372 * @rb_node_desc: node for lookup by @data.desc in proc's rb_tree
373 * @rb_node_node: node for lookup by @node in proc's rb_tree
376 * @proc: binder_proc containing ref
384 * structure is unsafe to access without holding @proc->outer_lock.
388 /* node + proc => ref (transaction) */
389 /* desc + proc => ref (transaction, inc/dec ref) */
390 /* node => refs + procs (proc exit) */
395 struct binder_proc *proc; member
408 * @threads: rbtree of binder_threads in this proc
411 * this proc ordered by node->ptr
417 * @waiting_threads: threads currently waiting for proc work
444 * @tmp_ref: temporary reference to indicate proc is in use
450 * @context: binder_context for this proc
499 * @proc: binder process for this thread
501 * @rb_node: element for proc->threads rbtree
502 * (protected by @proc->inner_lock)
503 * @waiting_thread_node: element for @proc->waiting_threads list
504 * (protected by @proc->inner_lock)
512 * (protected by @proc->inner_lock)
514 * (protected by @proc->inner_lock)
516 * (protected by @proc->inner_lock)
520 * (protected by @proc->inner_lock)
525 * (atomic since @proc->inner_lock cannot
529 * (protected by @proc->inner_lock)
534 struct binder_proc *proc; member
618 * @proc: struct binder_proc to acquire
620 * Acquires proc->outer_lock. Used to protect binder_ref
621 * structures associated with the given proc.
623 #define binder_proc_lock(proc) _binder_proc_lock(proc, __LINE__) argument
625 _binder_proc_lock(struct binder_proc *proc, int line) in _binder_proc_lock() argument
626 __acquires(&proc->outer_lock) in _binder_proc_lock()
630 spin_lock(&proc->outer_lock); in _binder_proc_lock()
635 * @proc: struct binder_proc to acquire
641 _binder_proc_unlock(struct binder_proc *proc, int line) in _binder_proc_unlock() argument
642 __releases(&proc->outer_lock) in _binder_proc_unlock()
646 spin_unlock(&proc->outer_lock); in _binder_proc_unlock()
651 * @proc: struct binder_proc to acquire
653 * Acquires proc->inner_lock. Used to protect todo lists
655 #define binder_inner_proc_lock(proc) _binder_inner_proc_lock(proc, __LINE__) argument
657 _binder_inner_proc_lock(struct binder_proc *proc, int line) in _binder_inner_proc_lock() argument
658 __acquires(&proc->inner_lock) in _binder_inner_proc_lock()
662 spin_lock(&proc->inner_lock); in _binder_inner_proc_lock()
667 * @proc: struct binder_proc to acquire
671 #define binder_inner_proc_unlock(proc) _binder_inner_proc_unlock(proc, __LINE__) argument
673 _binder_inner_proc_unlock(struct binder_proc *proc, int line) in _binder_inner_proc_unlock() argument
674 __releases(&proc->inner_lock) in _binder_inner_proc_unlock()
678 spin_unlock(&proc->inner_lock); in _binder_inner_proc_unlock()
717 * Acquires node->lock. If node->proc also acquires
718 * proc->inner_lock. Used to protect binder_node fields
723 __acquires(&node->lock) __acquires(&node->proc->inner_lock) in _binder_node_inner_lock()
728 if (node->proc) in _binder_node_inner_lock()
729 binder_inner_proc_lock(node->proc); in _binder_node_inner_lock()
732 __acquire(&node->proc->inner_lock); in _binder_node_inner_lock()
744 __releases(&node->lock) __releases(&node->proc->inner_lock) in _binder_node_inner_unlock()
746 struct binder_proc *proc = node->proc; in _binder_node_inner_unlock() local
750 if (proc) in _binder_node_inner_unlock()
751 binder_inner_proc_unlock(proc); in _binder_node_inner_unlock()
754 __release(&node->proc->inner_lock); in _binder_node_inner_unlock()
765 * @proc: binder_proc associated with list
770 static bool binder_worklist_empty(struct binder_proc *proc, in binder_worklist_empty() argument
775 binder_inner_proc_lock(proc); in binder_worklist_empty()
777 binder_inner_proc_unlock(proc); in binder_worklist_empty()
789 * Requires the proc->inner_lock to be held.
809 * Requires the proc->inner_lock to be held.
827 * Requires the proc->inner_lock to be held.
850 binder_inner_proc_lock(thread->proc); in binder_enqueue_thread_work()
852 binder_inner_proc_unlock(thread->proc); in binder_enqueue_thread_work()
863 * @proc: binder_proc associated with list
870 binder_dequeue_work(struct binder_proc *proc, struct binder_work *work) in binder_dequeue_work() argument
872 binder_inner_proc_lock(proc); in binder_dequeue_work()
874 binder_inner_proc_unlock(proc); in binder_dequeue_work()
889 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
891 static void binder_free_proc(struct binder_proc *proc);
900 !binder_worklist_empty_ilocked(&thread->proc->todo)); in binder_has_work_ilocked()
907 binder_inner_proc_lock(thread->proc); in binder_has_work()
909 binder_inner_proc_unlock(thread->proc); in binder_has_work()
922 static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc, in binder_wakeup_poll_threads_ilocked() argument
928 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_wakeup_poll_threads_ilocked()
941 * binder_select_thread_ilocked() - selects a thread for doing proc work.
942 * @proc: process to select a thread from
953 binder_select_thread_ilocked(struct binder_proc *proc) in binder_select_thread_ilocked() argument
957 assert_spin_locked(&proc->inner_lock); in binder_select_thread_ilocked()
958 thread = list_first_entry_or_null(&proc->waiting_threads, in binder_select_thread_ilocked()
969 * binder_wakeup_thread_ilocked() - wakes up a thread for doing proc work.
970 * @proc: process to wake up a thread in
974 * This function wakes up a thread in the @proc process.
984 static void binder_wakeup_thread_ilocked(struct binder_proc *proc, in binder_wakeup_thread_ilocked() argument
988 assert_spin_locked(&proc->inner_lock); in binder_wakeup_thread_ilocked()
998 /* Didn't find a thread waiting for proc work; this can happen in binder_wakeup_thread_ilocked()
1011 binder_wakeup_poll_threads_ilocked(proc, sync); in binder_wakeup_thread_ilocked()
1014 static void binder_wakeup_proc_ilocked(struct binder_proc *proc) in binder_wakeup_proc_ilocked() argument
1016 struct binder_thread *thread = binder_select_thread_ilocked(proc); in binder_wakeup_proc_ilocked()
1018 binder_wakeup_thread_ilocked(proc, thread, /* sync = */false); in binder_wakeup_proc_ilocked()
1039 static struct binder_node *binder_get_node_ilocked(struct binder_proc *proc, in binder_get_node_ilocked() argument
1042 struct rb_node *n = proc->nodes.rb_node; in binder_get_node_ilocked()
1045 assert_spin_locked(&proc->inner_lock); in binder_get_node_ilocked()
1067 static struct binder_node *binder_get_node(struct binder_proc *proc, in binder_get_node() argument
1072 binder_inner_proc_lock(proc); in binder_get_node()
1073 node = binder_get_node_ilocked(proc, ptr); in binder_get_node()
1074 binder_inner_proc_unlock(proc); in binder_get_node()
1079 struct binder_proc *proc, in binder_init_node_ilocked() argument
1083 struct rb_node **p = &proc->nodes.rb_node; in binder_init_node_ilocked()
1090 assert_spin_locked(&proc->inner_lock); in binder_init_node_ilocked()
1115 rb_insert_color(&node->rb_node, &proc->nodes); in binder_init_node_ilocked()
1117 node->proc = proc; in binder_init_node_ilocked()
1129 proc->pid, current->pid, node->debug_id, in binder_init_node_ilocked()
1135 static struct binder_node *binder_new_node(struct binder_proc *proc, in binder_new_node() argument
1143 binder_inner_proc_lock(proc); in binder_new_node()
1144 node = binder_init_node_ilocked(proc, new_node, fp); in binder_new_node()
1145 binder_inner_proc_unlock(proc); in binder_new_node()
1165 struct binder_proc *proc = node->proc; in binder_inc_node_nilocked() local
1168 if (proc) in binder_inc_node_nilocked()
1169 assert_spin_locked(&proc->inner_lock); in binder_inc_node_nilocked()
1174 !(node->proc && in binder_inc_node_nilocked()
1175 node == node->proc->context->binder_context_mgr_node && in binder_inc_node_nilocked()
1225 struct binder_proc *proc = node->proc; in binder_dec_node_nilocked() local
1228 if (proc) in binder_dec_node_nilocked()
1229 assert_spin_locked(&proc->inner_lock); in binder_dec_node_nilocked()
1245 if (proc && (node->has_strong_ref || node->has_weak_ref)) { in binder_dec_node_nilocked()
1247 binder_enqueue_work_ilocked(&node->work, &proc->todo); in binder_dec_node_nilocked()
1248 binder_wakeup_proc_ilocked(proc); in binder_dec_node_nilocked()
1253 if (proc) { in binder_dec_node_nilocked()
1255 rb_erase(&node->rb_node, &proc->nodes); in binder_dec_node_nilocked()
1311 * (node->proc is NULL), use binder_dead_nodes_lock to protect
1319 if (node->proc) in binder_inc_node_tmpref()
1320 binder_inner_proc_lock(node->proc); in binder_inc_node_tmpref()
1324 if (node->proc) in binder_inc_node_tmpref()
1325 binder_inner_proc_unlock(node->proc); in binder_inc_node_tmpref()
1342 if (!node->proc) in binder_dec_node_tmpref()
1348 if (!node->proc) in binder_dec_node_tmpref()
1369 static struct binder_ref *binder_get_ref_olocked(struct binder_proc *proc, in binder_get_ref_olocked() argument
1372 struct rb_node *n = proc->refs_by_desc.rb_node; in binder_get_ref_olocked()
1394 * @proc: binder_proc that owns the ref
1402 * into the given proc rb_trees and node refs list.
1411 struct binder_proc *proc, in binder_get_ref_for_node_olocked() argument
1415 struct binder_context *context = proc->context; in binder_get_ref_for_node_olocked()
1416 struct rb_node **p = &proc->refs_by_node.rb_node; in binder_get_ref_for_node_olocked()
1437 new_ref->proc = proc; in binder_get_ref_for_node_olocked()
1440 rb_insert_color(&new_ref->rb_node_node, &proc->refs_by_node); in binder_get_ref_for_node_olocked()
1443 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in binder_get_ref_for_node_olocked()
1450 p = &proc->refs_by_desc.rb_node; in binder_get_ref_for_node_olocked()
1463 rb_insert_color(&new_ref->rb_node_desc, &proc->refs_by_desc); in binder_get_ref_for_node_olocked()
1470 proc->pid, new_ref->data.debug_id, new_ref->data.desc, in binder_get_ref_for_node_olocked()
1482 ref->proc->pid, ref->data.debug_id, ref->data.desc, in binder_cleanup_ref_olocked()
1485 rb_erase(&ref->rb_node_desc, &ref->proc->refs_by_desc); in binder_cleanup_ref_olocked()
1486 rb_erase(&ref->rb_node_node, &ref->proc->refs_by_node); in binder_cleanup_ref_olocked()
1510 ref->proc->pid, ref->data.debug_id, in binder_cleanup_ref_olocked()
1512 binder_dequeue_work(ref->proc, &ref->death->work); in binder_cleanup_ref_olocked()
1524 * Increment the ref. @ref->proc->outer_lock must be held on entry
1565 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1576 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1591 * binder_get_node_from_ref() - get the node from the given proc/desc
1592 * @proc: proc containing the ref
1597 * Given a proc and ref handle, return the associated binder_node
1602 struct binder_proc *proc, in binder_get_node_from_ref() argument
1609 binder_proc_lock(proc); in binder_get_node_from_ref()
1610 ref = binder_get_ref_olocked(proc, desc, need_strong_ref); in binder_get_node_from_ref()
1621 binder_proc_unlock(proc); in binder_get_node_from_ref()
1626 binder_proc_unlock(proc); in binder_get_node_from_ref()
1647 * @proc: proc containing the ref
1653 * Given a proc and ref handle, increment or decrement the ref
1658 static int binder_update_ref_for_handle(struct binder_proc *proc, in binder_update_ref_for_handle() argument
1666 binder_proc_lock(proc); in binder_update_ref_for_handle()
1667 ref = binder_get_ref_olocked(proc, desc, strong); in binder_update_ref_for_handle()
1679 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1686 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1692 * @proc: proc containing the ref
1701 static int binder_dec_ref_for_handle(struct binder_proc *proc, in binder_dec_ref_for_handle() argument
1704 return binder_update_ref_for_handle(proc, desc, false, strong, rdata); in binder_dec_ref_for_handle()
1709 * binder_inc_ref_for_node() - increment the ref for given proc/node
1710 * @proc: proc containing the ref
1716 * Given a proc and node, increment the ref. Create the ref if it
1721 static int binder_inc_ref_for_node(struct binder_proc *proc, in binder_inc_ref_for_node() argument
1731 binder_proc_lock(proc); in binder_inc_ref_for_node()
1732 ref = binder_get_ref_for_node_olocked(proc, node, NULL); in binder_inc_ref_for_node()
1734 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1738 binder_proc_lock(proc); in binder_inc_ref_for_node()
1739 ref = binder_get_ref_for_node_olocked(proc, node, new_ref); in binder_inc_ref_for_node()
1743 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1757 assert_spin_locked(&target_thread->proc->inner_lock); in binder_pop_transaction_ilocked()
1783 binder_inner_proc_lock(thread->proc); in binder_thread_dec_tmpref()
1786 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1790 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1794 * binder_proc_dec_tmpref() - decrement proc->tmp_ref
1795 * @proc: proc to decrement
1798 * handle a transaction. proc->tmp_ref is incremented when
1802 * proc if appropriate (proc has been released, all threads have
1805 static void binder_proc_dec_tmpref(struct binder_proc *proc) in binder_proc_dec_tmpref() argument
1807 binder_inner_proc_lock(proc); in binder_proc_dec_tmpref()
1808 proc->tmp_ref--; in binder_proc_dec_tmpref()
1809 if (proc->is_dead && RB_EMPTY_ROOT(&proc->threads) && in binder_proc_dec_tmpref()
1810 !proc->tmp_ref) { in binder_proc_dec_tmpref()
1811 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1812 binder_free_proc(proc); in binder_proc_dec_tmpref()
1815 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1845 * Same as binder_get_txn_from() except it also acquires the proc->inner_lock
1854 __acquires(&t->from->proc->inner_lock) in binder_get_txn_from_and_acq_inner()
1860 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
1863 binder_inner_proc_lock(from->proc); in binder_get_txn_from_and_acq_inner()
1868 binder_inner_proc_unlock(from->proc); in binder_get_txn_from_and_acq_inner()
1869 __acquire(&from->proc->inner_lock); in binder_get_txn_from_and_acq_inner()
1927 target_thread->proc->pid, in binder_send_failed_reply()
1947 binder_inner_proc_unlock(target_thread->proc); in binder_send_failed_reply()
1952 __release(&target_thread->proc->inner_lock); in binder_send_failed_reply()
1994 * @proc: binder_proc owning the buffer
2003 static size_t binder_get_object(struct binder_proc *proc, in binder_get_object() argument
2014 binder_alloc_copy_from_buffer(&proc->alloc, object, buffer, in binder_get_object()
2048 * @proc: binder_proc owning the buffer
2069 struct binder_proc *proc, in binder_validate_ptr() argument
2085 if (binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_validate_ptr()
2089 object_size = binder_get_object(proc, b, object_offset, object); in binder_validate_ptr()
2100 * @proc: binder_proc owning the buffer
2137 static bool binder_validate_fixup(struct binder_proc *proc, in binder_validate_fixup() argument
2154 size_t object_size = binder_get_object(proc, b, last_obj_offset, in binder_validate_fixup()
2169 if (binder_alloc_copy_from_buffer(&proc->alloc, in binder_validate_fixup()
2238 static void binder_transaction_buffer_release(struct binder_proc *proc, in binder_transaction_buffer_release() argument
2248 proc->pid, buffer->debug_id, in binder_transaction_buffer_release()
2265 if (!binder_alloc_copy_from_buffer(&proc->alloc, &object_offset, in binder_transaction_buffer_release()
2268 object_size = binder_get_object(proc, buffer, in binder_transaction_buffer_release()
2283 node = binder_get_node(proc, fp->binder); in binder_transaction_buffer_release()
2303 ret = binder_dec_ref_for_handle(proc, fp->handle, in binder_transaction_buffer_release()
2342 if (proc->tsk != current->group_leader) { in binder_transaction_buffer_release()
2354 parent = binder_validate_ptr(proc, buffer, &ptr_object, in binder_transaction_buffer_release()
2395 &proc->alloc, &fd, buffer, in binder_transaction_buffer_release()
2415 struct binder_proc *proc = thread->proc; in binder_translate_binder() local
2420 node = binder_get_node(proc, fp->binder); in binder_translate_binder()
2422 node = binder_new_node(proc, fp); in binder_translate_binder()
2428 proc->pid, thread->pid, (u64)fp->binder, in binder_translate_binder()
2434 if (security_binder_transfer_binder(proc->tsk, target_proc->tsk)) { in binder_translate_binder()
2467 struct binder_proc *proc = thread->proc; in binder_translate_handle() local
2473 node = binder_get_node_from_ref(proc, fp->handle, in binder_translate_handle()
2477 proc->pid, thread->pid, fp->handle); in binder_translate_handle()
2480 if (security_binder_transfer_binder(proc->tsk, target_proc->tsk)) { in binder_translate_handle()
2486 if (node->proc == target_proc) { in binder_translate_handle()
2493 if (node->proc) in binder_translate_handle()
2494 binder_inner_proc_lock(node->proc); in binder_translate_handle()
2496 __acquire(&node->proc->inner_lock); in binder_translate_handle()
2500 if (node->proc) in binder_translate_handle()
2501 binder_inner_proc_unlock(node->proc); in binder_translate_handle()
2503 __release(&node->proc->inner_lock); in binder_translate_handle()
2541 struct binder_proc *proc = thread->proc; in binder_translate_fd() local
2554 proc->pid, thread->pid, in binder_translate_fd()
2564 proc->pid, thread->pid, fd); in binder_translate_fd()
2568 ret = security_binder_transfer_file(proc->tsk, target_proc->tsk, file); in binder_translate_fd()
2607 struct binder_proc *proc = thread->proc; in binder_translate_fd_array() local
2613 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2620 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2634 proc->pid, thread->pid); in binder_translate_fd_array()
2664 struct binder_proc *proc = thread->proc; in binder_fixup_parent() local
2678 proc->pid, thread->pid); in binder_fixup_parent()
2687 proc->pid, thread->pid); in binder_fixup_parent()
2695 proc->pid, thread->pid); in binder_fixup_parent()
2703 proc->pid, thread->pid); in binder_fixup_parent()
2713 * @proc: process to send the transaction to
2714 * @thread: thread in @proc to send the transaction to (may be NULL)
2718 * wake it up. If no thread is found, the work is queued to the proc
2728 struct binder_proc *proc, in binder_proc_transaction() argument
2745 binder_inner_proc_lock(proc); in binder_proc_transaction()
2747 if (proc->is_dead || (thread && thread->is_dead)) { in binder_proc_transaction()
2748 binder_inner_proc_unlock(proc); in binder_proc_transaction()
2754 thread = binder_select_thread_ilocked(proc); in binder_proc_transaction()
2759 binder_enqueue_work_ilocked(&t->work, &proc->todo); in binder_proc_transaction()
2764 binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */); in binder_proc_transaction()
2766 binder_inner_proc_unlock(proc); in binder_proc_transaction()
2775 * @proc: returns @node->proc if valid
2776 * @error: if no @proc then returns BR_DEAD_REPLY
2786 * the transaction. We also need a tmpref on the proc while we are
2789 * Return: The target_node with refs taken or NULL if no @node->proc is NULL.
2790 * Also sets @proc if valid. If the @node->proc is NULL indicating that the
2791 * target proc has died, @error is set to BR_DEAD_REPLY
2801 if (node->proc) { in binder_get_node_refs_for_txn()
2805 node->proc->tmp_ref++; in binder_get_node_refs_for_txn()
2806 *procp = node->proc; in binder_get_node_refs_for_txn()
2814 static void binder_transaction(struct binder_proc *proc, in binder_transaction() argument
2837 struct binder_context *context = proc->context; in binder_transaction()
2845 e->from_proc = proc->pid; in binder_transaction()
2850 strscpy(e->context_name, proc->context->name, BINDERFS_MAX_NAME); in binder_transaction()
2853 binder_inner_proc_lock(proc); in binder_transaction()
2856 binder_inner_proc_unlock(proc); in binder_transaction()
2858 proc->pid, thread->pid); in binder_transaction()
2867 proc->pid, thread->pid, in_reply_to->debug_id, in binder_transaction()
2873 binder_inner_proc_unlock(proc); in binder_transaction()
2881 binder_inner_proc_unlock(proc); in binder_transaction()
2886 __release(&target_thread->proc->inner_lock); in binder_transaction()
2893 proc->pid, thread->pid, in binder_transaction()
2897 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
2905 target_proc = target_thread->proc; in binder_transaction()
2907 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
2919 binder_proc_lock(proc); in binder_transaction()
2920 ref = binder_get_ref_olocked(proc, tr->target.handle, in binder_transaction()
2928 proc->pid, thread->pid); in binder_transaction()
2931 binder_proc_unlock(proc); in binder_transaction()
2942 if (target_node && target_proc->pid == proc->pid) { in binder_transaction()
2944 proc->pid, thread->pid); in binder_transaction()
2960 if (WARN_ON(proc == target_proc)) { in binder_transaction()
2966 if (security_binder_transaction(proc->tsk, in binder_transaction()
2973 binder_inner_proc_lock(proc); in binder_transaction()
2984 * thread from proc->waiting_threads to enqueue in binder_transaction()
2989 proc->pid, thread->pid); in binder_transaction()
2990 binder_inner_proc_unlock(proc); in binder_transaction()
3004 proc->pid, thread->pid, tmp->debug_id, in binder_transaction()
3009 binder_inner_proc_unlock(proc); in binder_transaction()
3020 if (from && from->proc == target_proc) { in binder_transaction()
3030 binder_inner_proc_unlock(proc); in binder_transaction()
3062 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3071 proc->pid, thread->pid, t->debug_id, in binder_transaction()
3082 t->sender_euid = task_euid(proc->tsk); in binder_transaction()
3093 security_task_getsecid(proc->tsk, &secid); in binder_transaction()
3158 proc->pid, thread->pid); in binder_transaction()
3172 proc->pid, thread->pid); in binder_transaction()
3180 proc->pid, thread->pid, (u64)tr->offsets_size); in binder_transaction()
3188 proc->pid, thread->pid, in binder_transaction()
3223 proc->pid, thread->pid, in binder_transaction()
3306 proc->pid, thread->pid); in binder_transaction()
3319 proc->pid, thread->pid); in binder_transaction()
3345 proc->pid, thread->pid); in binder_transaction()
3359 proc->pid, thread->pid); in binder_transaction()
3365 /* Fixup buffer pointer to target proc address space */ in binder_transaction()
3392 proc->pid, thread->pid, hdr->type); in binder_transaction()
3417 binder_inner_proc_lock(proc); in binder_transaction()
3429 binder_inner_proc_unlock(proc); in binder_transaction()
3431 binder_inner_proc_lock(proc); in binder_transaction()
3433 binder_inner_proc_unlock(proc); in binder_transaction()
3459 binder_dequeue_work(proc, tcomplete); in binder_transaction()
3501 proc->pid, thread->pid, return_error, return_error_param, in binder_transaction()
3535 * @proc: binder proc that owns buffer
3544 binder_free_buf(struct binder_proc *proc, struct binder_buffer *buffer) in binder_free_buf() argument
3546 binder_inner_proc_lock(proc); in binder_free_buf()
3551 binder_inner_proc_unlock(proc); in binder_free_buf()
3559 BUG_ON(buf_node->proc != proc); in binder_free_buf()
3566 w, &proc->todo); in binder_free_buf()
3567 binder_wakeup_proc_ilocked(proc); in binder_free_buf()
3572 binder_transaction_buffer_release(proc, buffer, 0, false); in binder_free_buf()
3573 binder_alloc_free_buf(&proc->alloc, buffer); in binder_free_buf()
3576 static int binder_thread_write(struct binder_proc *proc, in binder_thread_write() argument
3582 struct binder_context *context = proc->context; in binder_thread_write()
3596 atomic_inc(&proc->stats.bc[_IOC_NR(cmd)]); in binder_thread_write()
3620 if (ctx_mgr_node->proc == proc) { in binder_thread_write()
3622 proc->pid, thread->pid); in binder_thread_write()
3627 proc, ctx_mgr_node, in binder_thread_write()
3634 proc, target, increment, strong, in binder_thread_write()
3638 proc->pid, thread->pid, in binder_thread_write()
3658 proc->pid, thread->pid, debug_string, in binder_thread_write()
3664 proc->pid, thread->pid, debug_string, in binder_thread_write()
3682 node = binder_get_node(proc, node_ptr); in binder_thread_write()
3685 proc->pid, thread->pid, in binder_thread_write()
3694 proc->pid, thread->pid, in binder_thread_write()
3706 proc->pid, thread->pid, in binder_thread_write()
3716 proc->pid, thread->pid, in binder_thread_write()
3729 proc->pid, thread->pid, in binder_thread_write()
3752 buffer = binder_alloc_prepare_to_free(&proc->alloc, in binder_thread_write()
3758 proc->pid, thread->pid, in binder_thread_write()
3763 proc->pid, thread->pid, in binder_thread_write()
3770 proc->pid, thread->pid, (u64)data_ptr, in binder_thread_write()
3773 binder_free_buf(proc, buffer); in binder_thread_write()
3784 binder_transaction(proc, thread, &tr.transaction_data, in binder_thread_write()
3795 binder_transaction(proc, thread, &tr, in binder_thread_write()
3803 proc->pid, thread->pid); in binder_thread_write()
3804 binder_inner_proc_lock(proc); in binder_thread_write()
3808 proc->pid, thread->pid); in binder_thread_write()
3809 } else if (proc->requested_threads == 0) { in binder_thread_write()
3812 proc->pid, thread->pid); in binder_thread_write()
3814 proc->requested_threads--; in binder_thread_write()
3815 proc->requested_threads_started++; in binder_thread_write()
3818 binder_inner_proc_unlock(proc); in binder_thread_write()
3823 proc->pid, thread->pid); in binder_thread_write()
3827 proc->pid, thread->pid); in binder_thread_write()
3834 proc->pid, thread->pid); in binder_thread_write()
3867 proc->pid, thread->pid); in binder_thread_write()
3871 binder_proc_lock(proc); in binder_thread_write()
3872 ref = binder_get_ref_olocked(proc, target, false); in binder_thread_write()
3875 proc->pid, thread->pid, in binder_thread_write()
3880 binder_proc_unlock(proc); in binder_thread_write()
3887 proc->pid, thread->pid, in binder_thread_write()
3899 proc->pid, thread->pid); in binder_thread_write()
3901 binder_proc_unlock(proc); in binder_thread_write()
3909 if (ref->node->proc == NULL) { in binder_thread_write()
3912 binder_inner_proc_lock(proc); in binder_thread_write()
3914 &ref->death->work, &proc->todo); in binder_thread_write()
3915 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
3916 binder_inner_proc_unlock(proc); in binder_thread_write()
3921 proc->pid, thread->pid); in binder_thread_write()
3923 binder_proc_unlock(proc); in binder_thread_write()
3929 proc->pid, thread->pid, in binder_thread_write()
3933 binder_proc_unlock(proc); in binder_thread_write()
3937 binder_inner_proc_lock(proc); in binder_thread_write()
3949 &proc->todo); in binder_thread_write()
3951 proc); in binder_thread_write()
3957 binder_inner_proc_unlock(proc); in binder_thread_write()
3960 binder_proc_unlock(proc); in binder_thread_write()
3971 binder_inner_proc_lock(proc); in binder_thread_write()
3972 list_for_each_entry(w, &proc->delivered_death, in binder_thread_write()
3986 proc->pid, thread->pid, (u64)cookie, in binder_thread_write()
3990 proc->pid, thread->pid, (u64)cookie); in binder_thread_write()
3991 binder_inner_proc_unlock(proc); in binder_thread_write()
4005 &proc->todo); in binder_thread_write()
4006 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
4009 binder_inner_proc_unlock(proc); in binder_thread_write()
4014 proc->pid, thread->pid, cmd); in binder_thread_write()
4022 static void binder_stat_br(struct binder_proc *proc, in binder_stat_br() argument
4028 atomic_inc(&proc->stats.br[_IOC_NR(cmd)]); in binder_stat_br()
4033 static int binder_put_node_cmd(struct binder_proc *proc, in binder_put_node_cmd() argument
4055 binder_stat_br(proc, thread, cmd); in binder_put_node_cmd()
4057 proc->pid, thread->pid, cmd_name, node_debug_id, in binder_put_node_cmd()
4068 struct binder_proc *proc = thread->proc; in binder_wait_for_work() local
4072 binder_inner_proc_lock(proc); in binder_wait_for_work()
4079 &proc->waiting_threads); in binder_wait_for_work()
4080 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4082 binder_inner_proc_lock(proc); in binder_wait_for_work()
4090 binder_inner_proc_unlock(proc); in binder_wait_for_work()
4098 * @proc: binder_proc associated @t->buffer
4110 static int binder_apply_fd_fixups(struct binder_proc *proc, in binder_apply_fd_fixups() argument
4132 if (binder_alloc_copy_to_buffer(&proc->alloc, t->buffer, in binder_apply_fd_fixups()
4146 err = binder_alloc_copy_from_buffer(&proc->alloc, &fd, in binder_apply_fd_fixups()
4161 static int binder_thread_read(struct binder_proc *proc, in binder_thread_read() argument
4180 binder_inner_proc_lock(proc); in binder_thread_read()
4182 binder_inner_proc_unlock(proc); in binder_thread_read()
4188 !binder_worklist_empty(proc, &thread->todo)); in binder_thread_read()
4193 proc->pid, thread->pid, thread->looper); in binder_thread_read()
4197 binder_set_nice(proc->default_priority); in binder_thread_read()
4222 binder_inner_proc_lock(proc); in binder_thread_read()
4225 else if (!binder_worklist_empty_ilocked(&proc->todo) && in binder_thread_read()
4227 list = &proc->todo; in binder_thread_read()
4229 binder_inner_proc_unlock(proc); in binder_thread_read()
4238 binder_inner_proc_unlock(proc); in binder_thread_read()
4247 binder_inner_proc_unlock(proc); in binder_thread_read()
4255 binder_inner_proc_unlock(proc); in binder_thread_read()
4262 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4265 binder_inner_proc_unlock(proc); in binder_thread_read()
4273 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4276 proc->pid, thread->pid); in binder_thread_read()
4288 BUG_ON(proc != node->proc); in binder_thread_read()
4314 proc->pid, thread->pid, in binder_thread_read()
4318 rb_erase(&node->rb_node, &proc->nodes); in binder_thread_read()
4319 binder_inner_proc_unlock(proc); in binder_thread_read()
4333 binder_inner_proc_unlock(proc); in binder_thread_read()
4337 proc, thread, &ptr, node_ptr, in binder_thread_read()
4342 proc, thread, &ptr, node_ptr, in binder_thread_read()
4347 proc, thread, &ptr, node_ptr, in binder_thread_read()
4352 proc, thread, &ptr, node_ptr, in binder_thread_read()
4358 proc->pid, thread->pid, in binder_thread_read()
4381 proc->pid, thread->pid, in binder_thread_read()
4387 binder_inner_proc_unlock(proc); in binder_thread_read()
4392 w, &proc->delivered_death); in binder_thread_read()
4393 binder_inner_proc_unlock(proc); in binder_thread_read()
4402 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4407 binder_inner_proc_unlock(proc); in binder_thread_read()
4409 proc->pid, thread->pid, w->type); in binder_thread_read()
4441 struct task_struct *sender = t_from->proc->tsk; in binder_thread_read()
4450 ret = binder_apply_fd_fixups(proc, t); in binder_thread_read()
4461 binder_free_buf(proc, buffer); in binder_thread_read()
4464 proc->pid, thread->pid, in binder_thread_read()
4473 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4512 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4515 proc->pid, thread->pid, in binder_thread_read()
4519 t->debug_id, t_from ? t_from->proc->pid : 0, in binder_thread_read()
4529 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4533 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4543 binder_inner_proc_lock(proc); in binder_thread_read()
4544 if (proc->requested_threads == 0 && in binder_thread_read()
4545 list_empty(&thread->proc->waiting_threads) && in binder_thread_read()
4546 proc->requested_threads_started < proc->max_threads && in binder_thread_read()
4550 proc->requested_threads++; in binder_thread_read()
4551 binder_inner_proc_unlock(proc); in binder_thread_read()
4554 proc->pid, thread->pid); in binder_thread_read()
4557 binder_stat_br(proc, thread, BR_SPAWN_LOOPER); in binder_thread_read()
4559 binder_inner_proc_unlock(proc); in binder_thread_read()
4563 static void binder_release_work(struct binder_proc *proc, in binder_release_work() argument
4570 binder_inner_proc_lock(proc); in binder_release_work()
4573 binder_inner_proc_unlock(proc); in binder_release_work()
4623 struct binder_proc *proc, struct binder_thread *new_thread) in binder_get_thread_ilocked() argument
4627 struct rb_node **p = &proc->threads.rb_node; in binder_get_thread_ilocked()
4644 thread->proc = proc; in binder_get_thread_ilocked()
4650 rb_insert_color(&thread->rb_node, &proc->threads); in binder_get_thread_ilocked()
4660 static struct binder_thread *binder_get_thread(struct binder_proc *proc) in binder_get_thread() argument
4665 binder_inner_proc_lock(proc); in binder_get_thread()
4666 thread = binder_get_thread_ilocked(proc, NULL); in binder_get_thread()
4667 binder_inner_proc_unlock(proc); in binder_get_thread()
4672 binder_inner_proc_lock(proc); in binder_get_thread()
4673 thread = binder_get_thread_ilocked(proc, new_thread); in binder_get_thread()
4674 binder_inner_proc_unlock(proc); in binder_get_thread()
4681 static void binder_free_proc(struct binder_proc *proc) in binder_free_proc() argument
4685 BUG_ON(!list_empty(&proc->todo)); in binder_free_proc()
4686 BUG_ON(!list_empty(&proc->delivered_death)); in binder_free_proc()
4687 device = container_of(proc->context, struct binder_device, context); in binder_free_proc()
4689 kfree(proc->context->name); in binder_free_proc()
4692 binder_alloc_deferred_release(&proc->alloc); in binder_free_proc()
4693 put_task_struct(proc->tsk); in binder_free_proc()
4695 kfree(proc); in binder_free_proc()
4702 binder_proc_dec_tmpref(thread->proc); in binder_free_thread()
4706 static int binder_thread_release(struct binder_proc *proc, in binder_thread_release() argument
4714 binder_inner_proc_lock(thread->proc); in binder_thread_release()
4716 * take a ref on the proc so it survives in binder_thread_release()
4717 * after we remove this thread from proc->threads. in binder_thread_release()
4721 proc->tmp_ref++; in binder_thread_release()
4727 rb_erase(&thread->rb_node, &proc->threads); in binder_thread_release()
4743 proc->pid, thread->pid, in binder_thread_release()
4780 binder_inner_proc_unlock(thread->proc); in binder_thread_release()
4793 binder_release_work(proc, &thread->todo); in binder_thread_release()
4801 struct binder_proc *proc = filp->private_data; in binder_poll() local
4805 thread = binder_get_thread(proc); in binder_poll()
4809 binder_inner_proc_lock(thread->proc); in binder_poll()
4813 binder_inner_proc_unlock(thread->proc); in binder_poll()
4828 struct binder_proc *proc = filp->private_data; in binder_ioctl_write_read() local
4843 proc->pid, thread->pid, in binder_ioctl_write_read()
4848 ret = binder_thread_write(proc, thread, in binder_ioctl_write_read()
4861 ret = binder_thread_read(proc, thread, bwr.read_buffer, in binder_ioctl_write_read()
4866 binder_inner_proc_lock(proc); in binder_ioctl_write_read()
4867 if (!binder_worklist_empty_ilocked(&proc->todo)) in binder_ioctl_write_read()
4868 binder_wakeup_proc_ilocked(proc); in binder_ioctl_write_read()
4869 binder_inner_proc_unlock(proc); in binder_ioctl_write_read()
4878 proc->pid, thread->pid, in binder_ioctl_write_read()
4893 struct binder_proc *proc = filp->private_data; in binder_ioctl_set_ctx_mgr() local
4894 struct binder_context *context = proc->context; in binder_ioctl_set_ctx_mgr()
4904 ret = security_binder_set_context_mgr(proc->tsk); in binder_ioctl_set_ctx_mgr()
4919 new_node = binder_new_node(proc, fbo); in binder_ioctl_set_ctx_mgr()
4937 static int binder_ioctl_get_node_info_for_ref(struct binder_proc *proc, in binder_ioctl_get_node_info_for_ref() argument
4941 struct binder_context *context = proc->context; in binder_ioctl_get_node_info_for_ref()
4947 proc->pid); in binder_ioctl_get_node_info_for_ref()
4954 context->binder_context_mgr_node->proc != proc) { in binder_ioctl_get_node_info_for_ref()
4960 node = binder_get_node_from_ref(proc, handle, true, NULL); in binder_ioctl_get_node_info_for_ref()
4973 static int binder_ioctl_get_node_debug_info(struct binder_proc *proc, in binder_ioctl_get_node_debug_info() argument
4981 binder_inner_proc_lock(proc); in binder_ioctl_get_node_debug_info()
4982 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in binder_ioctl_get_node_debug_info()
4993 binder_inner_proc_unlock(proc); in binder_ioctl_get_node_debug_info()
5001 struct binder_proc *proc = filp->private_data; in binder_ioctl() local
5007 proc->pid, current->pid, cmd, arg);*/ in binder_ioctl()
5009 binder_selftest_alloc(&proc->alloc); in binder_ioctl()
5017 thread = binder_get_thread(proc); in binder_ioctl()
5037 binder_inner_proc_lock(proc); in binder_ioctl()
5038 proc->max_threads = max_threads; in binder_ioctl()
5039 binder_inner_proc_unlock(proc); in binder_ioctl()
5061 proc->pid, thread->pid); in binder_ioctl()
5062 binder_thread_release(proc, thread); in binder_ioctl()
5087 ret = binder_ioctl_get_node_info_for_ref(proc, &info); in binder_ioctl()
5106 ret = binder_ioctl_get_node_debug_info(proc, &info); in binder_ioctl()
5126 pr_info("%d:%d ioctl %x %lx returned %d\n", proc->pid, current->pid, cmd, arg, ret); in binder_ioctl()
5134 struct binder_proc *proc = vma->vm_private_data; in binder_vma_open() local
5138 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_open()
5145 struct binder_proc *proc = vma->vm_private_data; in binder_vma_close() local
5149 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_close()
5152 binder_alloc_vma_close(&proc->alloc); in binder_vma_close()
5168 struct binder_proc *proc = filp->private_data; in binder_mmap() local
5170 if (proc->tsk != current->group_leader) in binder_mmap()
5175 __func__, proc->pid, vma->vm_start, vma->vm_end, in binder_mmap()
5181 proc->pid, vma->vm_start, vma->vm_end, "bad vm_flags", -EPERM); in binder_mmap()
5188 vma->vm_private_data = proc; in binder_mmap()
5190 return binder_alloc_mmap_handler(&proc->alloc, vma); in binder_mmap()
5195 struct binder_proc *proc, *itr; in binder_open() local
5204 proc = kzalloc(sizeof(*proc), GFP_KERNEL); in binder_open()
5205 if (proc == NULL) in binder_open()
5207 spin_lock_init(&proc->inner_lock); in binder_open()
5208 spin_lock_init(&proc->outer_lock); in binder_open()
5210 proc->tsk = current->group_leader; in binder_open()
5211 INIT_LIST_HEAD(&proc->todo); in binder_open()
5212 proc->default_priority = task_nice(current); in binder_open()
5223 proc->context = &binder_dev->context; in binder_open()
5224 binder_alloc_init(&proc->alloc); in binder_open()
5227 proc->pid = current->group_leader->pid; in binder_open()
5228 INIT_LIST_HEAD(&proc->delivered_death); in binder_open()
5229 INIT_LIST_HEAD(&proc->waiting_threads); in binder_open()
5230 filp->private_data = proc; in binder_open()
5234 if (itr->pid == proc->pid) { in binder_open()
5239 hlist_add_head(&proc->proc_node, &binder_procs); in binder_open()
5245 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5247 * proc debug entries are shared between contexts. in binder_open()
5252 proc->debugfs_entry = debugfs_create_file(strbuf, 0444, in binder_open()
5254 (void *)(unsigned long)proc->pid, in binder_open()
5262 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
5270 strbuf, &proc_fops, (void *)(unsigned long)proc->pid); in binder_open()
5272 proc->binderfs_entry = binderfs_entry; in binder_open()
5287 struct binder_proc *proc = filp->private_data; in binder_flush() local
5289 binder_defer_work(proc, BINDER_DEFERRED_FLUSH); in binder_flush()
5294 static void binder_deferred_flush(struct binder_proc *proc) in binder_deferred_flush() argument
5299 binder_inner_proc_lock(proc); in binder_deferred_flush()
5300 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_deferred_flush()
5309 binder_inner_proc_unlock(proc); in binder_deferred_flush()
5312 "binder_flush: %d woke %d threads\n", proc->pid, in binder_deferred_flush()
5318 struct binder_proc *proc = filp->private_data; in binder_release() local
5320 debugfs_remove(proc->debugfs_entry); in binder_release()
5322 if (proc->binderfs_entry) { in binder_release()
5323 binderfs_remove_file(proc->binderfs_entry); in binder_release()
5324 proc->binderfs_entry = NULL; in binder_release()
5327 binder_defer_work(proc, BINDER_DEFERRED_RELEASE); in binder_release()
5336 struct binder_proc *proc = node->proc; in binder_node_release() local
5338 binder_release_work(proc, &node->async_todo); in binder_node_release()
5341 binder_inner_proc_lock(proc); in binder_node_release()
5348 binder_inner_proc_unlock(proc); in binder_node_release()
5355 node->proc = NULL; in binder_node_release()
5358 binder_inner_proc_unlock(proc); in binder_node_release()
5372 binder_inner_proc_lock(ref->proc); in binder_node_release()
5374 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5383 &ref->proc->todo); in binder_node_release()
5384 binder_wakeup_proc_ilocked(ref->proc); in binder_node_release()
5385 binder_inner_proc_unlock(ref->proc); in binder_node_release()
5397 static void binder_deferred_release(struct binder_proc *proc) in binder_deferred_release() argument
5399 struct binder_context *context = proc->context; in binder_deferred_release()
5404 hlist_del(&proc->proc_node); in binder_deferred_release()
5409 context->binder_context_mgr_node->proc == proc) { in binder_deferred_release()
5412 __func__, proc->pid); in binder_deferred_release()
5416 binder_inner_proc_lock(proc); in binder_deferred_release()
5418 * Make sure proc stays alive after we in binder_deferred_release()
5421 proc->tmp_ref++; in binder_deferred_release()
5423 proc->is_dead = true; in binder_deferred_release()
5426 while ((n = rb_first(&proc->threads))) { in binder_deferred_release()
5430 binder_inner_proc_unlock(proc); in binder_deferred_release()
5432 active_transactions += binder_thread_release(proc, thread); in binder_deferred_release()
5433 binder_inner_proc_lock(proc); in binder_deferred_release()
5438 while ((n = rb_first(&proc->nodes))) { in binder_deferred_release()
5449 rb_erase(&node->rb_node, &proc->nodes); in binder_deferred_release()
5450 binder_inner_proc_unlock(proc); in binder_deferred_release()
5452 binder_inner_proc_lock(proc); in binder_deferred_release()
5454 binder_inner_proc_unlock(proc); in binder_deferred_release()
5457 binder_proc_lock(proc); in binder_deferred_release()
5458 while ((n = rb_first(&proc->refs_by_desc))) { in binder_deferred_release()
5464 binder_proc_unlock(proc); in binder_deferred_release()
5466 binder_proc_lock(proc); in binder_deferred_release()
5468 binder_proc_unlock(proc); in binder_deferred_release()
5470 binder_release_work(proc, &proc->todo); in binder_deferred_release()
5471 binder_release_work(proc, &proc->delivered_death); in binder_deferred_release()
5475 __func__, proc->pid, threads, nodes, incoming_refs, in binder_deferred_release()
5478 binder_proc_dec_tmpref(proc); in binder_deferred_release()
5483 struct binder_proc *proc; in binder_deferred_func() local
5490 proc = hlist_entry(binder_deferred_list.first, in binder_deferred_func()
5492 hlist_del_init(&proc->deferred_work_node); in binder_deferred_func()
5493 defer = proc->deferred_work; in binder_deferred_func()
5494 proc->deferred_work = 0; in binder_deferred_func()
5496 proc = NULL; in binder_deferred_func()
5502 binder_deferred_flush(proc); in binder_deferred_func()
5505 binder_deferred_release(proc); /* frees proc */ in binder_deferred_func()
5506 } while (proc); in binder_deferred_func()
5511 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer) in binder_defer_work() argument
5514 proc->deferred_work |= defer; in binder_defer_work()
5515 if (hlist_unhashed(&proc->deferred_work_node)) { in binder_defer_work()
5516 hlist_add_head(&proc->deferred_work_node, in binder_defer_work()
5524 struct binder_proc *proc, in print_binder_transaction_ilocked() argument
5536 t->from ? t->from->proc->pid : 0, in print_binder_transaction_ilocked()
5543 if (proc != to_proc) { in print_binder_transaction_ilocked()
5546 * correct proc inner lock for this node in print_binder_transaction_ilocked()
5564 struct binder_proc *proc, in print_binder_work_ilocked() argument
5576 m, proc, transaction_prefix, t); in print_binder_work_ilocked()
5626 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
5630 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
5634 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
5640 print_binder_work_ilocked(m, thread->proc, " ", in print_binder_thread_ilocked()
5664 seq_puts(m, " proc"); in print_binder_node_nilocked()
5666 seq_printf(m, " %d", ref->proc->pid); in print_binder_node_nilocked()
5669 if (node->proc) { in print_binder_node_nilocked()
5671 print_binder_work_ilocked(m, node->proc, " ", in print_binder_node_nilocked()
5682 ref->node->proc ? "" : "dead ", in print_binder_ref_olocked()
5689 struct binder_proc *proc, int print_all) in print_binder_proc() argument
5697 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc()
5698 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc()
5701 binder_inner_proc_lock(proc); in print_binder_proc()
5702 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc()
5706 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in print_binder_proc()
5719 binder_inner_proc_unlock(proc); in print_binder_proc()
5726 binder_inner_proc_lock(proc); in print_binder_proc()
5728 binder_inner_proc_unlock(proc); in print_binder_proc()
5733 binder_proc_lock(proc); in print_binder_proc()
5734 for (n = rb_first(&proc->refs_by_desc); in print_binder_proc()
5740 binder_proc_unlock(proc); in print_binder_proc()
5742 binder_alloc_print_allocated(m, &proc->alloc); in print_binder_proc()
5743 binder_inner_proc_lock(proc); in print_binder_proc()
5744 list_for_each_entry(w, &proc->todo, entry) in print_binder_proc()
5745 print_binder_work_ilocked(m, proc, " ", in print_binder_proc()
5747 list_for_each_entry(w, &proc->delivered_death, entry) { in print_binder_proc()
5751 binder_inner_proc_unlock(proc); in print_binder_proc()
5800 "proc",
5852 struct binder_proc *proc) in print_binder_proc_stats() argument
5859 binder_alloc_get_free_async_space(&proc->alloc); in print_binder_proc_stats()
5861 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc_stats()
5862 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc_stats()
5865 binder_inner_proc_lock(proc); in print_binder_proc_stats()
5866 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
5869 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_stats()
5875 " free async space %zd\n", proc->requested_threads, in print_binder_proc_stats()
5876 proc->requested_threads_started, proc->max_threads, in print_binder_proc_stats()
5880 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
5882 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
5887 binder_proc_lock(proc); in print_binder_proc_stats()
5888 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in print_binder_proc_stats()
5895 binder_proc_unlock(proc); in print_binder_proc_stats()
5898 count = binder_alloc_get_allocated_count(&proc->alloc); in print_binder_proc_stats()
5901 binder_alloc_print_pages(m, &proc->alloc); in print_binder_proc_stats()
5904 binder_inner_proc_lock(proc); in print_binder_proc_stats()
5905 list_for_each_entry(w, &proc->todo, entry) { in print_binder_proc_stats()
5909 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
5912 print_binder_stats(m, " ", &proc->stats); in print_binder_proc_stats()
5918 struct binder_proc *proc; in binder_state_show() local
5948 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_state_show()
5949 print_binder_proc(m, proc, 1); in binder_state_show()
5957 struct binder_proc *proc; in binder_stats_show() local
5964 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_stats_show()
5965 print_binder_proc_stats(m, proc); in binder_stats_show()
5973 struct binder_proc *proc; in binder_transactions_show() local
5977 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_transactions_show()
5978 print_binder_proc(m, proc, 0); in binder_transactions_show()
5992 seq_puts(m, "binder proc state:\n"); in proc_show()
6105 binder_debugfs_dir_entry_proc = debugfs_create_dir("proc", in binder_init()