Lines Matching full:proc
24 * 1) proc->outer_lock : protects binder_ref
30 * 3) proc->inner_lock : protects the thread and node lists
31 * (proc->threads, proc->waiting_threads, proc->nodes)
33 * (proc->todo, thread->todo, proc->delivered_death and
46 * foo_ilocked() : requires proc->inner_lock
47 * foo_oilocked(): requires proc->outer_lock and proc->inner_lock
48 * foo_nilocked(): requires node->lock and proc->inner_lock
111 BINDER_DEBUG_ENTRY(proc);
283 * There are separate work lists for proc, thread, and node (async).
310 * (protected by @proc->inner_lock)
311 * @rb_node: element for proc->nodes tree
312 * (protected by @proc->inner_lock)
315 * @proc: binder_proc that owns this node
321 * (protected by @proc->inner_lock if @proc
324 * (protected by @proc->inner_lock if @proc
327 * (protected by @proc->inner_lock if @proc
330 * (protected by @proc->inner_lock while @proc
332 * if @proc is NULL. During inc/dec and node release
334 * as the node dies and @proc becomes NULL)
340 * (protected by @proc->inner_lock if @proc
343 * (protected by @proc->inner_lock if @proc
346 * (protected by @proc->inner_lock if @proc
349 * (protected by @proc->inner_lock if @proc
358 * (protected by @proc->inner_lock)
370 struct binder_proc *proc; member
381 * proc inner_lock
402 * (protected by inner_lock of the proc that
431 * @rb_node_desc: node for lookup by @data.desc in proc's rb_tree
432 * @rb_node_node: node for lookup by @node in proc's rb_tree
435 * @proc: binder_proc containing ref
443 * structure is unsafe to access without holding @proc->outer_lock.
447 /* node + proc => ref (transaction) */
448 /* desc + proc => ref (transaction, inc/dec ref) */
449 /* node => refs + procs (proc exit) */
454 struct binder_proc *proc; member
468 * @threads: rbtree of binder_threads in this proc
471 * this proc ordered by node->ptr
477 * @waiting_threads: threads currently waiting for proc work
507 * @tmp_ref: temporary reference to indicate proc is in use
513 * @context: binder_context for this proc
562 * @proc: binder process for this thread
564 * @rb_node: element for proc->threads rbtree
565 * (protected by @proc->inner_lock)
566 * @waiting_thread_node: element for @proc->waiting_threads list
567 * (protected by @proc->inner_lock)
575 * (protected by @proc->inner_lock)
577 * (protected by @proc->inner_lock)
579 * (protected by @proc->inner_lock)
583 * (protected by @proc->inner_lock)
588 * (atomic since @proc->inner_lock cannot
592 * (protected by @proc->inner_lock)
597 struct binder_proc *proc; member
642 * @proc: struct binder_proc to acquire
644 * Acquires proc->outer_lock. Used to protect binder_ref
645 * structures associated with the given proc.
647 #define binder_proc_lock(proc) _binder_proc_lock(proc, __LINE__) argument
649 _binder_proc_lock(struct binder_proc *proc, int line) in _binder_proc_lock() argument
653 spin_lock(&proc->outer_lock); in _binder_proc_lock()
658 * @proc: struct binder_proc to acquire
664 _binder_proc_unlock(struct binder_proc *proc, int line) in _binder_proc_unlock() argument
668 spin_unlock(&proc->outer_lock); in _binder_proc_unlock()
673 * @proc: struct binder_proc to acquire
675 * Acquires proc->inner_lock. Used to protect todo lists
677 #define binder_inner_proc_lock(proc) _binder_inner_proc_lock(proc, __LINE__) argument
679 _binder_inner_proc_lock(struct binder_proc *proc, int line) in _binder_inner_proc_lock() argument
683 spin_lock(&proc->inner_lock); in _binder_inner_proc_lock()
688 * @proc: struct binder_proc to acquire
692 #define binder_inner_proc_unlock(proc) _binder_inner_proc_unlock(proc, __LINE__) argument
694 _binder_inner_proc_unlock(struct binder_proc *proc, int line) in _binder_inner_proc_unlock() argument
698 spin_unlock(&proc->inner_lock); in _binder_inner_proc_unlock()
735 * Acquires node->lock. If node->proc also acquires
736 * proc->inner_lock. Used to protect binder_node fields
745 if (node->proc) in _binder_node_inner_lock()
746 binder_inner_proc_lock(node->proc); in _binder_node_inner_lock()
759 struct binder_proc *proc = node->proc; in _binder_node_inner_unlock() local
763 if (proc) in _binder_node_inner_unlock()
764 binder_inner_proc_unlock(proc); in _binder_node_inner_unlock()
775 * @proc: binder_proc associated with list
780 static bool binder_worklist_empty(struct binder_proc *proc, in binder_worklist_empty() argument
785 binder_inner_proc_lock(proc); in binder_worklist_empty()
787 binder_inner_proc_unlock(proc); in binder_worklist_empty()
799 * Requires the proc->inner_lock to be held.
819 * Requires the proc->inner_lock to be held.
837 * Requires the proc->inner_lock to be held.
860 binder_inner_proc_lock(thread->proc); in binder_enqueue_thread_work()
862 binder_inner_proc_unlock(thread->proc); in binder_enqueue_thread_work()
873 * @proc: binder_proc associated with list
880 binder_dequeue_work(struct binder_proc *proc, struct binder_work *work) in binder_dequeue_work() argument
882 binder_inner_proc_lock(proc); in binder_dequeue_work()
884 binder_inner_proc_unlock(proc); in binder_dequeue_work()
899 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
901 static void binder_free_proc(struct binder_proc *proc);
904 static int task_get_unused_fd_flags(struct binder_proc *proc, int flags) in task_get_unused_fd_flags() argument
910 mutex_lock(&proc->files_lock); in task_get_unused_fd_flags()
911 if (proc->files == NULL) { in task_get_unused_fd_flags()
915 if (!lock_task_sighand(proc->tsk, &irqs)) { in task_get_unused_fd_flags()
919 rlim_cur = task_rlimit(proc->tsk, RLIMIT_NOFILE); in task_get_unused_fd_flags()
920 unlock_task_sighand(proc->tsk, &irqs); in task_get_unused_fd_flags()
922 ret = __alloc_fd(proc->files, 0, rlim_cur, flags); in task_get_unused_fd_flags()
924 mutex_unlock(&proc->files_lock); in task_get_unused_fd_flags()
932 struct binder_proc *proc, unsigned int fd, struct file *file) in task_fd_install() argument
934 mutex_lock(&proc->files_lock); in task_fd_install()
935 if (proc->files) in task_fd_install()
936 __fd_install(proc->files, fd, file); in task_fd_install()
937 mutex_unlock(&proc->files_lock); in task_fd_install()
943 static long task_close_fd(struct binder_proc *proc, unsigned int fd) in task_close_fd() argument
947 mutex_lock(&proc->files_lock); in task_close_fd()
948 if (proc->files == NULL) { in task_close_fd()
952 retval = __close_fd(proc->files, fd); in task_close_fd()
960 mutex_unlock(&proc->files_lock); in task_close_fd()
970 !binder_worklist_empty_ilocked(&thread->proc->todo)); in binder_has_work_ilocked()
977 binder_inner_proc_lock(thread->proc); in binder_has_work()
979 binder_inner_proc_unlock(thread->proc); in binder_has_work()
992 static void binder_wakeup_poll_threads_ilocked(struct binder_proc *proc, in binder_wakeup_poll_threads_ilocked() argument
998 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_wakeup_poll_threads_ilocked()
1011 * binder_select_thread_ilocked() - selects a thread for doing proc work.
1012 * @proc: process to select a thread from
1023 binder_select_thread_ilocked(struct binder_proc *proc) in binder_select_thread_ilocked() argument
1027 assert_spin_locked(&proc->inner_lock); in binder_select_thread_ilocked()
1028 thread = list_first_entry_or_null(&proc->waiting_threads, in binder_select_thread_ilocked()
1039 * binder_wakeup_thread_ilocked() - wakes up a thread for doing proc work.
1040 * @proc: process to wake up a thread in
1044 * This function wakes up a thread in the @proc process.
1054 static void binder_wakeup_thread_ilocked(struct binder_proc *proc, in binder_wakeup_thread_ilocked() argument
1058 assert_spin_locked(&proc->inner_lock); in binder_wakeup_thread_ilocked()
1068 /* Didn't find a thread waiting for proc work; this can happen in binder_wakeup_thread_ilocked()
1081 binder_wakeup_poll_threads_ilocked(proc, sync); in binder_wakeup_thread_ilocked()
1084 static void binder_wakeup_proc_ilocked(struct binder_proc *proc) in binder_wakeup_proc_ilocked() argument
1086 struct binder_thread *thread = binder_select_thread_ilocked(proc); in binder_wakeup_proc_ilocked()
1088 binder_wakeup_thread_ilocked(proc, thread, /* sync = */false); in binder_wakeup_proc_ilocked()
1109 static struct binder_node *binder_get_node_ilocked(struct binder_proc *proc, in binder_get_node_ilocked() argument
1112 struct rb_node *n = proc->nodes.rb_node; in binder_get_node_ilocked()
1115 assert_spin_locked(&proc->inner_lock); in binder_get_node_ilocked()
1137 static struct binder_node *binder_get_node(struct binder_proc *proc, in binder_get_node() argument
1142 binder_inner_proc_lock(proc); in binder_get_node()
1143 node = binder_get_node_ilocked(proc, ptr); in binder_get_node()
1144 binder_inner_proc_unlock(proc); in binder_get_node()
1149 struct binder_proc *proc, in binder_init_node_ilocked() argument
1153 struct rb_node **p = &proc->nodes.rb_node; in binder_init_node_ilocked()
1160 assert_spin_locked(&proc->inner_lock); in binder_init_node_ilocked()
1185 rb_insert_color(&node->rb_node, &proc->nodes); in binder_init_node_ilocked()
1187 node->proc = proc; in binder_init_node_ilocked()
1198 proc->pid, current->pid, node->debug_id, in binder_init_node_ilocked()
1204 static struct binder_node *binder_new_node(struct binder_proc *proc, in binder_new_node() argument
1212 binder_inner_proc_lock(proc); in binder_new_node()
1213 node = binder_init_node_ilocked(proc, new_node, fp); in binder_new_node()
1214 binder_inner_proc_unlock(proc); in binder_new_node()
1234 struct binder_proc *proc = node->proc; in binder_inc_node_nilocked() local
1237 if (proc) in binder_inc_node_nilocked()
1238 assert_spin_locked(&proc->inner_lock); in binder_inc_node_nilocked()
1243 !(node->proc && in binder_inc_node_nilocked()
1244 node == node->proc->context->binder_context_mgr_node && in binder_inc_node_nilocked()
1294 struct binder_proc *proc = node->proc; in binder_dec_node_nilocked() local
1297 if (proc) in binder_dec_node_nilocked()
1298 assert_spin_locked(&proc->inner_lock); in binder_dec_node_nilocked()
1314 if (proc && (node->has_strong_ref || node->has_weak_ref)) { in binder_dec_node_nilocked()
1316 binder_enqueue_work_ilocked(&node->work, &proc->todo); in binder_dec_node_nilocked()
1317 binder_wakeup_proc_ilocked(proc); in binder_dec_node_nilocked()
1322 if (proc) { in binder_dec_node_nilocked()
1324 rb_erase(&node->rb_node, &proc->nodes); in binder_dec_node_nilocked()
1380 * (node->proc is NULL), use binder_dead_nodes_lock to protect
1388 if (node->proc) in binder_inc_node_tmpref()
1389 binder_inner_proc_lock(node->proc); in binder_inc_node_tmpref()
1393 if (node->proc) in binder_inc_node_tmpref()
1394 binder_inner_proc_unlock(node->proc); in binder_inc_node_tmpref()
1411 if (!node->proc) in binder_dec_node_tmpref()
1415 if (!node->proc) in binder_dec_node_tmpref()
1434 static struct binder_ref *binder_get_ref_olocked(struct binder_proc *proc, in binder_get_ref_olocked() argument
1437 struct rb_node *n = proc->refs_by_desc.rb_node; in binder_get_ref_olocked()
1459 * @proc: binder_proc that owns the ref
1467 * into the given proc rb_trees and node refs list.
1476 struct binder_proc *proc, in binder_get_ref_for_node_olocked() argument
1480 struct binder_context *context = proc->context; in binder_get_ref_for_node_olocked()
1481 struct rb_node **p = &proc->refs_by_node.rb_node; in binder_get_ref_for_node_olocked()
1502 new_ref->proc = proc; in binder_get_ref_for_node_olocked()
1505 rb_insert_color(&new_ref->rb_node_node, &proc->refs_by_node); in binder_get_ref_for_node_olocked()
1508 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in binder_get_ref_for_node_olocked()
1515 p = &proc->refs_by_desc.rb_node; in binder_get_ref_for_node_olocked()
1528 rb_insert_color(&new_ref->rb_node_desc, &proc->refs_by_desc); in binder_get_ref_for_node_olocked()
1535 proc->pid, new_ref->data.debug_id, new_ref->data.desc, in binder_get_ref_for_node_olocked()
1547 ref->proc->pid, ref->data.debug_id, ref->data.desc, in binder_cleanup_ref_olocked()
1550 rb_erase(&ref->rb_node_desc, &ref->proc->refs_by_desc); in binder_cleanup_ref_olocked()
1551 rb_erase(&ref->rb_node_node, &ref->proc->refs_by_node); in binder_cleanup_ref_olocked()
1575 ref->proc->pid, ref->data.debug_id, in binder_cleanup_ref_olocked()
1577 binder_dequeue_work(ref->proc, &ref->death->work); in binder_cleanup_ref_olocked()
1589 * Increment the ref. @ref->proc->outer_lock must be held on entry
1630 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1641 ref->proc->pid, ref->data.debug_id, in binder_dec_ref_olocked()
1656 * binder_get_node_from_ref() - get the node from the given proc/desc
1657 * @proc: proc containing the ref
1662 * Given a proc and ref handle, return the associated binder_node
1667 struct binder_proc *proc, in binder_get_node_from_ref() argument
1674 binder_proc_lock(proc); in binder_get_node_from_ref()
1675 ref = binder_get_ref_olocked(proc, desc, need_strong_ref); in binder_get_node_from_ref()
1686 binder_proc_unlock(proc); in binder_get_node_from_ref()
1691 binder_proc_unlock(proc); in binder_get_node_from_ref()
1712 * @proc: proc containing the ref
1718 * Given a proc and ref handle, increment or decrement the ref
1723 static int binder_update_ref_for_handle(struct binder_proc *proc, in binder_update_ref_for_handle() argument
1731 binder_proc_lock(proc); in binder_update_ref_for_handle()
1732 ref = binder_get_ref_olocked(proc, desc, strong); in binder_update_ref_for_handle()
1744 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1751 binder_proc_unlock(proc); in binder_update_ref_for_handle()
1757 * @proc: proc containing the ref
1766 static int binder_dec_ref_for_handle(struct binder_proc *proc, in binder_dec_ref_for_handle() argument
1769 return binder_update_ref_for_handle(proc, desc, false, strong, rdata); in binder_dec_ref_for_handle()
1774 * binder_inc_ref_for_node() - increment the ref for given proc/node
1775 * @proc: proc containing the ref
1781 * Given a proc and node, increment the ref. Create the ref if it
1786 static int binder_inc_ref_for_node(struct binder_proc *proc, in binder_inc_ref_for_node() argument
1796 binder_proc_lock(proc); in binder_inc_ref_for_node()
1797 ref = binder_get_ref_for_node_olocked(proc, node, NULL); in binder_inc_ref_for_node()
1799 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1803 binder_proc_lock(proc); in binder_inc_ref_for_node()
1804 ref = binder_get_ref_for_node_olocked(proc, node, new_ref); in binder_inc_ref_for_node()
1808 binder_proc_unlock(proc); in binder_inc_ref_for_node()
1822 assert_spin_locked(&target_thread->proc->inner_lock); in binder_pop_transaction_ilocked()
1848 binder_inner_proc_lock(thread->proc); in binder_thread_dec_tmpref()
1851 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1855 binder_inner_proc_unlock(thread->proc); in binder_thread_dec_tmpref()
1859 * binder_proc_dec_tmpref() - decrement proc->tmp_ref
1860 * @proc: proc to decrement
1863 * handle a transaction. proc->tmp_ref is incremented when
1867 * proc if appropriate (proc has been released, all threads have
1870 static void binder_proc_dec_tmpref(struct binder_proc *proc) in binder_proc_dec_tmpref() argument
1872 binder_inner_proc_lock(proc); in binder_proc_dec_tmpref()
1873 proc->tmp_ref--; in binder_proc_dec_tmpref()
1874 if (proc->is_dead && RB_EMPTY_ROOT(&proc->threads) && in binder_proc_dec_tmpref()
1875 !proc->tmp_ref) { in binder_proc_dec_tmpref()
1876 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1877 binder_free_proc(proc); in binder_proc_dec_tmpref()
1880 binder_inner_proc_unlock(proc); in binder_proc_dec_tmpref()
1910 * Same as binder_get_txn_from() except it also acquires the proc->inner_lock
1925 binder_inner_proc_lock(from->proc); in binder_get_txn_from_and_acq_inner()
1930 binder_inner_proc_unlock(from->proc); in binder_get_txn_from_and_acq_inner()
1966 target_thread->proc->pid, in binder_send_failed_reply()
1986 binder_inner_proc_unlock(target_thread->proc); in binder_send_failed_reply()
2177 static void binder_transaction_buffer_release(struct binder_proc *proc, in binder_transaction_buffer_release() argument
2186 proc->pid, buffer->debug_id, in binder_transaction_buffer_release()
2215 node = binder_get_node(proc, fp->binder); in binder_transaction_buffer_release()
2235 ret = binder_dec_ref_for_handle(proc, fp->handle, in binder_transaction_buffer_release()
2254 task_close_fd(proc, fp->fd); in binder_transaction_buffer_release()
2285 &proc->alloc); in binder_transaction_buffer_release()
2302 task_close_fd(proc, fd_array[fd_index]); in binder_transaction_buffer_release()
2317 struct binder_proc *proc = thread->proc; in binder_translate_binder() local
2322 node = binder_get_node(proc, fp->binder); in binder_translate_binder()
2324 node = binder_new_node(proc, fp); in binder_translate_binder()
2330 proc->pid, thread->pid, (u64)fp->binder, in binder_translate_binder()
2336 if (security_binder_transfer_binder(proc->tsk, target_proc->tsk)) { in binder_translate_binder()
2369 struct binder_proc *proc = thread->proc; in binder_translate_handle() local
2375 node = binder_get_node_from_ref(proc, fp->handle, in binder_translate_handle()
2379 proc->pid, thread->pid, fp->handle); in binder_translate_handle()
2382 if (security_binder_transfer_binder(proc->tsk, target_proc->tsk)) { in binder_translate_handle()
2388 if (node->proc == target_proc) { in binder_translate_handle()
2395 if (node->proc) in binder_translate_handle()
2396 binder_inner_proc_lock(node->proc); in binder_translate_handle()
2400 if (node->proc) in binder_translate_handle()
2401 binder_inner_proc_unlock(node->proc); in binder_translate_handle()
2439 struct binder_proc *proc = thread->proc; in binder_translate_fd() local
2452 proc->pid, thread->pid, in binder_translate_fd()
2462 proc->pid, thread->pid, fd); in binder_translate_fd()
2466 ret = security_binder_transfer_file(proc->tsk, target_proc->tsk, file); in binder_translate_fd()
2502 struct binder_proc *proc = thread->proc; in binder_translate_fd_array() local
2508 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2515 proc->pid, thread->pid, (u64)fda->num_fds); in binder_translate_fd_array()
2527 proc->pid, thread->pid); in binder_translate_fd_array()
2561 struct binder_proc *proc = thread->proc; in binder_fixup_parent() local
2570 proc->pid, thread->pid); in binder_fixup_parent()
2579 proc->pid, thread->pid); in binder_fixup_parent()
2587 proc->pid, thread->pid); in binder_fixup_parent()
2601 * @proc: process to send the transaction to
2602 * @thread: thread in @proc to send the transaction to (may be NULL)
2606 * wake it up. If no thread is found, the work is queued to the proc
2616 struct binder_proc *proc, in binder_proc_transaction() argument
2634 binder_inner_proc_lock(proc); in binder_proc_transaction()
2636 if (proc->is_dead || (thread && thread->is_dead)) { in binder_proc_transaction()
2637 binder_inner_proc_unlock(proc); in binder_proc_transaction()
2643 thread = binder_select_thread_ilocked(proc); in binder_proc_transaction()
2648 binder_enqueue_work_ilocked(&t->work, &proc->todo); in binder_proc_transaction()
2653 binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */); in binder_proc_transaction()
2655 binder_inner_proc_unlock(proc); in binder_proc_transaction()
2664 * @proc: returns @node->proc if valid
2665 * @error: if no @proc then returns BR_DEAD_REPLY
2675 * the transaction. We also need a tmpref on the proc while we are
2678 * Return: The target_node with refs taken or NULL if no @node->proc is NULL.
2679 * Also sets @proc if valid. If the @node->proc is NULL indicating that the
2680 * target proc has died, @error is set to BR_DEAD_REPLY
2690 if (node->proc) { in binder_get_node_refs_for_txn()
2694 node->proc->tmp_ref++; in binder_get_node_refs_for_txn()
2695 *procp = node->proc; in binder_get_node_refs_for_txn()
2703 static void binder_transaction(struct binder_proc *proc, in binder_transaction() argument
2725 struct binder_context *context = proc->context; in binder_transaction()
2731 e->from_proc = proc->pid; in binder_transaction()
2736 e->context_name = proc->context->name; in binder_transaction()
2739 binder_inner_proc_lock(proc); in binder_transaction()
2742 binder_inner_proc_unlock(proc); in binder_transaction()
2744 proc->pid, thread->pid); in binder_transaction()
2753 proc->pid, thread->pid, in_reply_to->debug_id, in binder_transaction()
2759 binder_inner_proc_unlock(proc); in binder_transaction()
2767 binder_inner_proc_unlock(proc); in binder_transaction()
2777 proc->pid, thread->pid, in binder_transaction()
2781 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
2789 target_proc = target_thread->proc; in binder_transaction()
2791 binder_inner_proc_unlock(target_thread->proc); in binder_transaction()
2803 binder_proc_lock(proc); in binder_transaction()
2804 ref = binder_get_ref_olocked(proc, tr->target.handle, in binder_transaction()
2812 proc->pid, thread->pid); in binder_transaction()
2815 binder_proc_unlock(proc); in binder_transaction()
2826 if (target_node && target_proc->pid == proc->pid) { in binder_transaction()
2828 proc->pid, thread->pid); in binder_transaction()
2844 if (WARN_ON(proc == target_proc)) { in binder_transaction()
2850 if (security_binder_transaction(proc->tsk, in binder_transaction()
2857 binder_inner_proc_lock(proc); in binder_transaction()
2868 * thread from proc->waiting_threads to enqueue in binder_transaction()
2873 proc->pid, thread->pid); in binder_transaction()
2874 binder_inner_proc_unlock(proc); in binder_transaction()
2888 proc->pid, thread->pid, tmp->debug_id, in binder_transaction()
2893 binder_inner_proc_unlock(proc); in binder_transaction()
2904 if (from && from->proc == target_proc) { in binder_transaction()
2914 binder_inner_proc_unlock(proc); in binder_transaction()
2945 proc->pid, thread->pid, t->debug_id, in binder_transaction()
2954 proc->pid, thread->pid, t->debug_id, in binder_transaction()
2965 t->sender_euid = task_euid(proc->tsk); in binder_transaction()
2999 proc->pid, thread->pid); in binder_transaction()
3008 proc->pid, thread->pid); in binder_transaction()
3016 proc->pid, thread->pid, (u64)tr->offsets_size); in binder_transaction()
3024 proc->pid, thread->pid, in binder_transaction()
3041 proc->pid, thread->pid, (u64)*offp, in binder_transaction()
3103 proc->pid, thread->pid); in binder_transaction()
3114 proc->pid, thread->pid); in binder_transaction()
3139 proc->pid, thread->pid); in binder_transaction()
3149 proc->pid, thread->pid); in binder_transaction()
3155 /* Fixup buffer pointer to target proc address space */ in binder_transaction()
3176 proc->pid, thread->pid, hdr->type); in binder_transaction()
3201 binder_inner_proc_lock(proc); in binder_transaction()
3213 binder_inner_proc_unlock(proc); in binder_transaction()
3215 binder_inner_proc_lock(proc); in binder_transaction()
3217 binder_inner_proc_unlock(proc); in binder_transaction()
3243 binder_dequeue_work(proc, tcomplete); in binder_transaction()
3279 proc->pid, thread->pid, return_error, return_error_param, in binder_transaction()
3311 static int binder_thread_write(struct binder_proc *proc, in binder_thread_write() argument
3317 struct binder_context *context = proc->context; in binder_thread_write()
3331 atomic_inc(&proc->stats.bc[_IOC_NR(cmd)]); in binder_thread_write()
3355 if (ctx_mgr_node->proc == proc) { in binder_thread_write()
3357 proc->pid, thread->pid); in binder_thread_write()
3362 proc, ctx_mgr_node, in binder_thread_write()
3369 proc, target, increment, strong, in binder_thread_write()
3373 proc->pid, thread->pid, in binder_thread_write()
3393 proc->pid, thread->pid, debug_string, in binder_thread_write()
3399 proc->pid, thread->pid, debug_string, in binder_thread_write()
3417 node = binder_get_node(proc, node_ptr); in binder_thread_write()
3420 proc->pid, thread->pid, in binder_thread_write()
3429 proc->pid, thread->pid, in binder_thread_write()
3441 proc->pid, thread->pid, in binder_thread_write()
3451 proc->pid, thread->pid, in binder_thread_write()
3464 proc->pid, thread->pid, in binder_thread_write()
3487 buffer = binder_alloc_prepare_to_free(&proc->alloc, in binder_thread_write()
3493 proc->pid, thread->pid, in binder_thread_write()
3498 proc->pid, thread->pid, in binder_thread_write()
3505 proc->pid, thread->pid, (u64)data_ptr, in binder_thread_write()
3509 binder_inner_proc_lock(proc); in binder_thread_write()
3514 binder_inner_proc_unlock(proc); in binder_thread_write()
3522 BUG_ON(buf_node->proc != proc); in binder_thread_write()
3529 w, &proc->todo); in binder_thread_write()
3530 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
3535 binder_transaction_buffer_release(proc, buffer, NULL); in binder_thread_write()
3536 binder_alloc_free_buf(&proc->alloc, buffer); in binder_thread_write()
3547 binder_transaction(proc, thread, &tr.transaction_data, in binder_thread_write()
3558 binder_transaction(proc, thread, &tr, in binder_thread_write()
3566 proc->pid, thread->pid); in binder_thread_write()
3567 binder_inner_proc_lock(proc); in binder_thread_write()
3571 proc->pid, thread->pid); in binder_thread_write()
3572 } else if (proc->requested_threads == 0) { in binder_thread_write()
3575 proc->pid, thread->pid); in binder_thread_write()
3577 proc->requested_threads--; in binder_thread_write()
3578 proc->requested_threads_started++; in binder_thread_write()
3581 binder_inner_proc_unlock(proc); in binder_thread_write()
3586 proc->pid, thread->pid); in binder_thread_write()
3590 proc->pid, thread->pid); in binder_thread_write()
3597 proc->pid, thread->pid); in binder_thread_write()
3630 proc->pid, thread->pid); in binder_thread_write()
3634 binder_proc_lock(proc); in binder_thread_write()
3635 ref = binder_get_ref_olocked(proc, target, false); in binder_thread_write()
3638 proc->pid, thread->pid, in binder_thread_write()
3643 binder_proc_unlock(proc); in binder_thread_write()
3650 proc->pid, thread->pid, in binder_thread_write()
3662 proc->pid, thread->pid); in binder_thread_write()
3664 binder_proc_unlock(proc); in binder_thread_write()
3672 if (ref->node->proc == NULL) { in binder_thread_write()
3675 binder_inner_proc_lock(proc); in binder_thread_write()
3677 &ref->death->work, &proc->todo); in binder_thread_write()
3678 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
3679 binder_inner_proc_unlock(proc); in binder_thread_write()
3684 proc->pid, thread->pid); in binder_thread_write()
3686 binder_proc_unlock(proc); in binder_thread_write()
3692 proc->pid, thread->pid, in binder_thread_write()
3696 binder_proc_unlock(proc); in binder_thread_write()
3700 binder_inner_proc_lock(proc); in binder_thread_write()
3712 &proc->todo); in binder_thread_write()
3714 proc); in binder_thread_write()
3720 binder_inner_proc_unlock(proc); in binder_thread_write()
3723 binder_proc_unlock(proc); in binder_thread_write()
3734 binder_inner_proc_lock(proc); in binder_thread_write()
3735 list_for_each_entry(w, &proc->delivered_death, in binder_thread_write()
3749 proc->pid, thread->pid, (u64)cookie, in binder_thread_write()
3753 proc->pid, thread->pid, (u64)cookie); in binder_thread_write()
3754 binder_inner_proc_unlock(proc); in binder_thread_write()
3768 &proc->todo); in binder_thread_write()
3769 binder_wakeup_proc_ilocked(proc); in binder_thread_write()
3772 binder_inner_proc_unlock(proc); in binder_thread_write()
3777 proc->pid, thread->pid, cmd); in binder_thread_write()
3785 static void binder_stat_br(struct binder_proc *proc, in binder_stat_br() argument
3791 atomic_inc(&proc->stats.br[_IOC_NR(cmd)]); in binder_stat_br()
3796 static int binder_put_node_cmd(struct binder_proc *proc, in binder_put_node_cmd() argument
3818 binder_stat_br(proc, thread, cmd); in binder_put_node_cmd()
3820 proc->pid, thread->pid, cmd_name, node_debug_id, in binder_put_node_cmd()
3831 struct binder_proc *proc = thread->proc; in binder_wait_for_work() local
3835 binder_inner_proc_lock(proc); in binder_wait_for_work()
3842 &proc->waiting_threads); in binder_wait_for_work()
3843 binder_inner_proc_unlock(proc); in binder_wait_for_work()
3845 binder_inner_proc_lock(proc); in binder_wait_for_work()
3853 binder_inner_proc_unlock(proc); in binder_wait_for_work()
3859 static int binder_thread_read(struct binder_proc *proc, in binder_thread_read() argument
3878 binder_inner_proc_lock(proc); in binder_thread_read()
3880 binder_inner_proc_unlock(proc); in binder_thread_read()
3886 !binder_worklist_empty(proc, &thread->todo)); in binder_thread_read()
3891 proc->pid, thread->pid, thread->looper); in binder_thread_read()
3895 binder_set_nice(proc->default_priority); in binder_thread_read()
3918 binder_inner_proc_lock(proc); in binder_thread_read()
3921 else if (!binder_worklist_empty_ilocked(&proc->todo) && in binder_thread_read()
3923 list = &proc->todo; in binder_thread_read()
3925 binder_inner_proc_unlock(proc); in binder_thread_read()
3934 binder_inner_proc_unlock(proc); in binder_thread_read()
3943 binder_inner_proc_unlock(proc); in binder_thread_read()
3951 binder_inner_proc_unlock(proc); in binder_thread_read()
3958 binder_stat_br(proc, thread, cmd); in binder_thread_read()
3961 binder_inner_proc_unlock(proc); in binder_thread_read()
3969 binder_stat_br(proc, thread, cmd); in binder_thread_read()
3972 proc->pid, thread->pid); in binder_thread_read()
3984 BUG_ON(proc != node->proc); in binder_thread_read()
4010 proc->pid, thread->pid, in binder_thread_read()
4014 rb_erase(&node->rb_node, &proc->nodes); in binder_thread_read()
4015 binder_inner_proc_unlock(proc); in binder_thread_read()
4029 binder_inner_proc_unlock(proc); in binder_thread_read()
4033 proc, thread, &ptr, node_ptr, in binder_thread_read()
4038 proc, thread, &ptr, node_ptr, in binder_thread_read()
4043 proc, thread, &ptr, node_ptr, in binder_thread_read()
4048 proc, thread, &ptr, node_ptr, in binder_thread_read()
4054 proc->pid, thread->pid, in binder_thread_read()
4077 proc->pid, thread->pid, in binder_thread_read()
4083 binder_inner_proc_unlock(proc); in binder_thread_read()
4088 w, &proc->delivered_death); in binder_thread_read()
4089 binder_inner_proc_unlock(proc); in binder_thread_read()
4098 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4132 struct task_struct *sender = t_from->proc->tsk; in binder_thread_read()
4144 binder_alloc_get_user_buffer_offset(&proc->alloc)); in binder_thread_read()
4171 binder_stat_br(proc, thread, cmd); in binder_thread_read()
4174 proc->pid, thread->pid, in binder_thread_read()
4177 t->debug_id, t_from ? t_from->proc->pid : 0, in binder_thread_read()
4186 binder_inner_proc_lock(thread->proc); in binder_thread_read()
4190 binder_inner_proc_unlock(thread->proc); in binder_thread_read()
4200 binder_inner_proc_lock(proc); in binder_thread_read()
4201 if (proc->requested_threads == 0 && in binder_thread_read()
4202 list_empty(&thread->proc->waiting_threads) && in binder_thread_read()
4203 proc->requested_threads_started < proc->max_threads && in binder_thread_read()
4207 proc->requested_threads++; in binder_thread_read()
4208 binder_inner_proc_unlock(proc); in binder_thread_read()
4211 proc->pid, thread->pid); in binder_thread_read()
4214 binder_stat_br(proc, thread, BR_SPAWN_LOOPER); in binder_thread_read()
4216 binder_inner_proc_unlock(proc); in binder_thread_read()
4220 static void binder_release_work(struct binder_proc *proc, in binder_release_work() argument
4227 binder_inner_proc_lock(proc); in binder_release_work()
4230 binder_inner_proc_unlock(proc); in binder_release_work()
4280 struct binder_proc *proc, struct binder_thread *new_thread) in binder_get_thread_ilocked() argument
4284 struct rb_node **p = &proc->threads.rb_node; in binder_get_thread_ilocked()
4301 thread->proc = proc; in binder_get_thread_ilocked()
4307 rb_insert_color(&thread->rb_node, &proc->threads); in binder_get_thread_ilocked()
4317 static struct binder_thread *binder_get_thread(struct binder_proc *proc) in binder_get_thread() argument
4322 binder_inner_proc_lock(proc); in binder_get_thread()
4323 thread = binder_get_thread_ilocked(proc, NULL); in binder_get_thread()
4324 binder_inner_proc_unlock(proc); in binder_get_thread()
4329 binder_inner_proc_lock(proc); in binder_get_thread()
4330 thread = binder_get_thread_ilocked(proc, new_thread); in binder_get_thread()
4331 binder_inner_proc_unlock(proc); in binder_get_thread()
4338 static void binder_free_proc(struct binder_proc *proc) in binder_free_proc() argument
4340 BUG_ON(!list_empty(&proc->todo)); in binder_free_proc()
4341 BUG_ON(!list_empty(&proc->delivered_death)); in binder_free_proc()
4342 binder_alloc_deferred_release(&proc->alloc); in binder_free_proc()
4343 put_task_struct(proc->tsk); in binder_free_proc()
4345 kfree(proc); in binder_free_proc()
4352 binder_proc_dec_tmpref(thread->proc); in binder_free_thread()
4356 static int binder_thread_release(struct binder_proc *proc, in binder_thread_release() argument
4364 binder_inner_proc_lock(thread->proc); in binder_thread_release()
4366 * take a ref on the proc so it survives in binder_thread_release()
4367 * after we remove this thread from proc->threads. in binder_thread_release()
4371 proc->tmp_ref++; in binder_thread_release()
4377 rb_erase(&thread->rb_node, &proc->threads); in binder_thread_release()
4391 proc->pid, thread->pid, in binder_thread_release()
4424 binder_inner_proc_unlock(thread->proc); in binder_thread_release()
4437 binder_release_work(proc, &thread->todo); in binder_thread_release()
4445 struct binder_proc *proc = filp->private_data; in binder_poll() local
4449 thread = binder_get_thread(proc); in binder_poll()
4453 binder_inner_proc_lock(thread->proc); in binder_poll()
4457 binder_inner_proc_unlock(thread->proc); in binder_poll()
4472 struct binder_proc *proc = filp->private_data; in binder_ioctl_write_read() local
4487 proc->pid, thread->pid, in binder_ioctl_write_read()
4492 ret = binder_thread_write(proc, thread, in binder_ioctl_write_read()
4505 ret = binder_thread_read(proc, thread, bwr.read_buffer, in binder_ioctl_write_read()
4510 binder_inner_proc_lock(proc); in binder_ioctl_write_read()
4511 if (!binder_worklist_empty_ilocked(&proc->todo)) in binder_ioctl_write_read()
4512 binder_wakeup_proc_ilocked(proc); in binder_ioctl_write_read()
4513 binder_inner_proc_unlock(proc); in binder_ioctl_write_read()
4522 proc->pid, thread->pid, in binder_ioctl_write_read()
4536 struct binder_proc *proc = filp->private_data; in binder_ioctl_set_ctx_mgr() local
4537 struct binder_context *context = proc->context; in binder_ioctl_set_ctx_mgr()
4547 ret = security_binder_set_context_mgr(proc->tsk); in binder_ioctl_set_ctx_mgr()
4562 new_node = binder_new_node(proc, NULL); in binder_ioctl_set_ctx_mgr()
4580 static int binder_ioctl_get_node_debug_info(struct binder_proc *proc, in binder_ioctl_get_node_debug_info() argument
4588 binder_inner_proc_lock(proc); in binder_ioctl_get_node_debug_info()
4589 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in binder_ioctl_get_node_debug_info()
4600 binder_inner_proc_unlock(proc); in binder_ioctl_get_node_debug_info()
4608 struct binder_proc *proc = filp->private_data; in binder_ioctl() local
4614 proc->pid, current->pid, cmd, arg);*/ in binder_ioctl()
4616 binder_selftest_alloc(&proc->alloc); in binder_ioctl()
4624 thread = binder_get_thread(proc); in binder_ioctl()
4644 binder_inner_proc_lock(proc); in binder_ioctl()
4645 proc->max_threads = max_threads; in binder_ioctl()
4646 binder_inner_proc_unlock(proc); in binder_ioctl()
4656 proc->pid, thread->pid); in binder_ioctl()
4657 binder_thread_release(proc, thread); in binder_ioctl()
4682 ret = binder_ioctl_get_node_debug_info(proc, &info); in binder_ioctl()
4702 pr_info("%d:%d ioctl %x %lx returned %d\n", proc->pid, current->pid, cmd, arg, ret); in binder_ioctl()
4710 struct binder_proc *proc = vma->vm_private_data; in binder_vma_open() local
4714 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_open()
4721 struct binder_proc *proc = vma->vm_private_data; in binder_vma_close() local
4725 proc->pid, vma->vm_start, vma->vm_end, in binder_vma_close()
4728 binder_alloc_vma_close(&proc->alloc); in binder_vma_close()
4729 binder_defer_work(proc, BINDER_DEFERRED_PUT_FILES); in binder_vma_close()
4746 struct binder_proc *proc = filp->private_data; in binder_mmap() local
4749 if (proc->tsk != current->group_leader) in binder_mmap()
4757 __func__, proc->pid, vma->vm_start, vma->vm_end, in binder_mmap()
4770 vma->vm_private_data = proc; in binder_mmap()
4772 ret = binder_alloc_mmap_handler(&proc->alloc, vma); in binder_mmap()
4775 mutex_lock(&proc->files_lock); in binder_mmap()
4776 proc->files = get_files_struct(current); in binder_mmap()
4777 mutex_unlock(&proc->files_lock); in binder_mmap()
4782 proc->pid, vma->vm_start, vma->vm_end, failure_string, ret); in binder_mmap()
4788 struct binder_proc *proc; in binder_open() local
4794 proc = kzalloc(sizeof(*proc), GFP_KERNEL); in binder_open()
4795 if (proc == NULL) in binder_open()
4797 spin_lock_init(&proc->inner_lock); in binder_open()
4798 spin_lock_init(&proc->outer_lock); in binder_open()
4800 proc->tsk = current->group_leader; in binder_open()
4801 mutex_init(&proc->files_lock); in binder_open()
4802 INIT_LIST_HEAD(&proc->todo); in binder_open()
4803 proc->default_priority = task_nice(current); in binder_open()
4806 proc->context = &binder_dev->context; in binder_open()
4807 binder_alloc_init(&proc->alloc); in binder_open()
4810 proc->pid = current->group_leader->pid; in binder_open()
4811 INIT_LIST_HEAD(&proc->delivered_death); in binder_open()
4812 INIT_LIST_HEAD(&proc->waiting_threads); in binder_open()
4813 filp->private_data = proc; in binder_open()
4816 hlist_add_head(&proc->proc_node, &binder_procs); in binder_open()
4822 snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); in binder_open()
4824 * proc debug entries are shared between contexts, so in binder_open()
4830 proc->debugfs_entry = debugfs_create_file(strbuf, 0444, in binder_open()
4832 (void *)(unsigned long)proc->pid, in binder_open()
4841 struct binder_proc *proc = filp->private_data; in binder_flush() local
4843 binder_defer_work(proc, BINDER_DEFERRED_FLUSH); in binder_flush()
4848 static void binder_deferred_flush(struct binder_proc *proc) in binder_deferred_flush() argument
4853 binder_inner_proc_lock(proc); in binder_deferred_flush()
4854 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) { in binder_deferred_flush()
4863 binder_inner_proc_unlock(proc); in binder_deferred_flush()
4866 "binder_flush: %d woke %d threads\n", proc->pid, in binder_deferred_flush()
4872 struct binder_proc *proc = filp->private_data; in binder_release() local
4874 debugfs_remove(proc->debugfs_entry); in binder_release()
4875 binder_defer_work(proc, BINDER_DEFERRED_RELEASE); in binder_release()
4884 struct binder_proc *proc = node->proc; in binder_node_release() local
4886 binder_release_work(proc, &node->async_todo); in binder_node_release()
4889 binder_inner_proc_lock(proc); in binder_node_release()
4896 binder_inner_proc_unlock(proc); in binder_node_release()
4903 node->proc = NULL; in binder_node_release()
4906 binder_inner_proc_unlock(proc); in binder_node_release()
4920 binder_inner_proc_lock(ref->proc); in binder_node_release()
4922 binder_inner_proc_unlock(ref->proc); in binder_node_release()
4931 &ref->proc->todo); in binder_node_release()
4932 binder_wakeup_proc_ilocked(ref->proc); in binder_node_release()
4933 binder_inner_proc_unlock(ref->proc); in binder_node_release()
4945 static void binder_deferred_release(struct binder_proc *proc) in binder_deferred_release() argument
4947 struct binder_context *context = proc->context; in binder_deferred_release()
4951 BUG_ON(proc->files); in binder_deferred_release()
4954 hlist_del(&proc->proc_node); in binder_deferred_release()
4959 context->binder_context_mgr_node->proc == proc) { in binder_deferred_release()
4962 __func__, proc->pid); in binder_deferred_release()
4966 binder_inner_proc_lock(proc); in binder_deferred_release()
4968 * Make sure proc stays alive after we in binder_deferred_release()
4971 proc->tmp_ref++; in binder_deferred_release()
4973 proc->is_dead = true; in binder_deferred_release()
4976 while ((n = rb_first(&proc->threads))) { in binder_deferred_release()
4980 binder_inner_proc_unlock(proc); in binder_deferred_release()
4982 active_transactions += binder_thread_release(proc, thread); in binder_deferred_release()
4983 binder_inner_proc_lock(proc); in binder_deferred_release()
4988 while ((n = rb_first(&proc->nodes))) { in binder_deferred_release()
4999 rb_erase(&node->rb_node, &proc->nodes); in binder_deferred_release()
5000 binder_inner_proc_unlock(proc); in binder_deferred_release()
5002 binder_inner_proc_lock(proc); in binder_deferred_release()
5004 binder_inner_proc_unlock(proc); in binder_deferred_release()
5007 binder_proc_lock(proc); in binder_deferred_release()
5008 while ((n = rb_first(&proc->refs_by_desc))) { in binder_deferred_release()
5014 binder_proc_unlock(proc); in binder_deferred_release()
5016 binder_proc_lock(proc); in binder_deferred_release()
5018 binder_proc_unlock(proc); in binder_deferred_release()
5020 binder_release_work(proc, &proc->todo); in binder_deferred_release()
5021 binder_release_work(proc, &proc->delivered_death); in binder_deferred_release()
5025 __func__, proc->pid, threads, nodes, incoming_refs, in binder_deferred_release()
5028 binder_proc_dec_tmpref(proc); in binder_deferred_release()
5033 struct binder_proc *proc; in binder_deferred_func() local
5041 proc = hlist_entry(binder_deferred_list.first, in binder_deferred_func()
5043 hlist_del_init(&proc->deferred_work_node); in binder_deferred_func()
5044 defer = proc->deferred_work; in binder_deferred_func()
5045 proc->deferred_work = 0; in binder_deferred_func()
5047 proc = NULL; in binder_deferred_func()
5054 mutex_lock(&proc->files_lock); in binder_deferred_func()
5055 files = proc->files; in binder_deferred_func()
5057 proc->files = NULL; in binder_deferred_func()
5058 mutex_unlock(&proc->files_lock); in binder_deferred_func()
5062 binder_deferred_flush(proc); in binder_deferred_func()
5065 binder_deferred_release(proc); /* frees proc */ in binder_deferred_func()
5069 } while (proc); in binder_deferred_func()
5074 binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer) in binder_defer_work() argument
5077 proc->deferred_work |= defer; in binder_defer_work()
5078 if (hlist_unhashed(&proc->deferred_work_node)) { in binder_defer_work()
5079 hlist_add_head(&proc->deferred_work_node, in binder_defer_work()
5087 struct binder_proc *proc, in print_binder_transaction_ilocked() argument
5099 t->from ? t->from->proc->pid : 0, in print_binder_transaction_ilocked()
5106 if (proc != to_proc) { in print_binder_transaction_ilocked()
5109 * correct proc inner lock for this node in print_binder_transaction_ilocked()
5127 struct binder_proc *proc, in print_binder_work_ilocked() argument
5139 m, proc, transaction_prefix, t); in print_binder_work_ilocked()
5189 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
5193 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
5197 print_binder_transaction_ilocked(m, thread->proc, in print_binder_thread_ilocked()
5203 print_binder_work_ilocked(m, thread->proc, " ", in print_binder_thread_ilocked()
5227 seq_puts(m, " proc"); in print_binder_node_nilocked()
5229 seq_printf(m, " %d", ref->proc->pid); in print_binder_node_nilocked()
5232 if (node->proc) { in print_binder_node_nilocked()
5234 print_binder_work_ilocked(m, node->proc, " ", in print_binder_node_nilocked()
5245 ref->node->proc ? "" : "dead ", in print_binder_ref_olocked()
5252 struct binder_proc *proc, int print_all) in print_binder_proc() argument
5260 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc()
5261 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc()
5264 binder_inner_proc_lock(proc); in print_binder_proc()
5265 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc()
5269 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) { in print_binder_proc()
5279 binder_inner_proc_unlock(proc); in print_binder_proc()
5286 binder_inner_proc_lock(proc); in print_binder_proc()
5288 binder_inner_proc_unlock(proc); in print_binder_proc()
5293 binder_proc_lock(proc); in print_binder_proc()
5294 for (n = rb_first(&proc->refs_by_desc); in print_binder_proc()
5300 binder_proc_unlock(proc); in print_binder_proc()
5302 binder_alloc_print_allocated(m, &proc->alloc); in print_binder_proc()
5303 binder_inner_proc_lock(proc); in print_binder_proc()
5304 list_for_each_entry(w, &proc->todo, entry) in print_binder_proc()
5305 print_binder_work_ilocked(m, proc, " ", in print_binder_proc()
5307 list_for_each_entry(w, &proc->delivered_death, entry) { in print_binder_proc()
5311 binder_inner_proc_unlock(proc); in print_binder_proc()
5360 "proc",
5412 struct binder_proc *proc) in print_binder_proc_stats() argument
5419 binder_alloc_get_free_async_space(&proc->alloc); in print_binder_proc_stats()
5421 seq_printf(m, "proc %d\n", proc->pid); in print_binder_proc_stats()
5422 seq_printf(m, "context %s\n", proc->context->name); in print_binder_proc_stats()
5425 binder_inner_proc_lock(proc); in print_binder_proc_stats()
5426 for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
5429 list_for_each_entry(thread, &proc->waiting_threads, waiting_thread_node) in print_binder_proc_stats()
5435 " free async space %zd\n", proc->requested_threads, in print_binder_proc_stats()
5436 proc->requested_threads_started, proc->max_threads, in print_binder_proc_stats()
5440 for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n)) in print_binder_proc_stats()
5442 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
5447 binder_proc_lock(proc); in print_binder_proc_stats()
5448 for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) { in print_binder_proc_stats()
5455 binder_proc_unlock(proc); in print_binder_proc_stats()
5458 count = binder_alloc_get_allocated_count(&proc->alloc); in print_binder_proc_stats()
5461 binder_alloc_print_pages(m, &proc->alloc); in print_binder_proc_stats()
5464 binder_inner_proc_lock(proc); in print_binder_proc_stats()
5465 list_for_each_entry(w, &proc->todo, entry) { in print_binder_proc_stats()
5469 binder_inner_proc_unlock(proc); in print_binder_proc_stats()
5472 print_binder_stats(m, " ", &proc->stats); in print_binder_proc_stats()
5478 struct binder_proc *proc; in binder_state_show() local
5508 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_state_show()
5509 print_binder_proc(m, proc, 1); in binder_state_show()
5517 struct binder_proc *proc; in binder_stats_show() local
5524 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_stats_show()
5525 print_binder_proc_stats(m, proc); in binder_stats_show()
5533 struct binder_proc *proc; in binder_transactions_show() local
5537 hlist_for_each_entry(proc, &binder_procs, proc_node) in binder_transactions_show()
5538 print_binder_proc(m, proc, 0); in binder_transactions_show()
5552 seq_puts(m, "binder proc state:\n"); in binder_proc_show()
5668 binder_debugfs_dir_entry_proc = debugfs_create_dir("proc", in binder_init()