ANDROID: vendor_hooks: Add hooks for binder reference.

When servicemanager process added service proxy from other process
register the service, we want to know the matching relation between
handle in the process and service name.

Bug: 186604985
Change-Id: I466ae200cf17bc821c61bd92544a8fbe6b220a25
Signed-off-by: zhengding chen <chenzhengding@oppo.com>
Signed-off-by: shenshen mao <maoshenshen@oppo.com>
Signed-off-by: xiaosa liang <liangxiaosa@oppo.com>
This commit is contained in:
zhengding chen
2021-04-28 19:24:57 +08:00
committed by Treehugger Robot
parent 9ffdb9e847
commit bd21c75ac0
3 changed files with 10 additions and 0 deletions
+2
View File
@@ -1357,6 +1357,7 @@ retry:
"%d new ref %d desc %d for node %d\n",
proc->pid, new_ref->data.debug_id, new_ref->data.desc,
node->debug_id);
trace_android_vh_binder_new_ref(proc, new_ref->data.desc, new_ref->node->debug_id);
binder_node_unlock(node);
return new_ref;
}
@@ -1533,6 +1534,7 @@ err_no_ref:
*/
static void binder_free_ref(struct binder_ref *ref)
{
trace_android_vh_binder_del_ref(ref->proc, ref->data.desc);
if (ref->node)
binder_free_node(ref->node);
kfree(ref->death);
+2
View File
@@ -454,3 +454,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_read_fault);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_alloc_pages_reclaim_start);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_alloc_pages_reclaim_cycle_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_bd_link_disk_holder);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_new_ref);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_del_ref);
+6
View File
@@ -112,6 +112,12 @@ DECLARE_HOOK(android_vh_binder_thread_read,
TP_PROTO(struct list_head **list, struct binder_proc *proc,
struct binder_thread *thread),
TP_ARGS(list, proc, thread));
DECLARE_HOOK(android_vh_binder_new_ref,
TP_PROTO(struct binder_proc *proc, uint32_t ref_desc, int node_debug_id),
TP_ARGS(proc, ref_desc, node_debug_id));
DECLARE_HOOK(android_vh_binder_del_ref,
TP_PROTO(struct binder_proc *proc, uint32_t ref_desc),
TP_ARGS(proc, ref_desc));
#endif /* _TRACE_HOOK_BINDER_H */
/* This part must be outside protection */
#include <trace/define_trace.h>