linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung.kim@lge.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Steven Rostedt <rostedt@goodmis.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 03/19] tools lib traceevent: Unregister handler when function plugin is unloaded
Date: Fri, 17 Jan 2014 11:57:09 -0300	[thread overview]
Message-ID: <1389970645-12075-4-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1389970645-12075-1-git-send-email-acme@infradead.org>

From: Namhyung Kim <namhyung@kernel.org>

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 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.8.1.4


  parent reply	other threads:[~2014-01-17 14:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17 14:57 [GIT PULL 00/19] perf/core improvements and fixes Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 01/19] tools lib traceevent: Add pevent_unregister_event_handler() Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 02/19] tools lib traceevent: Add pevent_unregister_print_function() Arnaldo Carvalho de Melo
2014-01-17 14:57 ` Arnaldo Carvalho de Melo [this message]
2014-01-17 14:57 ` [PATCH 04/19] tools lib traceevent: Unregister handler when hrtimer plugin is unloaded Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 05/19] tools lib traceevent: Unregister handler when kmem " Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 06/19] tools lib traceevent: Unregister handler when kvm " Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 07/19] tools lib traceevent: Unregister handler when sched_switch " Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 08/19] tools lib traceevent: Unregister handler when mac80211 " Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 09/19] tools lib traceevent: Unregister handler when cfg80211 " Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 10/19] tools lib traceevent: Unregister handler when jbd2 plugin is " Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 11/19] tools lib traceevent: Unregister handler when scsi plugin " Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 12/19] tools lib traceevent: Unregister handler when xen " Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 13/19] perf tools: Add 'build-test' make target Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 14/19] perf probe: Release allocated probe_trace_event if failed Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 15/19] perf probe: Release all dynamically allocated parameters Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 16/19] perf symbols: Export elf_section_by_name and reuse Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 17/19] perf tools: Do proper comm override error handling Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 18/19] perf callchain: Spare double comparison of callchain first entry Arnaldo Carvalho de Melo
2014-01-17 14:57 ` [PATCH 19/19] perf tools: Remove unnecessary callchain cursor state restore on unmatch Arnaldo Carvalho de Melo
2014-01-19 12:11 ` [GIT PULL 00/19] perf/core improvements and fixes Ingo Molnar

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=1389970645-12075-4-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    /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;
as well as URLs for NNTP newsgroup(s).