• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM futex
4 #undef TRACE_INCLUDE_PATH
5 #define TRACE_INCLUDE_PATH trace/hooks
6 #if !defined(_TRACE_HOOK_FUTEX_H) || defined(TRACE_HEADER_MULTI_READ)
7 #define _TRACE_HOOK_FUTEX_H
8 #include <trace/hooks/vendor_hooks.h>
9 
10 #ifndef __GENKSYMS__
11 #include <linux/plist.h>
12 #include <linux/futex.h>
13 #endif
14 
15 struct plist_node;
16 struct plist_head;
17 struct task_struct;
18 union futex_key;
19 
20 /*
21  * Following tracepoints are not exported in tracefs and provide a
22  * mechanism for vendor modules to hook and extend functionality
23  */
24 DECLARE_HOOK(android_vh_alter_futex_plist_add,
25 	TP_PROTO(struct plist_node *node,
26 		 struct plist_head *head,
27 		 bool *already_on_hb),
28 	TP_ARGS(node, head, already_on_hb));
29 
30 DECLARE_HOOK(android_vh_futex_sleep_start,
31 	TP_PROTO(struct task_struct *p),
32 	TP_ARGS(p));
33 
34 DECLARE_HOOK(android_vh_do_futex,
35 	TP_PROTO(int cmd,
36 		 unsigned int *flags,
37 		 u32 __user *uaddr2),
38 	TP_ARGS(cmd, flags, uaddr2));
39 
40 DECLARE_HOOK(android_vh_futex_wait_start,
41 	TP_PROTO(unsigned int flags,
42 		 u32 bitset),
43 	TP_ARGS(flags, bitset));
44 
45 DECLARE_HOOK(android_vh_futex_wait_end,
46 	TP_PROTO(unsigned int flags,
47 		 u32 bitset),
48 	TP_ARGS(flags, bitset));
49 
50 DECLARE_HOOK(android_vh_futex_wake_traverse_plist,
51 	TP_PROTO(struct plist_head *chain, int *target_nr,
52 		 union futex_key key, u32 bitset),
53 	TP_ARGS(chain, target_nr, key, bitset));
54 
55 DECLARE_HOOK(android_vh_futex_wake_this,
56 	TP_PROTO(int ret, int nr_wake, int target_nr,
57 		 struct task_struct *p),
58 	TP_ARGS(ret, nr_wake, target_nr, p));
59 
60 DECLARE_HOOK(android_vh_futex_wake_up_q_finish,
61 	TP_PROTO(int nr_wake, int target_nr),
62 	TP_ARGS(nr_wake, target_nr));
63 
64 #endif /* _TRACE_HOOK_FUTEX_H */
65 /* This part must be outside protection */
66 #include <trace/define_trace.h>
67