diff options
Diffstat (limited to 'include/linux/tracepoint.h')
| -rw-r--r-- | include/linux/tracepoint.h | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index c6814616653..97c84a58efb 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -33,12 +33,7 @@ struct tracepoint { | |||
| 33 | void (*regfunc)(void); | 33 | void (*regfunc)(void); |
| 34 | void (*unregfunc)(void); | 34 | void (*unregfunc)(void); |
| 35 | struct tracepoint_func __rcu *funcs; | 35 | struct tracepoint_func __rcu *funcs; |
| 36 | } __attribute__((aligned(32))); /* | 36 | }; |
| 37 | * Aligned on 32 bytes because it is | ||
| 38 | * globally visible and gcc happily | ||
| 39 | * align these on the structure size. | ||
| 40 | * Keep in sync with vmlinux.lds.h. | ||
| 41 | */ | ||
| 42 | 37 | ||
| 43 | /* | 38 | /* |
| 44 | * Connect a probe to a tracepoint. | 39 | * Connect a probe to a tracepoint. |
| @@ -61,15 +56,15 @@ extern void tracepoint_probe_update_all(void); | |||
| 61 | 56 | ||
| 62 | struct tracepoint_iter { | 57 | struct tracepoint_iter { |
| 63 | struct module *module; | 58 | struct module *module; |
| 64 | struct tracepoint *tracepoint; | 59 | struct tracepoint * const *tracepoint; |
| 65 | }; | 60 | }; |
| 66 | 61 | ||
| 67 | extern void tracepoint_iter_start(struct tracepoint_iter *iter); | 62 | extern void tracepoint_iter_start(struct tracepoint_iter *iter); |
| 68 | extern void tracepoint_iter_next(struct tracepoint_iter *iter); | 63 | extern void tracepoint_iter_next(struct tracepoint_iter *iter); |
| 69 | extern void tracepoint_iter_stop(struct tracepoint_iter *iter); | 64 | extern void tracepoint_iter_stop(struct tracepoint_iter *iter); |
| 70 | extern void tracepoint_iter_reset(struct tracepoint_iter *iter); | 65 | extern void tracepoint_iter_reset(struct tracepoint_iter *iter); |
| 71 | extern int tracepoint_get_iter_range(struct tracepoint **tracepoint, | 66 | extern int tracepoint_get_iter_range(struct tracepoint * const **tracepoint, |
| 72 | struct tracepoint *begin, struct tracepoint *end); | 67 | struct tracepoint * const *begin, struct tracepoint * const *end); |
| 73 | 68 | ||
| 74 | /* | 69 | /* |
| 75 | * tracepoint_synchronize_unregister must be called between the last tracepoint | 70 | * tracepoint_synchronize_unregister must be called between the last tracepoint |
| @@ -84,11 +79,13 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 84 | #define PARAMS(args...) args | 79 | #define PARAMS(args...) args |
| 85 | 80 | ||
| 86 | #ifdef CONFIG_TRACEPOINTS | 81 | #ifdef CONFIG_TRACEPOINTS |
| 87 | extern void tracepoint_update_probe_range(struct tracepoint *begin, | 82 | extern |
| 88 | struct tracepoint *end); | 83 | void tracepoint_update_probe_range(struct tracepoint * const *begin, |
| 84 | struct tracepoint * const *end); | ||
| 89 | #else | 85 | #else |
| 90 | static inline void tracepoint_update_probe_range(struct tracepoint *begin, | 86 | static inline |
| 91 | struct tracepoint *end) | 87 | void tracepoint_update_probe_range(struct tracepoint * const *begin, |
| 88 | struct tracepoint * const *end) | ||
| 92 | { } | 89 | { } |
| 93 | #endif /* CONFIG_TRACEPOINTS */ | 90 | #endif /* CONFIG_TRACEPOINTS */ |
| 94 | 91 | ||
| @@ -174,12 +171,20 @@ do_trace: \ | |||
| 174 | { \ | 171 | { \ |
| 175 | } | 172 | } |
| 176 | 173 | ||
| 174 | /* | ||
| 175 | * We have no guarantee that gcc and the linker won't up-align the tracepoint | ||
| 176 | * structures, so we create an array of pointers that will be used for iteration | ||
| 177 | * on the tracepoints. | ||
| 178 | */ | ||
| 177 | #define DEFINE_TRACE_FN(name, reg, unreg) \ | 179 | #define DEFINE_TRACE_FN(name, reg, unreg) \ |
| 178 | static const char __tpstrtab_##name[] \ | 180 | static const char __tpstrtab_##name[] \ |
| 179 | __attribute__((section("__tracepoints_strings"))) = #name; \ | 181 | __attribute__((section("__tracepoints_strings"))) = #name; \ |
| 180 | struct tracepoint __tracepoint_##name \ | 182 | struct tracepoint __tracepoint_##name \ |
| 181 | __attribute__((section("__tracepoints"), aligned(32))) = \ | 183 | __attribute__((section("__tracepoints"))) = \ |
| 182 | { __tpstrtab_##name, 0, reg, unreg, NULL } | 184 | { __tpstrtab_##name, 0, reg, unreg, NULL }; \ |
| 185 | static struct tracepoint * const __tracepoint_ptr_##name __used \ | ||
| 186 | __attribute__((section("__tracepoints_ptrs"))) = \ | ||
| 187 | &__tracepoint_##name; | ||
| 183 | 188 | ||
| 184 | #define DEFINE_TRACE(name) \ | 189 | #define DEFINE_TRACE(name) \ |
| 185 | DEFINE_TRACE_FN(name, NULL, NULL); | 190 | DEFINE_TRACE_FN(name, NULL, NULL); |
