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