tracepoints: tracepoint_synchronize_unregister()
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 6 Oct 2008 14:33:00 +0000 (10:33 -0400)
committerIngo Molnar <mingo@elte.hu>
Tue, 14 Oct 2008 08:39:30 +0000 (10:39 +0200)
Create tracepoint_synchronize_unregister() which must be called before the end
of exit() to make sure every probe callers have exited the non preemptible
section and thus are not executing the probe code anymore.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/tracepoint.h

index e623a6fca5c3ff934dffd7c153b58ed4eb46b2ec..199f4c207c1ec425019336775809dfbae16509f7 100644 (file)
@@ -124,4 +124,11 @@ extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
 extern int tracepoint_get_iter_range(struct tracepoint **tracepoint,
        struct tracepoint *begin, struct tracepoint *end);
 
+/*
+ * tracepoint_synchronize_unregister must be called between the last tracepoint
+ * probe unregistration and the end of module exit to make sure there is no
+ * caller executing a probe when it is freed.
+ */
+#define tracepoint_synchronize_unregister() synchronize_sched()
+
 #endif