• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM binder
4 #undef TRACE_INCLUDE_PATH
5 #define TRACE_INCLUDE_PATH trace/hooks
6 #if !defined(_TRACE_HOOK_BINDER_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define _TRACE_HOOK_BINDER_H
8 #include <linux/tracepoint.h>
9 #include <trace/hooks/vendor_hooks.h>
10 /*
11  * Following tracepoints are not exported in tracefs and provide a
12  * mechanism for vendor modules to hook and extend functionality
13  */
14 struct binder_transaction;
15 struct task_struct;
16 struct binder_alloc;
17 struct binder_proc;
18 struct binder_thread;
19 struct binder_transaction_data;
20 struct seq_file;
21 DECLARE_HOOK(android_vh_binder_transaction_init,
22 	TP_PROTO(struct binder_transaction *t),
23 	TP_ARGS(t));
24 DECLARE_HOOK(android_vh_binder_priority_skip,
25 	TP_PROTO(struct task_struct *task, bool *skip),
26 	TP_ARGS(task, skip));
27 DECLARE_HOOK(android_vh_binder_set_priority,
28 	TP_PROTO(struct binder_transaction *t, struct task_struct *task),
29 	TP_ARGS(t, task));
30 DECLARE_HOOK(android_vh_binder_restore_priority,
31 	TP_PROTO(struct binder_transaction *t, struct task_struct *task),
32 	TP_ARGS(t, task));
33 struct binder_proc;
34 struct binder_thread;
35 DECLARE_HOOK(android_vh_binder_wakeup_ilocked,
36 	TP_PROTO(struct task_struct *task, bool sync, struct binder_proc *proc),
37 	TP_ARGS(task, sync, proc));
38 DECLARE_HOOK(android_vh_binder_wait_for_work,
39 	TP_PROTO(bool do_proc_work, struct binder_thread *tsk, struct binder_proc *proc),
40 	TP_ARGS(do_proc_work, tsk, proc));
41 DECLARE_HOOK(android_vh_sync_txn_recvd,
42 	TP_PROTO(struct task_struct *tsk, struct task_struct *from),
43 	TP_ARGS(tsk, from));
44 DECLARE_HOOK(android_vh_binder_alloc_new_buf_locked,
45 	TP_PROTO(size_t size, struct binder_alloc *alloc, int is_async),
46 	TP_ARGS(size, alloc, is_async));
47 DECLARE_HOOK(android_vh_binder_reply,
48 	TP_PROTO(struct binder_proc *target_proc, struct binder_proc *proc,
49 		struct binder_thread *thread, struct binder_transaction_data *tr),
50 	TP_ARGS(target_proc, proc, thread, tr));
51 DECLARE_HOOK(android_vh_binder_trans,
52 	TP_PROTO(struct binder_proc *target_proc, struct binder_proc *proc,
53 		struct binder_thread *thread, struct binder_transaction_data *tr),
54 	TP_ARGS(target_proc, proc, thread, tr));
55 DECLARE_RESTRICTED_HOOK(android_rvh_binder_transaction,
56 	TP_PROTO(struct binder_proc *target_proc, struct binder_proc *proc,
57 		struct binder_thread *thread, struct binder_transaction_data *tr),
58 	TP_ARGS(target_proc, proc, thread, tr), 1);
59 DECLARE_HOOK(android_vh_binder_preset,
60 	TP_PROTO(struct hlist_head *hhead, struct mutex *lock),
61 	TP_ARGS(hhead, lock));
62 DECLARE_HOOK(android_vh_binder_proc_transaction,
63 	TP_PROTO(struct task_struct *caller_task, struct task_struct *binder_proc_task,
64 		struct task_struct *binder_th_task, int node_debug_id,
65 		unsigned int code, bool pending_async),
66 	TP_ARGS(caller_task, binder_proc_task, binder_th_task, node_debug_id, code, pending_async));
67 DECLARE_HOOK(android_vh_binder_proc_transaction_end,
68 	TP_PROTO(struct task_struct *caller_task, struct task_struct *binder_proc_task,
69 		struct task_struct *binder_th_task, unsigned int code,
70 		bool pending_async, bool sync),
71 	TP_ARGS(caller_task, binder_proc_task, binder_th_task, code, pending_async, sync));
72 DECLARE_HOOK(android_vh_binder_new_ref,
73 	TP_PROTO(struct task_struct *proc, uint32_t ref_desc, int node_debug_id),
74 	TP_ARGS(proc, ref_desc, node_debug_id));
75 DECLARE_HOOK(android_vh_binder_del_ref,
76 	TP_PROTO(struct task_struct *proc, uint32_t ref_desc),
77 	TP_ARGS(proc, ref_desc));
78 DECLARE_HOOK(android_vh_binder_print_transaction_info,
79 	TP_PROTO(struct seq_file *m, struct binder_proc *proc,
80 		 const char *prefix, struct binder_transaction *t),
81 	TP_ARGS(m, proc, prefix, t));
82 
83 /* macro versions of hooks are no longer required */
84 
85 #endif /* _TRACE_HOOK_BINDER_H */
86 /* This part must be outside protection */
87 #include <trace/define_trace.h>
88