ANDROID: vendor_hooks: Add hooks for binder proc transaction

When binder transaction happened, We want to know it's transaction code
and it is oneway or not.

Bug: 208910215

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: Ic03e5481e96e120a1953a101895714db04ca2bdf
This commit is contained in:
Liujie Xie
2021-12-03 12:01:03 +08:00
parent 32432740cd
commit 05aa93d251
3 changed files with 9 additions and 0 deletions

View File

@@ -2529,6 +2529,9 @@ static int binder_proc_transaction(struct binder_transaction *t,
binder_enqueue_work_ilocked(&t->work, &node->async_todo); binder_enqueue_work_ilocked(&t->work, &node->async_todo);
} }
trace_android_vh_binder_proc_transaction_end(current, proc->tsk,
thread ? thread->task : NULL, t->code, pending_async, !oneway);
if (!pending_async) if (!pending_async)
binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */); binder_wakeup_thread_ilocked(proc, thread, !oneway /* sync */);

View File

@@ -293,6 +293,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_trans);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_binder_transaction); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_binder_transaction);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_preset); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_preset);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_new_ref); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_new_ref);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_del_ref); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_del_ref);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_post_init_entity_util_avg); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_post_init_entity_util_avg);

View File

@@ -64,6 +64,11 @@ DECLARE_HOOK(android_vh_binder_proc_transaction,
struct task_struct *binder_th_task, int node_debug_id, struct task_struct *binder_th_task, int node_debug_id,
unsigned int code, bool pending_async), unsigned int code, bool pending_async),
TP_ARGS(caller_task, binder_proc_task, binder_th_task, node_debug_id, code, pending_async)); TP_ARGS(caller_task, binder_proc_task, binder_th_task, node_debug_id, code, pending_async));
DECLARE_HOOK(android_vh_binder_proc_transaction_end,
TP_PROTO(struct task_struct *caller_task, struct task_struct *binder_proc_task,
struct task_struct *binder_th_task, unsigned int code,
bool pending_async, bool sync),
TP_ARGS(caller_task, binder_proc_task, binder_th_task, code, pending_async, sync));
DECLARE_HOOK(android_vh_binder_new_ref, DECLARE_HOOK(android_vh_binder_new_ref,
TP_PROTO(struct task_struct *proc, uint32_t ref_desc, int node_debug_id), TP_PROTO(struct task_struct *proc, uint32_t ref_desc, int node_debug_id),
TP_ARGS(proc, ref_desc, node_debug_id)); TP_ARGS(proc, ref_desc, node_debug_id));