* [PATCH 01/12] tools lib traceevent: Add pevent_unregister_event_handler()
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:22 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 02/12] tools lib traceevent: Add pevent_unregister_print_function() Namhyung Kim
` (10 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
When a plugin unloaded it needs to unregister its handler from pevent.
So add unregister function to do it.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/event-parse.c | 113 ++++++++++++++++++++++++++++++++-----
tools/lib/traceevent/event-parse.h | 3 +
2 files changed, 102 insertions(+), 14 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 2ce565a73dd5..d1973cb8388b 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -5560,6 +5560,29 @@ int pevent_register_print_function(struct pevent *pevent,
return ret;
}
+static struct event_format *pevent_search_event(struct pevent *pevent, int id,
+ const char *sys_name,
+ const char *event_name)
+{
+ struct event_format *event;
+
+ if (id >= 0) {
+ /* search by id */
+ event = pevent_find_event(pevent, id);
+ if (!event)
+ return NULL;
+ if (event_name && (strcmp(event_name, event->name) != 0))
+ return NULL;
+ if (sys_name && (strcmp(sys_name, event->system) != 0))
+ return NULL;
+ } else {
+ event = pevent_find_event_by_name(pevent, sys_name, event_name);
+ if (!event)
+ return NULL;
+ }
+ return event;
+}
+
/**
* pevent_register_event_handler - register a way to parse an event
* @pevent: the handle to the pevent
@@ -5584,20 +5607,9 @@ int pevent_register_event_handler(struct pevent *pevent, int id,
struct event_format *event;
struct event_handler *handle;
- if (id >= 0) {
- /* search by id */
- event = pevent_find_event(pevent, id);
- if (!event)
- goto not_found;
- if (event_name && (strcmp(event_name, event->name) != 0))
- goto not_found;
- if (sys_name && (strcmp(sys_name, event->system) != 0))
- goto not_found;
- } else {
- event = pevent_find_event_by_name(pevent, sys_name, event_name);
- if (!event)
- goto not_found;
- }
+ event = pevent_search_event(pevent, id, sys_name, event_name);
+ if (event == NULL)
+ goto not_found;
pr_stat("overriding event (%d) %s:%s with new print handler",
event->id, event->system, event->name);
@@ -5637,6 +5649,79 @@ int pevent_register_event_handler(struct pevent *pevent, int id,
return -1;
}
+static int handle_matches(struct event_handler *handler, int id,
+ const char *sys_name, const char *event_name,
+ pevent_event_handler_func func, void *context)
+{
+ if (id >= 0 && id != handler->id)
+ return 0;
+
+ if (event_name && (strcmp(event_name, handler->event_name) != 0))
+ return 0;
+
+ if (sys_name && (strcmp(sys_name, handler->sys_name) != 0))
+ return 0;
+
+ if (func != handler->func || context != handler->context)
+ return 0;
+
+ return 1;
+}
+
+/**
+ * pevent_unregister_event_handler - unregister an existing event handler
+ * @pevent: the handle to the pevent
+ * @id: the id of the event to unregister
+ * @sys_name: the system name the handler belongs to
+ * @event_name: the name of the event handler
+ * @func: the function to call to parse the event information
+ * @context: the data to be passed to @func
+ *
+ * This function removes existing event handler (parser).
+ *
+ * If @id is >= 0, then it is used to find the event.
+ * else @sys_name and @event_name are used.
+ *
+ * Returns 0 if handler was removed successfully, -1 if event was not found.
+ */
+int pevent_unregister_event_handler(struct pevent *pevent, int id,
+ const char *sys_name, const char *event_name,
+ pevent_event_handler_func func, void *context)
+{
+ struct event_format *event;
+ struct event_handler *handle;
+ struct event_handler **next;
+
+ event = pevent_search_event(pevent, id, sys_name, event_name);
+ if (event == NULL)
+ goto not_found;
+
+ if (event->handler == func && event->context == context) {
+ pr_stat("removing override handler for event (%d) %s:%s. Going back to default handler.",
+ event->id, event->system, event->name);
+
+ event->handler = NULL;
+ event->context = NULL;
+ return 0;
+ }
+
+not_found:
+ for (next = &pevent->handlers; *next; next = &(*next)->next) {
+ handle = *next;
+ if (handle_matches(handle, id, sys_name, event_name,
+ func, context))
+ break;
+ }
+
+ if (!(*next))
+ return -1;
+
+ *next = handle->next;
+ free_handler(handle);
+
+ return 0;
+}
+
/**
* pevent_alloc - create a pevent handle
*/
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index a3beca56cb35..c48acfbc6230 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -624,6 +624,9 @@ int pevent_print_func_field(struct trace_seq *s, const char *fmt,
int pevent_register_event_handler(struct pevent *pevent, int id,
const char *sys_name, const char *event_name,
pevent_event_handler_func func, void *context);
+int pevent_unregister_event_handler(struct pevent *pevent, int id,
+ const char *sys_name, const char *event_name,
+ pevent_event_handler_func func, void *context);
int pevent_register_print_function(struct pevent *pevent,
pevent_func_handler func,
enum pevent_func_arg_type ret_type,
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Add pevent_unregister_event_handler()
2014-01-16 2:31 ` [PATCH 01/12] tools lib traceevent: Add pevent_unregister_event_handler() Namhyung Kim
@ 2014-01-19 12:22 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:22 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: ad13701d4905e820f32ce3c2590e19ca65765d63
Gitweb: http://git.kernel.org/tip/ad13701d4905e820f32ce3c2590e19ca65765d63
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:07 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:24 -0300
tools lib traceevent: Add pevent_unregister_event_handler()
When a plugin is unloaded it needs to unregister its handler from pevent.
So add an unregister function to do it.
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/1389839478-5887-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/event-parse.c | 113 ++++++++++++++++++++++++++++++++-----
tools/lib/traceevent/event-parse.h | 3 +
2 files changed, 102 insertions(+), 14 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 2ce565a..d1973cb 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -5560,6 +5560,29 @@ int pevent_register_print_function(struct pevent *pevent,
return ret;
}
+static struct event_format *pevent_search_event(struct pevent *pevent, int id,
+ const char *sys_name,
+ const char *event_name)
+{
+ struct event_format *event;
+
+ if (id >= 0) {
+ /* search by id */
+ event = pevent_find_event(pevent, id);
+ if (!event)
+ return NULL;
+ if (event_name && (strcmp(event_name, event->name) != 0))
+ return NULL;
+ if (sys_name && (strcmp(sys_name, event->system) != 0))
+ return NULL;
+ } else {
+ event = pevent_find_event_by_name(pevent, sys_name, event_name);
+ if (!event)
+ return NULL;
+ }
+ return event;
+}
+
/**
* pevent_register_event_handler - register a way to parse an event
* @pevent: the handle to the pevent
@@ -5584,20 +5607,9 @@ int pevent_register_event_handler(struct pevent *pevent, int id,
struct event_format *event;
struct event_handler *handle;
- if (id >= 0) {
- /* search by id */
- event = pevent_find_event(pevent, id);
- if (!event)
- goto not_found;
- if (event_name && (strcmp(event_name, event->name) != 0))
- goto not_found;
- if (sys_name && (strcmp(sys_name, event->system) != 0))
- goto not_found;
- } else {
- event = pevent_find_event_by_name(pevent, sys_name, event_name);
- if (!event)
- goto not_found;
- }
+ event = pevent_search_event(pevent, id, sys_name, event_name);
+ if (event == NULL)
+ goto not_found;
pr_stat("overriding event (%d) %s:%s with new print handler",
event->id, event->system, event->name);
@@ -5637,6 +5649,79 @@ int pevent_register_event_handler(struct pevent *pevent, int id,
return -1;
}
+static int handle_matches(struct event_handler *handler, int id,
+ const char *sys_name, const char *event_name,
+ pevent_event_handler_func func, void *context)
+{
+ if (id >= 0 && id != handler->id)
+ return 0;
+
+ if (event_name && (strcmp(event_name, handler->event_name) != 0))
+ return 0;
+
+ if (sys_name && (strcmp(sys_name, handler->sys_name) != 0))
+ return 0;
+
+ if (func != handler->func || context != handler->context)
+ return 0;
+
+ return 1;
+}
+
+/**
+ * pevent_unregister_event_handler - unregister an existing event handler
+ * @pevent: the handle to the pevent
+ * @id: the id of the event to unregister
+ * @sys_name: the system name the handler belongs to
+ * @event_name: the name of the event handler
+ * @func: the function to call to parse the event information
+ * @context: the data to be passed to @func
+ *
+ * This function removes existing event handler (parser).
+ *
+ * If @id is >= 0, then it is used to find the event.
+ * else @sys_name and @event_name are used.
+ *
+ * Returns 0 if handler was removed successfully, -1 if event was not found.
+ */
+int pevent_unregister_event_handler(struct pevent *pevent, int id,
+ const char *sys_name, const char *event_name,
+ pevent_event_handler_func func, void *context)
+{
+ struct event_format *event;
+ struct event_handler *handle;
+ struct event_handler **next;
+
+ event = pevent_search_event(pevent, id, sys_name, event_name);
+ if (event == NULL)
+ goto not_found;
+
+ if (event->handler == func && event->context == context) {
+ pr_stat("removing override handler for event (%d) %s:%s. Going back to default handler.",
+ event->id, event->system, event->name);
+
+ event->handler = NULL;
+ event->context = NULL;
+ return 0;
+ }
+
+not_found:
+ for (next = &pevent->handlers; *next; next = &(*next)->next) {
+ handle = *next;
+ if (handle_matches(handle, id, sys_name, event_name,
+ func, context))
+ break;
+ }
+
+ if (!(*next))
+ return -1;
+
+ *next = handle->next;
+ free_handler(handle);
+
+ return 0;
+}
+
/**
* pevent_alloc - create a pevent handle
*/
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index a3beca5..c48acfb 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -624,6 +624,9 @@ int pevent_print_func_field(struct trace_seq *s, const char *fmt,
int pevent_register_event_handler(struct pevent *pevent, int id,
const char *sys_name, const char *event_name,
pevent_event_handler_func func, void *context);
+int pevent_unregister_event_handler(struct pevent *pevent, int id,
+ const char *sys_name, const char *event_name,
+ pevent_event_handler_func func, void *context);
int pevent_register_print_function(struct pevent *pevent,
pevent_func_handler func,
enum pevent_func_arg_type ret_type,
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 02/12] tools lib traceevent: Add pevent_unregister_print_function()
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
2014-01-16 2:31 ` [PATCH 01/12] tools lib traceevent: Add pevent_unregister_event_handler() Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:22 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 03/12] tools lib traceevent: Unregister handler when function plugin unloaded Namhyung Kim
` (9 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
When a plugin unloaded it needs to unregister its print handler from
pevent. So add unregister function to do it.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/event-parse.c | 23 +++++++++++++++++++++++
tools/lib/traceevent/event-parse.h | 2 ++
2 files changed, 25 insertions(+)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index d1973cb8388b..1587ea392ad6 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -5560,6 +5560,29 @@ int pevent_register_print_function(struct pevent *pevent,
return ret;
}
+/**
+ * pevent_unregister_print_function - unregister a helper function
+ * @pevent: the handle to the pevent
+ * @func: the function to process the helper function
+ * @name: the name of the helper function
+ *
+ * This function removes existing print handler for function @name.
+ *
+ * Returns 0 if the handler was removed successully, -1 otherwise.
+ */
+int pevent_unregister_print_function(struct pevent *pevent,
+ pevent_func_handler func, char *name)
+{
+ struct pevent_function_handler *func_handle;
+
+ func_handle = find_func_handler(pevent, name);
+ if (func_handle && func_handle->func == func) {
+ remove_func_handler(pevent, name);
+ return 0;
+ }
+ return -1;
+}
+
static struct event_format *pevent_search_event(struct pevent *pevent, int id,
const char *sys_name,
const char *event_name)
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index c48acfbc6230..791c539374c7 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -631,6 +631,8 @@ int pevent_register_print_function(struct pevent *pevent,
pevent_func_handler func,
enum pevent_func_arg_type ret_type,
char *name, ...);
+int pevent_unregister_print_function(struct pevent *pevent,
+ pevent_func_handler func, char *name);
struct format_field *pevent_find_common_field(struct event_format *event, const char *name);
struct format_field *pevent_find_field(struct event_format *event, const char *name);
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Add pevent_unregister_print_function()
2014-01-16 2:31 ` [PATCH 02/12] tools lib traceevent: Add pevent_unregister_print_function() Namhyung Kim
@ 2014-01-19 12:22 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:22 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: 20c7e5abbd0cdfaa656f46af052a6e6a8ce94775
Gitweb: http://git.kernel.org/tip/20c7e5abbd0cdfaa656f46af052a6e6a8ce94775
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:08 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:24 -0300
tools lib traceevent: Add pevent_unregister_print_function()
When a plugin unloaded it needs to unregister its print handler from
pevent.
So add an unregister function to do it.
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/1389839478-5887-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/event-parse.c | 23 +++++++++++++++++++++++
tools/lib/traceevent/event-parse.h | 2 ++
2 files changed, 25 insertions(+)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index d1973cb..1587ea39 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -5560,6 +5560,29 @@ int pevent_register_print_function(struct pevent *pevent,
return ret;
}
+/**
+ * pevent_unregister_print_function - unregister a helper function
+ * @pevent: the handle to the pevent
+ * @func: the function to process the helper function
+ * @name: the name of the helper function
+ *
+ * This function removes existing print handler for function @name.
+ *
+ * Returns 0 if the handler was removed successully, -1 otherwise.
+ */
+int pevent_unregister_print_function(struct pevent *pevent,
+ pevent_func_handler func, char *name)
+{
+ struct pevent_function_handler *func_handle;
+
+ func_handle = find_func_handler(pevent, name);
+ if (func_handle && func_handle->func == func) {
+ remove_func_handler(pevent, name);
+ return 0;
+ }
+ return -1;
+}
+
static struct event_format *pevent_search_event(struct pevent *pevent, int id,
const char *sys_name,
const char *event_name)
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index c48acfb..791c539 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -631,6 +631,8 @@ int pevent_register_print_function(struct pevent *pevent,
pevent_func_handler func,
enum pevent_func_arg_type ret_type,
char *name, ...);
+int pevent_unregister_print_function(struct pevent *pevent,
+ pevent_func_handler func, char *name);
struct format_field *pevent_find_common_field(struct event_format *event, const char *name);
struct format_field *pevent_find_field(struct event_format *event, const char *name);
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 03/12] tools lib traceevent: Unregister handler when function plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
2014-01-16 2:31 ` [PATCH 01/12] tools lib traceevent: Add pevent_unregister_event_handler() Namhyung Kim
2014-01-16 2:31 ` [PATCH 02/12] tools lib traceevent: Add pevent_unregister_print_function() Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:22 ` [tip:perf/core] tools lib traceevent: Unregister handler when function plugin is unloaded tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 04/12] tools lib traceevent: Unregister handler when hrtimer plugin unloaded Namhyung Kim
` (8 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The function handler should be unregistered when the plugin unloaded
otherwise it'll try to access invalid memory.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_function.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c
index 39461485f9a7..80ba4ff1fe84 100644
--- a/tools/lib/traceevent/plugin_function.c
+++ b/tools/lib/traceevent/plugin_function.c
@@ -148,6 +148,9 @@ void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
{
int i, x;
+ pevent_unregister_event_handler(pevent, -1, "ftrace", "function",
+ function_handler, NULL);
+
for (i = 0; i <= cpus; i++) {
for (x = 0; x < fstack[i].size && fstack[i].stack[x]; x++)
free(fstack[i].stack[x]);
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when function plugin is unloaded
2014-01-16 2:31 ` [PATCH 03/12] tools lib traceevent: Unregister handler when function plugin unloaded Namhyung Kim
@ 2014-01-19 12:22 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:22 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: ac668c7b7d87c1895faf196a337b5ddfd32a0e21
Gitweb: http://git.kernel.org/tip/ac668c7b7d87c1895faf196a337b5ddfd32a0e21
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:09 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:24 -0300
tools lib traceevent: Unregister handler when function plugin is unloaded
The function handler should be unregistered when the plugin is unloaded
otherwise it'll try to access invalid memory.
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/1389839478-5887-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_function.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c
index 3946148..80ba4ff 100644
--- a/tools/lib/traceevent/plugin_function.c
+++ b/tools/lib/traceevent/plugin_function.c
@@ -148,6 +148,9 @@ void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
{
int i, x;
+ pevent_unregister_event_handler(pevent, -1, "ftrace", "function",
+ function_handler, NULL);
+
for (i = 0; i <= cpus; i++) {
for (x = 0; x < fstack[i].size && fstack[i].stack[x]; x++)
free(fstack[i].stack[x]);
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 04/12] tools lib traceevent: Unregister handler when hrtimer plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
` (2 preceding siblings ...)
2014-01-16 2:31 ` [PATCH 03/12] tools lib traceevent: Unregister handler when function plugin unloaded Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:23 ` [tip:perf/core] tools lib traceevent: Unregister handler when hrtimer plugin is unloaded tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 05/12] tools lib traceevent: Unregister handler when kmem plugin unloaded Namhyung Kim
` (7 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The timer handlers should be unregistered when the plugin unloaded
otherwise they'll try to access invalid memory.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_hrtimer.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tools/lib/traceevent/plugin_hrtimer.c b/tools/lib/traceevent/plugin_hrtimer.c
index 0b0ebf30aa44..12bf14cc1152 100644
--- a/tools/lib/traceevent/plugin_hrtimer.c
+++ b/tools/lib/traceevent/plugin_hrtimer.c
@@ -76,3 +76,13 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
timer_start_handler, NULL);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1,
+ "timer", "hrtimer_expire_entry",
+ timer_expire_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "timer", "hrtimer_start",
+ timer_start_handler, NULL);
+}
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when hrtimer plugin is unloaded
2014-01-16 2:31 ` [PATCH 04/12] tools lib traceevent: Unregister handler when hrtimer plugin unloaded Namhyung Kim
@ 2014-01-19 12:23 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:23 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: 4061edaa54744dca833051119e763f073dd3c334
Gitweb: http://git.kernel.org/tip/4061edaa54744dca833051119e763f073dd3c334
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:10 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:24 -0300
tools lib traceevent: Unregister handler when hrtimer plugin is unloaded
The timer handlers should be unregistered when the plugin is unloaded
otherwise they'll try to access invalid memory.
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/1389839478-5887-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_hrtimer.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tools/lib/traceevent/plugin_hrtimer.c b/tools/lib/traceevent/plugin_hrtimer.c
index 0b0ebf3..12bf14c 100644
--- a/tools/lib/traceevent/plugin_hrtimer.c
+++ b/tools/lib/traceevent/plugin_hrtimer.c
@@ -76,3 +76,13 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
timer_start_handler, NULL);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1,
+ "timer", "hrtimer_expire_entry",
+ timer_expire_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "timer", "hrtimer_start",
+ timer_start_handler, NULL);
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 05/12] tools lib traceevent: Unregister handler when kmem plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
` (3 preceding siblings ...)
2014-01-16 2:31 ` [PATCH 04/12] tools lib traceevent: Unregister handler when hrtimer plugin unloaded Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:23 ` [tip:perf/core] tools lib traceevent: Unregister handler when kmem plugin is unloaded tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 06/12] tools lib traceevent: Unregister handler when kvm plugin unloaded Namhyung Kim
` (6 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The kmem handlers should be unregistered when the plugin unloaded
otherwise they'll try to access invalid memory.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_kmem.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/tools/lib/traceevent/plugin_kmem.c b/tools/lib/traceevent/plugin_kmem.c
index 7115c8037ea8..70650ff48d78 100644
--- a/tools/lib/traceevent/plugin_kmem.c
+++ b/tools/lib/traceevent/plugin_kmem.c
@@ -70,3 +70,25 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
call_site_handler, NULL);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kfree",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kmalloc",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kmalloc_node",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kmem_cache_alloc",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem",
+ "kmem_cache_alloc_node",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kmem_cache_free",
+ call_site_handler, NULL);
+}
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when kmem plugin is unloaded
2014-01-16 2:31 ` [PATCH 05/12] tools lib traceevent: Unregister handler when kmem plugin unloaded Namhyung Kim
@ 2014-01-19 12:23 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:23 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: 11e99c55414ebade1031a0ed3b49915824c7c3ea
Gitweb: http://git.kernel.org/tip/11e99c55414ebade1031a0ed3b49915824c7c3ea
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:11 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:24 -0300
tools lib traceevent: Unregister handler when kmem plugin is unloaded
The kmem handlers should be unregistered when the plugin is unloaded
otherwise they'll try to access invalid memory.
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/1389839478-5887-6-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_kmem.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/tools/lib/traceevent/plugin_kmem.c b/tools/lib/traceevent/plugin_kmem.c
index 7115c80..70650ff 100644
--- a/tools/lib/traceevent/plugin_kmem.c
+++ b/tools/lib/traceevent/plugin_kmem.c
@@ -70,3 +70,25 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
call_site_handler, NULL);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kfree",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kmalloc",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kmalloc_node",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kmem_cache_alloc",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem",
+ "kmem_cache_alloc_node",
+ call_site_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kmem", "kmem_cache_free",
+ call_site_handler, NULL);
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 06/12] tools lib traceevent: Unregister handler when kvm plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
` (4 preceding siblings ...)
2014-01-16 2:31 ` [PATCH 05/12] tools lib traceevent: Unregister handler when kmem plugin unloaded Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:23 ` [tip:perf/core] tools lib traceevent: Unregister handler when kvm plugin is unloaded tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 07/12] tools lib traceevent: Unregister handler when sched_switch plugin unloaded Namhyung Kim
` (5 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The kvm handlers should be unregistered when the plugin unloaded
otherwise they'll try to access invalid memory.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_kvm.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index a0e282c6b967..9e0e8c61b43b 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -434,3 +434,32 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
PEVENT_FUNC_ARG_VOID);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_exit",
+ kvm_exit_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
+ kvm_emulate_insn_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
+ kvm_mmu_get_page_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_sync_page",
+ kvm_mmu_print_role, NULL);
+
+ pevent_unregister_event_handler(pevent, -1,
+ "kvmmmu", "kvm_mmu_unsync_page",
+ kvm_mmu_print_role, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_zap_page",
+ kvm_mmu_print_role, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvmmmu",
+ "kvm_mmu_prepare_zap_page", kvm_mmu_print_role,
+ NULL);
+
+ pevent_unregister_print_function(pevent, process_is_writable_pte,
+ "is_writable_pte");
+}
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when kvm plugin is unloaded
2014-01-16 2:31 ` [PATCH 06/12] tools lib traceevent: Unregister handler when kvm plugin unloaded Namhyung Kim
@ 2014-01-19 12:23 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:23 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: 354a2bd0318e0758f93b8b24553f3376fa9dfa21
Gitweb: http://git.kernel.org/tip/354a2bd0318e0758f93b8b24553f3376fa9dfa21
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:12 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:24 -0300
tools lib traceevent: Unregister handler when kvm plugin is unloaded
The kvm handlers should be unregistered when the plugin is unloaded
otherwise they'll try to access invalid memory.
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/1389839478-5887-7-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_kvm.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index a0e282c..9e0e8c6 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -434,3 +434,32 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
PEVENT_FUNC_ARG_VOID);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_exit",
+ kvm_exit_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvm", "kvm_emulate_insn",
+ kvm_emulate_insn_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_get_page",
+ kvm_mmu_get_page_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_sync_page",
+ kvm_mmu_print_role, NULL);
+
+ pevent_unregister_event_handler(pevent, -1,
+ "kvmmmu", "kvm_mmu_unsync_page",
+ kvm_mmu_print_role, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvmmmu", "kvm_mmu_zap_page",
+ kvm_mmu_print_role, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "kvmmmu",
+ "kvm_mmu_prepare_zap_page", kvm_mmu_print_role,
+ NULL);
+
+ pevent_unregister_print_function(pevent, process_is_writable_pte,
+ "is_writable_pte");
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 07/12] tools lib traceevent: Unregister handler when sched_switch plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
` (5 preceding siblings ...)
2014-01-16 2:31 ` [PATCH 06/12] tools lib traceevent: Unregister handler when kvm plugin unloaded Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:23 ` [tip:perf/core] tools lib traceevent: Unregister handler when sched_switch plugin is unloaded tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 08/12] tools lib traceevent: Unregister handler when mac80211 plugin unloaded Namhyung Kim
` (4 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The event handlers should be unregistered when the plugin unloaded
otherwise they'll try to access invalid memory.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_sched_switch.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/lib/traceevent/plugin_sched_switch.c b/tools/lib/traceevent/plugin_sched_switch.c
index fea3724aa24f..f1ce60065258 100644
--- a/tools/lib/traceevent/plugin_sched_switch.c
+++ b/tools/lib/traceevent/plugin_sched_switch.c
@@ -146,3 +146,15 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
sched_wakeup_handler, NULL);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1, "sched", "sched_switch",
+ sched_switch_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "sched", "sched_wakeup",
+ sched_wakeup_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "sched", "sched_wakeup_new",
+ sched_wakeup_handler, NULL);
+}
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when sched_switch plugin is unloaded
2014-01-16 2:31 ` [PATCH 07/12] tools lib traceevent: Unregister handler when sched_switch plugin unloaded Namhyung Kim
@ 2014-01-19 12:23 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:23 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: 02bafd377c1137d0705f224881cd21de123204f0
Gitweb: http://git.kernel.org/tip/02bafd377c1137d0705f224881cd21de123204f0
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:13 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:25 -0300
tools lib traceevent: Unregister handler when sched_switch plugin is unloaded
The event handlers should be unregistered when the plugin is unloaded
otherwise they'll try to access invalid memory.
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/1389839478-5887-8-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_sched_switch.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tools/lib/traceevent/plugin_sched_switch.c b/tools/lib/traceevent/plugin_sched_switch.c
index fea3724..f1ce600 100644
--- a/tools/lib/traceevent/plugin_sched_switch.c
+++ b/tools/lib/traceevent/plugin_sched_switch.c
@@ -146,3 +146,15 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
sched_wakeup_handler, NULL);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1, "sched", "sched_switch",
+ sched_switch_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "sched", "sched_wakeup",
+ sched_wakeup_handler, NULL);
+
+ pevent_unregister_event_handler(pevent, -1, "sched", "sched_wakeup_new",
+ sched_wakeup_handler, NULL);
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 08/12] tools lib traceevent: Unregister handler when mac80211 plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
` (6 preceding siblings ...)
2014-01-16 2:31 ` [PATCH 07/12] tools lib traceevent: Unregister handler when sched_switch plugin unloaded Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:23 ` [tip:perf/core] tools lib traceevent: Unregister handler when mac80211 plugin is unloaded tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 09/12] tools lib traceevent: Unregister handler when cfg80211 plugin unloaded Namhyung Kim
` (3 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The event handler should be unregistered when the plugin unloaded
otherwise it'll try to access invalid memory.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_mac80211.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/lib/traceevent/plugin_mac80211.c b/tools/lib/traceevent/plugin_mac80211.c
index 558a3b91c046..7e15a0f1c2fd 100644
--- a/tools/lib/traceevent/plugin_mac80211.c
+++ b/tools/lib/traceevent/plugin_mac80211.c
@@ -93,3 +93,10 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
drv_bss_info_changed, NULL);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1, "mac80211",
+ "drv_bss_info_changed",
+ drv_bss_info_changed, NULL);
+}
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when mac80211 plugin is unloaded
2014-01-16 2:31 ` [PATCH 08/12] tools lib traceevent: Unregister handler when mac80211 plugin unloaded Namhyung Kim
@ 2014-01-19 12:23 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:23 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: ec7c6debdd446ad2262f236d13964efae90ba0f7
Gitweb: http://git.kernel.org/tip/ec7c6debdd446ad2262f236d13964efae90ba0f7
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:14 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:25 -0300
tools lib traceevent: Unregister handler when mac80211 plugin is unloaded
The event handler should be unregistered when the plugin is unloaded
otherwise it'll try to access invalid memory.
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/1389839478-5887-9-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_mac80211.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/lib/traceevent/plugin_mac80211.c b/tools/lib/traceevent/plugin_mac80211.c
index 558a3b9..7e15a0f 100644
--- a/tools/lib/traceevent/plugin_mac80211.c
+++ b/tools/lib/traceevent/plugin_mac80211.c
@@ -93,3 +93,10 @@ int PEVENT_PLUGIN_LOADER(struct pevent *pevent)
drv_bss_info_changed, NULL);
return 0;
}
+
+void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent)
+{
+ pevent_unregister_event_handler(pevent, -1, "mac80211",
+ "drv_bss_info_changed",
+ drv_bss_info_changed, NULL);
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 09/12] tools lib traceevent: Unregister handler when cfg80211 plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
` (7 preceding siblings ...)
2014-01-16 2:31 ` [PATCH 08/12] tools lib traceevent: Unregister handler when mac80211 plugin unloaded Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-16 3:23 ` Steven Rostedt
2014-01-19 12:23 ` [tip:perf/core] tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 10/12] tools lib traceevent: Unregister handler when jbd2 plugin unloaded Namhyung Kim
` (2 subsequent siblings)
11 siblings, 2 replies; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The function handler should be unregistered when the plugin unloaded
otherwise it'll try to access invalid memory.
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_cfg80211.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/lib/traceevent/plugin_cfg80211.c b/tools/lib/traceevent/plugin_cfg80211.c
index 57e98221db20..c066b25905f8 100644
--- a/tools/lib/traceevent/plugin_cfg80211.c
+++ b/tools/lib/traceevent/plugin_cfg80211.c
@@ -22,3 +22,9 @@ 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___le16_to_cpup,
+ "__le16_to_cpup");
+}
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH 09/12] tools lib traceevent: Unregister handler when cfg80211 plugin unloaded
2014-01-16 2:31 ` [PATCH 09/12] tools lib traceevent: Unregister handler when cfg80211 plugin unloaded Namhyung Kim
@ 2014-01-16 3:23 ` Steven Rostedt
2014-01-19 12:23 ` [tip:perf/core] tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded tip-bot for Namhyung Kim
1 sibling, 0 replies; 26+ messages in thread
From: Steven Rostedt @ 2014-01-16 3:23 UTC (permalink / raw)
To: Namhyung Kim
Cc: Arnaldo Carvalho de Melo, Frederic Weisbecker, Peter Zijlstra,
Ingo Molnar, Namhyung Kim, LKML, Jiri Olsa
On Thu, 16 Jan 2014 11:31:15 +0900
Namhyung Kim <namhyung@kernel.org> wrote:
> The function handler should be unregistered when the plugin unloaded
> otherwise it'll try to access invalid memory.
>
> Reviewed-by: Jiri Olsa <jolsa@redhat.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
You can add my Acked-by to patches 9-12 too.
-- Steve
> ---
> tools/lib/traceevent/plugin_cfg80211.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/lib/traceevent/plugin_cfg80211.c b/tools/lib/traceevent/plugin_cfg80211.c
> index 57e98221db20..c066b25905f8 100644
> --- a/tools/lib/traceevent/plugin_cfg80211.c
> +++ b/tools/lib/traceevent/plugin_cfg80211.c
> @@ -22,3 +22,9 @@ 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___le16_to_cpup,
> + "__le16_to_cpup");
> +}
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded
2014-01-16 2:31 ` [PATCH 09/12] tools lib traceevent: Unregister handler when cfg80211 plugin unloaded Namhyung Kim
2014-01-16 3:23 ` Steven Rostedt
@ 2014-01-19 12:23 ` tip-bot for Namhyung Kim
1 sibling, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:23 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: 6024cf3898d25088b01025d72a6929839de9c7b6
Gitweb: http://git.kernel.org/tip/6024cf3898d25088b01025d72a6929839de9c7b6
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:15 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:25 -0300
tools lib traceevent: Unregister handler when cfg80211 plugin is unloaded
The function handler should be unregistered when the plugin is unloaded
otherwise it'll try to access invalid memory.
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/1389839478-5887-10-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_cfg80211.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/lib/traceevent/plugin_cfg80211.c b/tools/lib/traceevent/plugin_cfg80211.c
index 57e9822..c066b25 100644
--- a/tools/lib/traceevent/plugin_cfg80211.c
+++ b/tools/lib/traceevent/plugin_cfg80211.c
@@ -22,3 +22,9 @@ 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___le16_to_cpup,
+ "__le16_to_cpup");
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 10/12] tools lib traceevent: Unregister handler when jbd2 plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
` (8 preceding siblings ...)
2014-01-16 2:31 ` [PATCH 09/12] tools lib traceevent: Unregister handler when cfg80211 plugin unloaded Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:24 ` [tip:perf/core] tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 11/12] tools lib traceevent: Unregister handler when scsi plugin unloaded Namhyung Kim
2014-01-16 2:31 ` [PATCH 12/12] tools lib traceevent: Unregister handler when xen plugin unloaded Namhyung Kim
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The function handlers should be unregistered when the plugin unloaded
otherwise they'll try to access invalid memory.
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_jbd2.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/lib/traceevent/plugin_jbd2.c b/tools/lib/traceevent/plugin_jbd2.c
index 2f93f81f0bac..0db714c721be 100644
--- a/tools/lib/traceevent/plugin_jbd2.c
+++ b/tools/lib/traceevent/plugin_jbd2.c
@@ -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");
+}
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded
2014-01-16 2:31 ` [PATCH 10/12] tools lib traceevent: Unregister handler when jbd2 plugin unloaded Namhyung Kim
@ 2014-01-19 12:24 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:24 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: 0247a967d4c1986821b3c7cbad324468fa6f2ae3
Gitweb: http://git.kernel.org/tip/0247a967d4c1986821b3c7cbad324468fa6f2ae3
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:16 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:25 -0300
tools lib traceevent: Unregister handler when jbd2 plugin is is unloaded
The function handlers should be unregistered when the plugin unloaded
otherwise they'll try to access invalid memory.
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/1389839478-5887-11-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_jbd2.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/lib/traceevent/plugin_jbd2.c b/tools/lib/traceevent/plugin_jbd2.c
index 2f93f81..0db714c 100644
--- a/tools/lib/traceevent/plugin_jbd2.c
+++ b/tools/lib/traceevent/plugin_jbd2.c
@@ -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");
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 11/12] tools lib traceevent: Unregister handler when scsi plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
` (9 preceding siblings ...)
2014-01-16 2:31 ` [PATCH 10/12] tools lib traceevent: Unregister handler when jbd2 plugin unloaded Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:24 ` [tip:perf/core] tools lib traceevent: Unregister handler when scsi plugin is unloaded tip-bot for Namhyung Kim
2014-01-16 2:31 ` [PATCH 12/12] tools lib traceevent: Unregister handler when xen plugin unloaded Namhyung Kim
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The function handler should be unregistered when the plugin unloaded
otherwise it'll try to access invalid memory.
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_scsi.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/lib/traceevent/plugin_scsi.c b/tools/lib/traceevent/plugin_scsi.c
index 7ef16cc96562..eda326fc8620 100644
--- a/tools/lib/traceevent/plugin_scsi.c
+++ b/tools/lib/traceevent/plugin_scsi.c
@@ -421,3 +421,9 @@ 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_scsi_trace_parse_cdb,
+ "scsi_trace_parse_cdb");
+}
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when scsi plugin is unloaded
2014-01-16 2:31 ` [PATCH 11/12] tools lib traceevent: Unregister handler when scsi plugin unloaded Namhyung Kim
@ 2014-01-19 12:24 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:24 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: a157112cfc67b3889f6493933cbd32620aa4be18
Gitweb: http://git.kernel.org/tip/a157112cfc67b3889f6493933cbd32620aa4be18
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:17 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:25 -0300
tools lib traceevent: Unregister handler when scsi plugin is unloaded
The function handler should be unregistered when the plugin is unloaded
otherwise it'll try to access invalid memory.
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/1389839478-5887-12-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_scsi.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/lib/traceevent/plugin_scsi.c b/tools/lib/traceevent/plugin_scsi.c
index 7ef16cc..eda326f 100644
--- a/tools/lib/traceevent/plugin_scsi.c
+++ b/tools/lib/traceevent/plugin_scsi.c
@@ -421,3 +421,9 @@ 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_scsi_trace_parse_cdb,
+ "scsi_trace_parse_cdb");
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 12/12] tools lib traceevent: Unregister handler when xen plugin unloaded
2014-01-16 2:31 [PATCHSET 00/12] tools lib traceevent: Plugin unload enhancement (v2) Namhyung Kim
` (10 preceding siblings ...)
2014-01-16 2:31 ` [PATCH 11/12] tools lib traceevent: Unregister handler when scsi plugin unloaded Namhyung Kim
@ 2014-01-16 2:31 ` Namhyung Kim
2014-01-19 12:24 ` [tip:perf/core] tools lib traceevent: Unregister handler when xen plugin is unloaded tip-bot for Namhyung Kim
11 siblings, 1 reply; 26+ messages in thread
From: Namhyung Kim @ 2014-01-16 2:31 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo
Cc: Frederic Weisbecker, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
LKML, Jiri Olsa
The function handler should be unregistered when the plugin unloaded
otherwise it'll try to access invalid memory.
Reviewed-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/lib/traceevent/plugin_xen.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/lib/traceevent/plugin_xen.c b/tools/lib/traceevent/plugin_xen.c
index e7794298f3a9..3a413eaada68 100644
--- a/tools/lib/traceevent/plugin_xen.c
+++ b/tools/lib/traceevent/plugin_xen.c
@@ -128,3 +128,9 @@ 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_xen_hypercall_name,
+ "xen_hypercall_name");
+}
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread* [tip:perf/core] tools lib traceevent: Unregister handler when xen plugin is unloaded
2014-01-16 2:31 ` [PATCH 12/12] tools lib traceevent: Unregister handler when xen plugin unloaded Namhyung Kim
@ 2014-01-19 12:24 ` tip-bot for Namhyung Kim
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Namhyung Kim @ 2014-01-19 12:24 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, linux-kernel, hpa, mingo, a.p.zijlstra, namhyung.kim,
namhyung, jolsa, fweisbec, rostedt, tglx
Commit-ID: bf6b3a95ff439b1dcd6151b3f38810f3cec1e319
Gitweb: http://git.kernel.org/tip/bf6b3a95ff439b1dcd6151b3f38810f3cec1e319
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 16 Jan 2014 11:31:18 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 16 Jan 2014 16:26:25 -0300
tools lib traceevent: Unregister handler when xen plugin is unloaded
The function handler should be unregistered when the plugin is unloaded
otherwise it'll try to access invalid memory.
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/1389839478-5887-13-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/lib/traceevent/plugin_xen.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/lib/traceevent/plugin_xen.c b/tools/lib/traceevent/plugin_xen.c
index e779429..3a413ea 100644
--- a/tools/lib/traceevent/plugin_xen.c
+++ b/tools/lib/traceevent/plugin_xen.c
@@ -128,3 +128,9 @@ 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_xen_hypercall_name,
+ "xen_hypercall_name");
+}
^ permalink raw reply [flat|nested] 26+ messages in thread