tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded
authorNamhyung Kim <[email protected]>
Thu, 16 Jan 2014 02:31:16 +0000 (11:31 +0900)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 16 Jan 2014 19:26:25 +0000 (16:26 -0300)
The function handlers should be unregistered when the plugin unloaded
otherwise they'll try to access invalid memory.

Signed-off-by: Namhyung Kim <[email protected]>
Reviewed-by: Jiri Olsa <[email protected]>
Acked-by: Steven Rostedt <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/lib/traceevent/plugin_jbd2.c

index 2f93f81f0bac3c24dd730c6f231a9a1d35b8c507..0db714c721bed1458564fe381e0d6b0e25efdc31 100644 (file)
@@ -66,3 +66,12 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
                                       PEVENT_FUNC_ARG_VOID);
        return 0;
 }
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+       pevent_unregister_print_function(pevent, process_jbd2_dev_to_name,
+                                        "jbd2_dev_to_name");
+
+       pevent_unregister_print_function(pevent, process_jiffies_to_msecs,
+                                        "jiffies_to_msecs");
+}