From: tip-bot for Peter Zijlstra <a.p.zijlstra@chello.nl>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
rostedt@goodmis.org, a.p.zijlstra@chello.nl, tglx@linutronix.de,
mingo@elte.hu
Subject: [tip:perf/urgent] perf_events, trace: Fix perf_trace_destroy(), mutex went missing
Date: Mon, 31 May 2010 07:20:07 GMT [thread overview]
Message-ID: <tip-2e97942fe57864588774f173cf4cd7bb68968b76@git.kernel.org> (raw)
In-Reply-To: <1274451913.1674.1707.camel@laptop>
Commit-ID: 2e97942fe57864588774f173cf4cd7bb68968b76
Gitweb: http://git.kernel.org/tip/2e97942fe57864588774f173cf4cd7bb68968b76
Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Fri, 21 May 2010 16:22:33 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 31 May 2010 08:46:09 +0200
perf_events, trace: Fix perf_trace_destroy(), mutex went missing
Steve spotted I forgot to do the destroy under event_mutex.
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1274451913.1674.1707.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/trace/trace_event_perf.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 49c7abf..e6f6588 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -132,8 +132,9 @@ void perf_trace_destroy(struct perf_event *p_event)
struct ftrace_event_call *tp_event = p_event->tp_event;
int i;
+ mutex_lock(&event_mutex);
if (--tp_event->perf_refcount > 0)
- return;
+ goto out;
if (tp_event->class->reg)
tp_event->class->reg(tp_event, TRACE_REG_PERF_UNREGISTER);
@@ -157,6 +158,8 @@ void perf_trace_destroy(struct perf_event *p_event)
perf_trace_buf[i] = NULL;
}
}
+out:
+ mutex_unlock(&event_mutex);
}
__kprobes void *perf_trace_buf_prepare(int size, unsigned short type,
next prev parent reply other threads:[~2010-05-31 7:20 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-21 9:02 [PATCH 00/10] perf tracepoint and output optimizations Peter Zijlstra
2010-05-21 9:02 ` [PATCH 01/10] perf, trace: Remove IRQ-disable from perf/tracepoint interaction Peter Zijlstra
2010-05-21 17:43 ` Frank Ch. Eigler
2010-05-21 17:53 ` Steven Rostedt
2010-05-21 18:07 ` Frank Ch. Eigler
2010-05-23 12:11 ` Paul Mackerras
2010-05-23 18:16 ` Peter Zijlstra
2010-05-24 4:29 ` Paul Mackerras
2010-05-25 8:06 ` [tip:perf/core] perf, trace: Fix IRQ-disable removal " tip-bot for Peter Zijlstra
2010-05-25 9:02 ` Peter Zijlstra
2010-05-25 9:30 ` [tip:perf/core] perf, trace: Fix !x86 build bug tip-bot for Peter Zijlstra
2010-05-24 11:31 ` [PATCH 01/10] perf, trace: Remove IRQ-disable from perf/tracepoint interaction Frederic Weisbecker
2010-05-25 7:30 ` [PATCH 01a/10] perf, trace: Fix !x86 build issue Peter Zijlstra
2010-05-21 9:02 ` [PATCH 02/10] perf, trace: Use per-tracepoint-per-cpu hlist to track events Peter Zijlstra
2010-05-21 9:40 ` Frederic Weisbecker
2010-05-21 10:02 ` Peter Zijlstra
2010-05-21 10:13 ` Frederic Weisbecker
2010-05-21 10:15 ` Peter Zijlstra
2010-05-21 10:19 ` Frederic Weisbecker
2010-05-21 10:38 ` Ingo Molnar
2010-05-21 10:51 ` Ingo Molnar
2010-05-21 10:19 ` Peter Zijlstra
2010-05-21 10:21 ` Frederic Weisbecker
2010-05-21 10:34 ` Peter Zijlstra
2010-05-21 10:38 ` Frederic Weisbecker
2010-05-21 10:41 ` [PATCH 02b/10] perf, trace: Fix probe unregister race Peter Zijlstra
2010-05-21 10:43 ` Frederic Weisbecker
2010-05-31 7:19 ` [tip:perf/urgent] perf_events, " tip-bot for Peter Zijlstra
2010-05-21 11:28 ` [tip:perf/core] perf, trace: Optimize tracepoints by using per-tracepoint-per-cpu hlist to track events tip-bot for Peter Zijlstra
2010-05-21 14:04 ` [PATCH 02/10] perf, trace: Use " Steven Rostedt
2010-05-21 14:18 ` Peter Zijlstra
2010-05-21 14:25 ` Peter Zijlstra
2010-05-31 7:20 ` tip-bot for Peter Zijlstra [this message]
2010-05-21 9:02 ` [PATCH 03/10] perf: Ensure IOC_OUTPUT isnt used to create multi-writer buffers Peter Zijlstra
2010-05-21 11:28 ` [tip:perf/core] perf: Ensure that IOC_OUTPUT isn't " tip-bot for Peter Zijlstra
2010-05-21 9:02 ` [PATCH 04/10] perf-record: Remove -M Peter Zijlstra
2010-05-21 11:28 ` [tip:perf/core] " tip-bot for Peter Zijlstra
2010-05-21 9:02 ` [PATCH 05/10] perf-record: Share per-cpu buffers Peter Zijlstra
2010-05-21 9:44 ` Frederic Weisbecker
2010-05-21 10:03 ` Peter Zijlstra
2010-05-21 11:29 ` [tip:perf/core] " tip-bot for Peter Zijlstra
2010-05-21 9:02 ` [PATCH 06/10] perf: Fix wakeup storm for RO mmap()s Peter Zijlstra
2010-05-21 11:29 ` [tip:perf/core] " tip-bot for Peter Zijlstra
2010-05-21 9:02 ` [PATCH 07/10] perf: Optimize perf_output_copy Peter Zijlstra
2010-05-21 11:29 ` [tip:perf/core] perf: Optimize perf_output_copy() tip-bot for Peter Zijlstra
2010-05-21 9:02 ` [PATCH 08/10] perf: Optimize the !vmalloc backed buffer Peter Zijlstra
2010-05-21 11:29 ` [tip:perf/core] " tip-bot for Peter Zijlstra
2010-05-21 9:02 ` [PATCH 09/10] perf: Remove more fastpath code Peter Zijlstra
2010-05-21 11:15 ` Steven Rostedt
2010-05-21 11:18 ` Peter Zijlstra
2010-05-21 11:30 ` [tip:perf/core] perf: Remove more code from the fastpath tip-bot for Peter Zijlstra
2010-05-21 9:02 ` [PATCH 10/10] perf: Optimize perf_tp_event_match Peter Zijlstra
2010-05-21 11:30 ` [tip:perf/core] perf: Optimize perf_tp_event_match() tip-bot for Peter Zijlstra
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-2e97942fe57864588774f173cf4cd7bb68968b76@git.kernel.org \
--to=a.p.zijlstra@chello.nl \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).