diff options
| author | Ingo Molnar <mingo@elte.hu> | 2011-02-16 13:33:35 +0100 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2011-02-16 13:33:41 +0100 | 
| commit | a3ec4a603faf4244e275bf11b467aad092dfbd8a (patch) | |
| tree | 1c15009716b37629070ea221a00eb9fe2303a317 /include/linux/tracepoint.h | |
| parent | 51563cd53c4b1c1790fccd2e0af0e2b756589af9 (diff) | |
| parent | 85e2efbb1db9a18d218006706d6e4fbeb0216213 (diff) | |
| download | olio-linux-3.10-a3ec4a603faf4244e275bf11b467aad092dfbd8a.tar.xz olio-linux-3.10-a3ec4a603faf4244e275bf11b467aad092dfbd8a.zip  | |
Merge commit 'v2.6.38-rc5' into core/locking
Merge reason: pick up upstream fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 {  	void (*regfunc)(void);  	void (*unregfunc)(void);  	struct tracepoint_func __rcu *funcs; -} __attribute__((aligned(32)));		/* -					 * Aligned on 32 bytes because it is -					 * globally visible and gcc happily -					 * align these on the structure size. -					 * Keep in sync with vmlinux.lds.h. -					 */ +};  /*   * Connect a probe to a tracepoint. @@ -61,15 +56,15 @@ extern void tracepoint_probe_update_all(void);  struct tracepoint_iter {  	struct module *module; -	struct tracepoint *tracepoint; +	struct tracepoint * const *tracepoint;  };  extern void tracepoint_iter_start(struct tracepoint_iter *iter);  extern void tracepoint_iter_next(struct tracepoint_iter *iter);  extern void tracepoint_iter_stop(struct tracepoint_iter *iter);  extern void tracepoint_iter_reset(struct tracepoint_iter *iter); -extern int tracepoint_get_iter_range(struct tracepoint **tracepoint, -	struct tracepoint *begin, struct tracepoint *end); +extern int tracepoint_get_iter_range(struct tracepoint * const **tracepoint, +	struct tracepoint * const *begin, struct tracepoint * const *end);  /*   * tracepoint_synchronize_unregister must be called between the last tracepoint @@ -84,11 +79,13 @@ static inline void tracepoint_synchronize_unregister(void)  #define PARAMS(args...) args  #ifdef CONFIG_TRACEPOINTS -extern void tracepoint_update_probe_range(struct tracepoint *begin, -	struct tracepoint *end); +extern +void tracepoint_update_probe_range(struct tracepoint * const *begin, +	struct tracepoint * const *end);  #else -static inline void tracepoint_update_probe_range(struct tracepoint *begin, -	struct tracepoint *end) +static inline +void tracepoint_update_probe_range(struct tracepoint * const *begin, +	struct tracepoint * const *end)  { }  #endif /* CONFIG_TRACEPOINTS */ @@ -174,12 +171,20 @@ do_trace:								\  	{								\  	} +/* + * We have no guarantee that gcc and the linker won't up-align the tracepoint + * structures, so we create an array of pointers that will be used for iteration + * on the tracepoints. + */  #define DEFINE_TRACE_FN(name, reg, unreg)				\  	static const char __tpstrtab_##name[]				\  	__attribute__((section("__tracepoints_strings"))) = #name;	\  	struct tracepoint __tracepoint_##name				\ -	__attribute__((section("__tracepoints"), aligned(32))) =	\ -		{ __tpstrtab_##name, 0, reg, unreg, NULL } +	__attribute__((section("__tracepoints"))) =			\ +		{ __tpstrtab_##name, 0, reg, unreg, NULL };		\ +	static struct tracepoint * const __tracepoint_ptr_##name __used	\ +	__attribute__((section("__tracepoints_ptrs"))) =		\ +		&__tracepoint_##name;  #define DEFINE_TRACE(name)						\  	DEFINE_TRACE_FN(name, NULL, NULL);  |