]> git.karo-electronics.de Git - linux-beck.git/commitdiff
tools lib traceevent: Make plugin unload function receive pevent
authorNamhyung Kim <namhyung@kernel.org>
Wed, 15 Jan 2014 01:45:28 +0000 (10:45 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 15 Jan 2014 18:10:40 +0000 (15:10 -0300)
The PEVENT_PLUGIN_UNLOADER function might need some cleanup using pevent
like unregister some handlers.  So pass pevent as argument.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1389750340-15965-6-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/traceevent/event-parse.h
tools/lib/traceevent/event-plugin.c
tools/lib/traceevent/plugin_function.c
tools/perf/util/trace-event.c

index 3c890cb28db760700d0bcc599a6d347e0f94c33d..a3beca56cb3506c95d9f30cf6e36d14a8e6be755 100644 (file)
@@ -105,7 +105,7 @@ typedef int (*pevent_event_handler_func)(struct trace_seq *s,
                                         void *context);
 
 typedef int (*pevent_plugin_load_func)(struct pevent *pevent);
-typedef int (*pevent_plugin_unload_func)(void);
+typedef int (*pevent_plugin_unload_func)(struct pevent *pevent);
 
 struct plugin_option {
        struct plugin_option            *next;
@@ -130,7 +130,7 @@ struct plugin_option {
  * PEVENT_PLUGIN_UNLOADER:  (optional)
  *   The function called just before unloading
  *
- *   int PEVENT_PLUGIN_UNLOADER(void)
+ *   int PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
  *
  * PEVENT_PLUGIN_OPTIONS:  (optional)
  *   Plugin options that can be set before loading
@@ -411,7 +411,8 @@ enum pevent_errno {
 struct plugin_list;
 
 struct plugin_list *traceevent_load_plugins(struct pevent *pevent);
-void traceevent_unload_plugins(struct plugin_list *plugin_list);
+void traceevent_unload_plugins(struct plugin_list *plugin_list,
+                              struct pevent *pevent);
 
 struct cmdline;
 struct cmdline_list;
index 125f5676bcb5c1f46259b3bf4542efdde96e3101..0c8bf6780e4d1de74ef955dd893a037e510400af 100644 (file)
@@ -197,7 +197,7 @@ traceevent_load_plugins(struct pevent *pevent)
 }
 
 void
-traceevent_unload_plugins(struct plugin_list *plugin_list)
+traceevent_unload_plugins(struct plugin_list *plugin_list, struct pevent *pevent)
 {
        pevent_plugin_unload_func func;
        struct plugin_list *list;
@@ -207,7 +207,7 @@ traceevent_unload_plugins(struct plugin_list *plugin_list)
                plugin_list = list->next;
                func = dlsym(list->handle, PEVENT_PLUGIN_UNLOADER_NAME);
                if (func)
-                       func();
+                       func(pevent);
                dlclose(list->handle);
                free(list->name);
                free(list);
index aad92ad5e96f986044710e4556791619ed5b56c3..39461485f9a7e7983851f35ce9dd171ddba55e1a 100644 (file)
@@ -144,7 +144,7 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
        return 0;
 }
 
-void PEVENT_PLUGIN_UNLOADER(void)
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
 {
        int i, x;
 
index d9f5f6137ab332be978a0ff9e939797e7f26d027..6322d37164c553de017b5241a8df3243136f1ae2 100644 (file)
@@ -34,8 +34,8 @@ int trace_event__init(struct trace_event *t)
 
 void trace_event__cleanup(struct trace_event *t)
 {
+       traceevent_unload_plugins(t->plugin_list, t->pevent);
        pevent_free(t->pevent);
-       traceevent_unload_plugins(t->plugin_list);
 }
 
 static struct event_format*