Commit 2504ea5edfebb14133b8571c20785cdc077e07d2

Authored by Mathieu Desnoyers
Committed by Ingo Molnar
1 parent a0bca6a59e

tracepoints: samples, fix teardown

Impact: fix a bug in sample tracepoints

Need a tracepoint_synchronize_unregister() 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>

Showing 2 changed files with 2 additions and 0 deletions Side-by-side Diff

samples/tracepoints/tracepoint-probe-sample.c
... ... @@ -46,6 +46,7 @@
46 46 {
47 47 unregister_trace_subsys_eventb(probe_subsys_eventb);
48 48 unregister_trace_subsys_event(probe_subsys_event);
  49 + tracepoint_synchronize_unregister();
49 50 }
50 51  
51 52 module_exit(tp_sample_trace_exit);
samples/tracepoints/tracepoint-probe-sample2.c
... ... @@ -33,6 +33,7 @@
33 33 void __exit tp_sample_trace_exit(void)
34 34 {
35 35 unregister_trace_subsys_event(probe_subsys_event);
  36 + tracepoint_synchronize_unregister();
36 37 }
37 38  
38 39 module_exit(tp_sample_trace_exit);