diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 425afa2ecb92..8b38bcbdf6ee 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -3211,6 +3211,7 @@ static void binder_transaction(struct binder_proc *proc, target_proc = target_thread->proc; target_proc->tmp_ref++; binder_inner_proc_unlock(target_thread->proc); + trace_android_vh_binder_reply(target_proc, proc, thread, tr); } else { if (tr->target.handle) { struct binder_ref *ref; @@ -3273,6 +3274,7 @@ static void binder_transaction(struct binder_proc *proc, return_error_line = __LINE__; goto err_invalid_target_handle; } + trace_android_vh_binder_trans(target_proc, proc, thread, tr); if (security_binder_transaction(proc->cred, target_proc->cred) < 0) { binder_txn_error("%d:%d transaction credentials failed\n", diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 8b3383eaaf2d..d729129f3f25 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -25,6 +25,7 @@ #include #include "binder_alloc.h" #include "binder_trace.h" +#include struct list_lru binder_freelist; @@ -446,6 +447,8 @@ static struct binder_buffer *binder_alloc_new_buf_locked( unsigned long curr_last_page; size_t buffer_size; + trace_android_vh_binder_alloc_new_buf_locked(size, &alloc->free_async_space, is_async); + if (is_async && alloc->free_async_space < size) { binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC, "%d: binder_alloc_buf size %zd failed, no async space left\n", diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 2fd4d34cf7c9..31dde279e279 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -293,6 +293,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mem_cgroup_css_online); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mem_cgroup_free); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mem_cgroup_alloc); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpuset_fork); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_alloc_new_buf_locked); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_reply); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_trans); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmap_region); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_try_to_unmap_one); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_slab_bypass); diff --git a/include/trace/hooks/binder.h b/include/trace/hooks/binder.h index e71334f96007..77bfa4db10e2 100644 --- a/include/trace/hooks/binder.h +++ b/include/trace/hooks/binder.h @@ -78,6 +78,19 @@ DECLARE_HOOK(android_vh_binder_select_special_worklist, TP_PROTO(struct list_head **list, struct binder_thread *thread, struct binder_proc *proc, int wait_for_proc_work, bool *nothing_to_do), TP_ARGS(list, thread, proc, wait_for_proc_work, nothing_to_do)); + +DECLARE_HOOK(android_vh_binder_alloc_new_buf_locked, + TP_PROTO(size_t size, size_t *free_async_space, int is_async), + TP_ARGS(size, free_async_space, is_async)); +struct binder_transaction_data; +DECLARE_HOOK(android_vh_binder_reply, + TP_PROTO(struct binder_proc *target_proc, struct binder_proc *proc, + struct binder_thread *thread, struct binder_transaction_data *tr), + TP_ARGS(target_proc, proc, thread, tr)); +DECLARE_HOOK(android_vh_binder_trans, + TP_PROTO(struct binder_proc *target_proc, struct binder_proc *proc, + struct binder_thread *thread, struct binder_transaction_data *tr), + TP_ARGS(target_proc, proc, thread, tr)); DECLARE_HOOK(android_vh_binder_proc_transaction, TP_PROTO(struct task_struct *caller_task, struct task_struct *binder_proc_task, struct task_struct *binder_th_task, int node_debug_id,