Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tracepoints: tracepoint_synchronize_unregister()

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>

authored by

Mathieu Desnoyers and committed by
Ingo Molnar
f2461fc8 8b27386a

+7
+7
include/linux/tracepoint.h
··· 124 124 extern int tracepoint_get_iter_range(struct tracepoint **tracepoint, 125 125 struct tracepoint *begin, struct tracepoint *end); 126 126 127 + /* 128 + * tracepoint_synchronize_unregister must be called between the last tracepoint 129 + * probe unregistration and the end of module exit to make sure there is no 130 + * caller executing a probe when it is freed. 131 + */ 132 + #define tracepoint_synchronize_unregister() synchronize_sched() 133 + 127 134 #endif