Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Andi Kleen | bd2a634 | 2015-12-01 17:00:58 -0800 | [diff] [blame] | 2 | #ifndef TRACEPOINT_DEFS_H |
| 3 | #define TRACEPOINT_DEFS_H 1 |
| 4 | |
| 5 | /* |
| 6 | * File can be included directly by headers who only want to access |
Vlastimil Babka | 20f6e03 | 2016-03-15 14:55:42 -0700 | [diff] [blame] | 7 | * tracepoint->key to guard out of line trace calls, or the definition of |
| 8 | * trace_print_flags{_u64}. Otherwise linux/tracepoint.h should be used. |
Andi Kleen | bd2a634 | 2015-12-01 17:00:58 -0800 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #include <linux/atomic.h> |
| 12 | #include <linux/static_key.h> |
| 13 | |
Vlastimil Babka | 20f6e03 | 2016-03-15 14:55:42 -0700 | [diff] [blame] | 14 | struct trace_print_flags { |
| 15 | unsigned long mask; |
| 16 | const char *name; |
| 17 | }; |
| 18 | |
| 19 | struct trace_print_flags_u64 { |
| 20 | unsigned long long mask; |
| 21 | const char *name; |
| 22 | }; |
| 23 | |
Andi Kleen | bd2a634 | 2015-12-01 17:00:58 -0800 | [diff] [blame] | 24 | struct tracepoint_func { |
| 25 | void *func; |
| 26 | void *data; |
| 27 | int prio; |
| 28 | }; |
| 29 | |
| 30 | struct tracepoint { |
| 31 | const char *name; /* Tracepoint name */ |
| 32 | struct static_key key; |
Steven Rostedt (Red Hat) | 8cf868a | 2016-11-28 13:03:21 -0500 | [diff] [blame] | 33 | int (*regfunc)(void); |
Andi Kleen | bd2a634 | 2015-12-01 17:00:58 -0800 | [diff] [blame] | 34 | void (*unregfunc)(void); |
| 35 | struct tracepoint_func __rcu *funcs; |
| 36 | }; |
| 37 | |
Mathieu Desnoyers | 9c0be3f | 2018-10-13 15:10:50 -0400 | [diff] [blame] | 38 | #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS |
| 39 | typedef const int tracepoint_ptr_t; |
| 40 | #else |
| 41 | typedef struct tracepoint * const tracepoint_ptr_t; |
| 42 | #endif |
| 43 | |
Alexei Starovoitov | c4f6699 | 2018-03-28 12:05:37 -0700 | [diff] [blame] | 44 | struct bpf_raw_event_map { |
| 45 | struct tracepoint *tp; |
| 46 | void *bpf_func; |
| 47 | u32 num_args; |
Matt Mullins | 9df1c28 | 2019-04-26 11:49:47 -0700 | [diff] [blame] | 48 | u32 writable_size; |
Alexei Starovoitov | c4f6699 | 2018-03-28 12:05:37 -0700 | [diff] [blame] | 49 | } __aligned(32); |
| 50 | |
Andi Kleen | bd2a634 | 2015-12-01 17:00:58 -0800 | [diff] [blame] | 51 | #endif |