]> git.sesse.net Git - bcachefs-tools-debian/blob - c_src/include/linux/tracepoint.h
remove library from bcachefs-tools Rust package
[bcachefs-tools-debian] / c_src / include / linux / tracepoint.h
1 #ifndef __TOOLS_LINUX_TRACEPOINT_H
2 #define __TOOLS_LINUX_TRACEPOINT_H
3
4 #define PARAMS(args...) args
5
6 #define TP_PROTO(args...)       args
7 #define TP_ARGS(args...)        args
8 #define TP_CONDITION(args...)   args
9
10 #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \
11         static inline void trace_##name(proto)                          \
12         { }                                                             \
13         static inline void trace_##name##_rcuidle(proto)                \
14         { }                                                             \
15         static inline int                                               \
16         register_trace_##name(void (*probe)(data_proto),                \
17                               void *data)                               \
18         {                                                               \
19                 return -ENOSYS;                                         \
20         }                                                               \
21         static inline int                                               \
22         unregister_trace_##name(void (*probe)(data_proto),              \
23                                 void *data)                             \
24         {                                                               \
25                 return -ENOSYS;                                         \
26         }                                                               \
27         static inline void check_trace_callback_type_##name(void (*cb)(data_proto)) \
28         {                                                               \
29         }                                                               \
30         static inline bool                                              \
31         trace_##name##_enabled(void)                                    \
32         {                                                               \
33                 return false;                                           \
34         }
35
36 #define DEFINE_TRACE_FN(name, reg, unreg)
37 #define DEFINE_TRACE(name)
38 #define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
39 #define EXPORT_TRACEPOINT_SYMBOL(name)
40
41 #define DECLARE_TRACE_NOARGS(name)                                      \
42         __DECLARE_TRACE(name, void, ,                                   \
43                         cpu_online(raw_smp_processor_id()),             \
44                         void *__data, __data)
45
46 #define DECLARE_TRACE(name, proto, args)                                \
47         __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args),              \
48                         cpu_online(raw_smp_processor_id()),             \
49                         PARAMS(void *__data, proto),                    \
50                         PARAMS(__data, args))
51
52 #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print)
53 #define DEFINE_EVENT(template, name, proto, args)               \
54         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
55 #define DEFINE_EVENT_FN(template, name, proto, args, reg, unreg)\
56         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
57 #define DEFINE_EVENT_PRINT(template, name, proto, args, print)  \
58         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
59 #define TRACE_EVENT(name, proto, args, struct, assign, print)   \
60         DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
61
62 #endif /* __TOOLS_LINUX_TRACEPOINT_H */