perf: Use tracepoint_synchronize_unregister() to flush any pending tracepoint call
authorFrederic Weisbecker <fweisbec@gmail.com>
Tue, 20 Jul 2010 15:29:54 +0000 (17:29 +0200)
committerFrederic Weisbecker <fweisbec@gmail.com>
Sun, 1 Aug 2010 23:30:56 +0000 (01:30 +0200)
We use synchronize_sched() to ensure a tracepoint won't be called
while/after we release the perf buffers it references.

But the tracepoint API has its own API for that:
tracepoint_synchronize_unregister(). Use it instead as it's
self-explanatory and eases maintainance.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
kernel/trace/trace_event_perf.c

index 2375165..000e6e8 100644 (file)
@@ -131,10 +131,10 @@ void perf_trace_destroy(struct perf_event *p_event)
        tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER);
 
        /*
-        * Ensure our callback won't be called anymore. See
-        * tracepoint_probe_unregister() and __DO_TRACE().
+        * Ensure our callback won't be called anymore. The buffers
+        * will be freed after that.
         */
-       synchronize_sched();
+       tracepoint_synchronize_unregister();
 
        free_percpu(tp_event->perf_events);
        tp_event->perf_events = NULL;