• 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 <linux/tracepoint.h>
9 #include <trace/hooks/vendor_hooks.h>
10 #include <linux/plist.h>
11 #ifndef __GENKSYMS__
12 #include <linux/futex.h>
13 #endif
14 
15 /*
16  * Following tracepoints are not exported in tracefs and provide a
17  * mechanism for vendor modules to hook and extend functionality
18  */
19 DECLARE_HOOK(android_vh_alter_futex_plist_add,
20 	TP_PROTO(struct plist_node *node,
21 		 struct plist_head *head,
22 		 bool *already_on_hb),
23 	TP_ARGS(node, head, already_on_hb));
24 
25 DECLARE_HOOK(android_vh_futex_sleep_start,
26 	TP_PROTO(struct task_struct *p),
27 	TP_ARGS(p));
28 
29 DECLARE_HOOK(android_vh_do_futex,
30 	TP_PROTO(int cmd,
31 		 unsigned int *flags,
32 		 u32 __user *uaddr2),
33 	TP_ARGS(cmd, flags, uaddr2));
34 
35 DECLARE_HOOK(android_vh_futex_wait_start,
36 	TP_PROTO(unsigned int flags,
37 		 u32 bitset),
38 	TP_ARGS(flags, bitset));
39 
40 DECLARE_HOOK(android_vh_futex_wait_end,
41 	TP_PROTO(unsigned int flags,
42 		 u32 bitset),
43 	TP_ARGS(flags, bitset));
44 
45 DECLARE_HOOK(android_vh_futex_wake_traverse_plist,
46 	TP_PROTO(struct plist_head *chain, int *target_nr,
47 		 union futex_key key, u32 bitset),
48 	TP_ARGS(chain, target_nr, key, bitset));
49 
50 DECLARE_HOOK(android_vh_futex_wake_this,
51 	TP_PROTO(int ret, int nr_wake, int target_nr,
52 		 struct task_struct *p),
53 	TP_ARGS(ret, nr_wake, target_nr, p));
54 
55 DECLARE_HOOK(android_vh_futex_wake_up_q_finish,
56 	TP_PROTO(int nr_wake, int target_nr),
57 	TP_ARGS(nr_wake, target_nr));
58 
59 /* macro versions of hooks are no longer required */
60 
61 #endif /* _TRACE_HOOK_FUTEX_H */
62 /* This part must be outside protection */
63 #include <trace/define_trace.h>
64