From: Peter Zijlstra <peterz@infradead.org>
To: Ingo Molnar <mingo@elte.hu>, Steven Rostedt <rostedt@goodmis.org>,
Chris Mason <chris.mason@oracle.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] ftrace: fix perf-tracepoint OOPS
Date: Wed, 05 Aug 2009 20:41:04 +0200 [thread overview]
Message-ID: <1249497664.5890.4.camel@laptop> (raw)
Not all tracepoints are created equal, in specific the ftrace
tracepoints are created with TRACE_EVENT_FORMAT() which does not
generate the needed bits to tie them into perf counters.
For those events, don't create the 'id' file and fail ->profile_enable
when their ID is specified through other means.
Reported-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
kernel/trace/trace_event_profile.c | 2 +-
kernel/trace/trace_events.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c
index 5b5895a..11ba5bb 100644
--- a/kernel/trace/trace_event_profile.c
+++ b/kernel/trace/trace_event_profile.c
@@ -14,7 +14,7 @@ int ftrace_profile_enable(int event_id)
mutex_lock(&event_mutex);
list_for_each_entry(event, &ftrace_events, list) {
- if (event->id == event_id) {
+ if (event->id == event_id && event->profile_enable) {
ret = event->profile_enable(event);
break;
}
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 90cdec5..e2b301d 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -971,7 +971,7 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events,
entry = trace_create_file("enable", 0644, call->dir, call,
enable);
- if (call->id)
+ if (call->id && call->profile_enable)
entry = trace_create_file("id", 0444, call->dir, call,
id);
next reply other threads:[~2009-08-05 18:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-05 18:41 Peter Zijlstra [this message]
2009-08-05 18:48 ` [tip:perfcounters/urgent] ftrace: Fix perf-tracepoint OOPS tip-bot for Peter Zijlstra
2009-08-05 18:53 ` [PATCH] ftrace: fix " Steven Rostedt
2009-08-05 19:23 ` [PATCH] perf: Don't list tracepoints without an id Peter Zijlstra
2009-08-05 20:07 ` Jason Baron
2009-08-06 14:48 ` [PATCH -v2] " Peter Zijlstra
2009-08-06 19:33 ` Jason Baron
2009-08-07 11:12 ` [tip:perfcounters/urgent] " tip-bot for Peter Zijlstra
2009-08-06 4:27 ` [tip:perfcounters/urgent] ftrace: Fix perf-tracepoint OOPS tip-bot for Peter Zijlstra
2009-08-06 9:11 ` Peter Zijlstra
2009-08-06 12:38 ` 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=1249497664.5890.4.camel@laptop \
--to=peterz@infradead.org \
--cc=chris.mason@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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