aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tracepoint.h
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>2011-08-10 15:18:39 -0400
committerSteven Rostedt <rostedt@goodmis.org>2011-08-10 20:38:14 -0400
commitb75ef8b44b1cb95f5a26484b0e2fe37a63b12b44 (patch)
treea43affc92aaf9beea17ce8d977d8e7a7fed81c5c /include/linux/tracepoint.h
parent3a301d7c1c68fd96bbcf82db82d9508918e0dc22 (diff)
Tracepoint: Dissociate from module mutex
Copy the information needed from struct module into a local module list held within tracepoint.c from within the module coming/going notifier. This vastly simplifies locking of tracepoint registration / unregistration, because we don't have to take the module mutex to register and unregister tracepoints anymore. Steven Rostedt ran into dependency problems related to modules mutex vs kprobes mutex vs ftrace mutex vs tracepoint mutex that seems to be hard to fix without removing this dependency between tracepoint and module mutex. (note: it should be investigated whether kprobes could benefit of being dissociated from the modules mutex too.) This also fixes module handling of tracepoint list iterators, because it was expecting the list to be sorted by pointer address. Given we have control on our own list now, it's OK to sort this list which has tracepoints as its only purpose. The reason why this sorting is required is to handle the fact that seq files (and any read() operation from user-space) cannot hold the tracepoint mutex across multiple calls, so list entries may vanish between calls. With sorting, the tracepoint iterator becomes usable even if the list don't contain the exact item pointed to by the iterator anymore. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Acked-by: Jason Baron <jbaron@redhat.com> CC: Ingo Molnar <mingo@elte.hu> CC: Lai Jiangshan <laijs@cn.fujitsu.com> CC: Peter Zijlstra <a.p.zijlstra@chello.nl> CC: Thomas Gleixner <tglx@linutronix.de> CC: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Link: http://lkml.kernel.org/r/20110810191839.GC8525@Krystal Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/tracepoint.h')
-rw-r--r--include/linux/tracepoint.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index d530a4460a0b..df0a779c1bbd 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -54,8 +54,18 @@ extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe,
54 void *data); 54 void *data);
55extern void tracepoint_probe_update_all(void); 55extern void tracepoint_probe_update_all(void);
56 56
57#ifdef CONFIG_MODULES
58struct tp_module {
59 struct list_head list;
60 unsigned int num_tracepoints;
61 struct tracepoint * const *tracepoints_ptrs;
62};
63#endif /* CONFIG_MODULES */
64
57struct tracepoint_iter { 65struct tracepoint_iter {
58 struct module *module; 66#ifdef CONFIG_MODULES
67 struct tp_module *module;
68#endif /* CONFIG_MODULES */
59 struct tracepoint * const *tracepoint; 69 struct tracepoint * const *tracepoint;
60}; 70};
61 71
@@ -63,8 +73,6 @@ extern void tracepoint_iter_start(struct tracepoint_iter *iter);
63extern void tracepoint_iter_next(struct tracepoint_iter *iter); 73extern void tracepoint_iter_next(struct tracepoint_iter *iter);
64extern void tracepoint_iter_stop(struct tracepoint_iter *iter); 74extern void tracepoint_iter_stop(struct tracepoint_iter *iter);
65extern void tracepoint_iter_reset(struct tracepoint_iter *iter); 75extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
66extern int tracepoint_get_iter_range(struct tracepoint * const **tracepoint,
67 struct tracepoint * const *begin, struct tracepoint * const *end);
68 76
69/* 77/*
70 * tracepoint_synchronize_unregister must be called between the last tracepoint 78 * tracepoint_synchronize_unregister must be called between the last tracepoint
@@ -78,17 +86,6 @@ static inline void tracepoint_synchronize_unregister(void)
78 86
79#define PARAMS(args...) args 87#define PARAMS(args...) args
80 88
81#ifdef CONFIG_TRACEPOINTS
82extern
83void tracepoint_update_probe_range(struct tracepoint * const *begin,
84 struct tracepoint * const *end);
85#else
86static inline
87void tracepoint_update_probe_range(struct tracepoint * const *begin,
88 struct tracepoint * const *end)
89{ }
90#endif /* CONFIG_TRACEPOINTS */
91
92#endif /* _LINUX_TRACEPOINT_H */ 89#endif /* _LINUX_TRACEPOINT_H */
93 90
94/* 91/*