ANDROID: vendor_hooks:vendor hooks for binder thread info

the first one is the lifecycle that they are added to thread pool,
and they are released. another is that the data is readed by thread.

Bug: 333839270

Change-Id: I41d58474aa66533a2104c07aae525bf09e32df4d
Signed-off-by: Muduo Qin <muduo.qin@tcl.corp-partner.google.com>
(cherry picked from commit b98dd52b77f25f724052221c54b4e197692406e7)
This commit is contained in:
Muduo Qin
2024-05-09 19:53:05 +08:00
committed by Treehugger Robot
parent bb95139149
commit a78c22c33d
3 changed files with 15 additions and 0 deletions
+3
View File
@@ -4516,6 +4516,7 @@ static int binder_thread_write(struct binder_proc *proc,
}
thread->looper |= BINDER_LOOPER_STATE_REGISTERED;
binder_inner_proc_unlock(proc);
trace_android_vh_binder_looper_state_registered(thread, proc);
break;
case BC_ENTER_LOOPER:
binder_debug(BINDER_DEBUG_THREADS,
@@ -5598,6 +5599,7 @@ static int binder_thread_release(struct binder_proc *proc,
if (send_reply)
binder_send_failed_reply(send_reply, BR_DEAD_REPLY);
binder_release_work(proc, &thread->todo);
trace_android_vh_binder_thread_release(proc, thread);
binder_thread_dec_tmpref(thread);
return active_transactions;
}
@@ -5671,6 +5673,7 @@ static int binder_ioctl_write_read(struct file *filp, unsigned long arg,
if (!binder_worklist_empty_ilocked(&proc->todo) || has_special_work)
binder_wakeup_proc_ilocked(proc);
binder_inner_proc_unlock(proc);
trace_android_vh_binder_read_done(proc, thread);
if (ret < 0) {
if (copy_to_user(ubuf, &bwr, sizeof(bwr)))
ret = -EFAULT;
+3
View File
@@ -620,3 +620,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_split_huge_page_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_try_split_folio_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_scmi_limit_notify_cb);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_fiq_dump);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_looper_state_registered);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_thread_release);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_read_done);
+9
View File
@@ -137,6 +137,15 @@ DECLARE_HOOK(android_vh_binder_new_ref,
DECLARE_HOOK(android_vh_binder_del_ref,
TP_PROTO(struct binder_proc *proc, uint32_t ref_desc),
TP_ARGS(proc, ref_desc));
DECLARE_HOOK(android_vh_binder_looper_state_registered,
TP_PROTO(struct binder_thread *thread, struct binder_proc *proc),
TP_ARGS(thread, proc));
DECLARE_HOOK(android_vh_binder_thread_release,
TP_PROTO(struct binder_proc *proc, struct binder_thread *thread),
TP_ARGS(proc, thread));
DECLARE_HOOK(android_vh_binder_read_done,
TP_PROTO(struct binder_proc *proc, struct binder_thread *thread),
TP_ARGS(proc, thread));
#endif /* _TRACE_HOOK_BINDER_H */
/* This part must be outside protection */
#include <trace/define_trace.h>