0001
0002 #ifndef TRACEPOINT_DEFS_H
0003 #define TRACEPOINT_DEFS_H 1
0004
0005
0006
0007
0008
0009
0010
0011 #include <linux/atomic.h>
0012 #include <linux/static_key.h>
0013
0014 struct static_call_key;
0015
0016 struct trace_print_flags {
0017 unsigned long mask;
0018 const char *name;
0019 };
0020
0021 struct trace_print_flags_u64 {
0022 unsigned long long mask;
0023 const char *name;
0024 };
0025
0026 struct tracepoint_func {
0027 void *func;
0028 void *data;
0029 int prio;
0030 };
0031
0032 struct tracepoint {
0033 const char *name;
0034 struct static_key key;
0035 struct static_call_key *static_call_key;
0036 void *static_call_tramp;
0037 void *iterator;
0038 int (*regfunc)(void);
0039 void (*unregfunc)(void);
0040 struct tracepoint_func __rcu *funcs;
0041 };
0042
0043 #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
0044 typedef const int tracepoint_ptr_t;
0045 #else
0046 typedef struct tracepoint * const tracepoint_ptr_t;
0047 #endif
0048
0049 struct bpf_raw_event_map {
0050 struct tracepoint *tp;
0051 void *bpf_func;
0052 u32 num_args;
0053 u32 writable_size;
0054 } __aligned(32);
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080 #define DECLARE_TRACEPOINT(tp) \
0081 extern struct tracepoint __tracepoint_##tp
0082
0083 #ifdef CONFIG_TRACEPOINTS
0084 # define tracepoint_enabled(tp) \
0085 static_key_false(&(__tracepoint_##tp).key)
0086 #else
0087 # define tracepoint_enabled(tracepoint) false
0088 #endif
0089
0090 #endif