From: tip-bot for Peter Zijlstra <peterz@infradead.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
a.p.zijlstra@chello.nl, peterz@infradead.org,
rostedt@goodmis.org, chris.mason@oracle.com, tglx@linutronix.de,
jbaron@redhat.com, mingo@elte.hu
Subject: [tip:perfcounters/urgent] perf: Don't list tracepoints without an id
Date: Fri, 7 Aug 2009 11:12:37 GMT [thread overview]
Message-ID: <tip-79e372825f775fabd2219c9c45fbdff93c24cd3f@git.kernel.org> (raw)
In-Reply-To: <1249570134.32113.483.camel@twins>
Commit-ID: 79e372825f775fabd2219c9c45fbdff93c24cd3f
Gitweb: http://git.kernel.org/tip/79e372825f775fabd2219c9c45fbdff93c24cd3f
Author: Peter Zijlstra <peterz@infradead.org>
AuthorDate: Thu, 6 Aug 2009 16:48:54 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 7 Aug 2009 13:09:10 +0200
perf: Don't list tracepoints without an id
Stop perf list from displaying tracepoints without an id file,
those are special tracepoints that are not interfaced to
perfcounters.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Jason Baron <jbaron@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Chris Mason <chris.mason@oracle.com>
LKML-Reference: <1249570134.32113.483.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/util/parse-events.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index f77407b..4858d83 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -121,13 +121,29 @@ static unsigned long hw_cache_stat[C(MAX)] = {
(strcmp(sys_dirent.d_name, ".")) && \
(strcmp(sys_dirent.d_name, "..")))
+static int tp_event_has_id(struct dirent *sys_dir, struct dirent *evt_dir)
+{
+ char evt_path[MAXPATHLEN];
+ int fd;
+
+ snprintf(evt_path, MAXPATHLEN, "%s/%s/%s/id", debugfs_path,
+ sys_dir->d_name, evt_dir->d_name);
+ fd = open(evt_path, O_RDONLY);
+ if (fd < 0)
+ return -EINVAL;
+ close(fd);
+
+ return 0;
+}
+
#define for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next, file, st) \
while (!readdir_r(evt_dir, &evt_dirent, &evt_next) && evt_next) \
if (snprintf(file, MAXPATHLEN, "%s/%s/%s", debugfs_path, \
sys_dirent.d_name, evt_dirent.d_name) && \
(!stat(file, &st)) && (S_ISDIR(st.st_mode)) && \
(strcmp(evt_dirent.d_name, ".")) && \
- (strcmp(evt_dirent.d_name, "..")))
+ (strcmp(evt_dirent.d_name, "..")) && \
+ (!tp_event_has_id(&sys_dirent, &evt_dirent)))
#define MAX_EVENT_LENGTH 30
next prev parent reply other threads:[~2009-08-07 11:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-05 18:41 [PATCH] ftrace: fix perf-tracepoint OOPS Peter Zijlstra
2009-08-05 18:48 ` [tip:perfcounters/urgent] ftrace: Fix " 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-bot for Peter Zijlstra [this message]
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=tip-79e372825f775fabd2219c9c45fbdff93c24cd3f@git.kernel.org \
--to=peterz@infradead.org \
--cc=a.p.zijlstra@chello.nl \
--cc=chris.mason@oracle.com \
--cc=hpa@zytor.com \
--cc=jbaron@redhat.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