From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com,
mingo@kernel.org, a.p.zijlstra@chello.nl, namhyung.kim@lge.com,
namhyung@kernel.org, jolsa@redhat.com, fweisbec@gmail.com,
rostedt@goodmis.org, tglx@linutronix.de
Subject: [tip:perf/core] tools lib traceevent: Make plugin unload function receive pevent
Date: Thu, 16 Jan 2014 05:38:12 -0800 [thread overview]
Message-ID: <tip-8d0c2224ca6e04ba51c403805e7e1e2ca536520b@git.kernel.org> (raw)
In-Reply-To: <1389750340-15965-6-git-send-email-namhyung@kernel.org>
Commit-ID: 8d0c2224ca6e04ba51c403805e7e1e2ca536520b
Gitweb: http://git.kernel.org/tip/8d0c2224ca6e04ba51c403805e7e1e2ca536520b
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Wed, 15 Jan 2014 10:45:28 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 15 Jan 2014 15:10:40 -0300
tools lib traceevent: Make plugin unload function receive pevent
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 | 7 ++++---
tools/lib/traceevent/event-plugin.c | 4 ++--
tools/lib/traceevent/plugin_function.c | 2 +-
tools/perf/util/trace-event.c | 2 +-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h
index 3c890cb..a3beca5 100644
--- a/tools/lib/traceevent/event-parse.h
+++ b/tools/lib/traceevent/event-parse.h
@@ -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;
diff --git a/tools/lib/traceevent/event-plugin.c b/tools/lib/traceevent/event-plugin.c
index 125f567..0c8bf67 100644
--- a/tools/lib/traceevent/event-plugin.c
+++ b/tools/lib/traceevent/event-plugin.c
@@ -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);
diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c
index aad92ad..3946148 100644
--- a/tools/lib/traceevent/plugin_function.c
+++ b/tools/lib/traceevent/plugin_function.c
@@ -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;
diff --git a/tools/perf/util/trace-event.c b/tools/perf/util/trace-event.c
index d9f5f61..6322d37 100644
--- a/tools/perf/util/trace-event.c
+++ b/tools/perf/util/trace-event.c
@@ -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*
next prev parent reply other threads:[~2014-01-16 13:38 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 1:45 [PATCHSET 00/17] tools lib traceevent: Plugin unload enhancement Namhyung Kim
2014-01-15 1:45 ` [PATCH 01/17] tools lib traceevent: Add state member to struct trace_seq Namhyung Kim
2014-01-15 2:00 ` Steven Rostedt
2014-01-15 2:49 ` Namhyung Kim
2014-01-15 2:56 ` Steven Rostedt
2014-01-15 5:03 ` Namhyung Kim
2014-01-15 14:15 ` Arnaldo Carvalho de Melo
2014-01-15 14:25 ` Steven Rostedt
2014-01-16 13:37 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-01-15 1:45 ` [PATCH 02/17] tools lib traceevent: Check return value of realloc() Namhyung Kim
2014-01-15 2:03 ` Steven Rostedt
2014-01-16 13:37 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-01-15 1:45 ` [PATCH 03/17] tools lib traceevent: Get rid of malloc_or_die() in trace_seq_init() Namhyung Kim
2014-01-15 2:05 ` Steven Rostedt
2014-01-16 13:37 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-01-15 1:45 ` [PATCH 04/17] tools lib traceevent: Get rid of die() finally!! Namhyung Kim
2014-01-16 13:38 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-01-15 1:45 ` [PATCH 05/17] tools lib traceevent: Make plugin unload function receive pevent Namhyung Kim
2014-01-15 2:24 ` Steven Rostedt
2014-01-16 13:38 ` tip-bot for Namhyung Kim [this message]
2014-01-15 1:45 ` [PATCH 06/17] tools lib traceevent: Add pevent_unregister_event_handler() Namhyung Kim
2014-01-15 16:18 ` Steven Rostedt
2014-01-15 18:12 ` Arnaldo Carvalho de Melo
2014-01-16 0:00 ` Namhyung Kim
2014-01-16 1:52 ` Steven Rostedt
2014-01-16 1:58 ` Namhyung Kim
2014-01-16 2:05 ` Steven Rostedt
2014-01-15 1:45 ` [PATCH 07/17] tools lib traceevent: Add pevent_unregister_print_function() Namhyung Kim
2014-01-15 16:19 ` Steven Rostedt
2014-01-15 1:45 ` [PATCH 08/17] tools lib traceevent: Unregister handler when function plugin unloaded Namhyung Kim
2014-01-15 16:21 ` Steven Rostedt
2014-01-15 1:45 ` [PATCH 09/17] tools lib traceevent: Unregister handler when hrtimer " Namhyung Kim
2014-01-15 16:21 ` Steven Rostedt
2014-01-15 1:45 ` [PATCH 10/17] tools lib traceevent: Unregister handler when kmem " Namhyung Kim
2014-01-15 1:45 ` [PATCH 11/17] tools lib traceevent: Unregister handler when kvm " Namhyung Kim
2014-01-15 1:45 ` [PATCH 12/17] tools lib traceevent: Unregister handler when sched_switch " Namhyung Kim
2014-01-15 1:45 ` [PATCH 13/17] tools lib traceevent: Unregister handler when mac80211 " Namhyung Kim
2014-01-15 20:32 ` Steven Rostedt
2014-01-15 1:45 ` [PATCH 14/17] tools lib traceevent: Unregister handler when cfg80211 " Namhyung Kim
2014-01-15 20:34 ` Steven Rostedt
2014-01-15 1:45 ` [PATCH 15/17] tools lib traceevent: Unregister handler when jbd2 " Namhyung Kim
2014-01-15 20:35 ` Steven Rostedt
2014-01-15 1:45 ` [PATCH 16/17] tools lib traceevent: Unregister handler when scsi " Namhyung Kim
2014-01-15 20:36 ` Steven Rostedt
2014-01-15 1:45 ` [PATCH 17/17] tools lib traceevent: Unregister handler when xen " Namhyung Kim
2014-01-15 13:39 ` [PATCHSET 00/17] tools lib traceevent: Plugin unload enhancement Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-8d0c2224ca6e04ba51c403805e7e1e2ca536520b@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome