2009-10-04 22:44:19

by Ashwin Chaugule

[permalink] [raw]
Subject: [RFC] [PATCH 1/1] Remove static debugfs path from parse-events


I was working on getting timechart running and noticed that it wouldn't
get any sched_switch/wakeup etc events if debugfs is mounted anywhere
other than /sys/kernel/debug/. Mine was mounted in /debug (the second
sane location ;) )

So we'd need something like whats in the patch to make use of the global
debugfs_path.

Also, I'm assuming that parse-events.c is governed by GPLv2 or something
similar ?

Cheers,
Ashwin


Attachments:
perf-events-Remove-static-debugfs-path.patch (1.08 kB)

2009-10-12 20:42:42

by Ingo Molnar

[permalink] [raw]
Subject: Re: [RFC] [PATCH 1/1] Remove static debugfs path from parse-events


* [email protected] <[email protected]> wrote:

> I was working on getting timechart running and noticed that it
> wouldn't get any sched_switch/wakeup etc events if debugfs is mounted
> anywhere other than /sys/kernel/debug/. Mine was mounted in /debug
> (the second sane location ;) )

It's the first sane location ;-)

> So we'd need something like whats in the patch to make use of the
> global debugfs_path.

Applied, thanks Ashwin!

Ingo

Subject: [tip:perf/urgent] perf tools: Remove static debugfs path from parse-events

Commit-ID: 63c9e01e1a0dcecc982137d527d44b5ac808b607
Gitweb: http://git.kernel.org/tip/63c9e01e1a0dcecc982137d527d44b5ac808b607
Author: Ashwin Chaugule <[email protected]>
AuthorDate: Sun, 4 Oct 2009 15:49:34 -0700
Committer: Ingo Molnar <[email protected]>
CommitDate: Mon, 12 Oct 2009 22:41:05 +0200

perf tools: Remove static debugfs path from parse-events

Timechart doesn't work if debugfs is not in /sys/kernel/debug/.
Fixed by using global debugfs_path which is filled in by perf.

Signed-off-by: Ashwin Chaugule <[email protected]>
Cc: "Arjan van de Ven" <[email protected]>
LKML-Reference: <a751bdc6978478de6d10440e587a2cc7.squirrel@http://www.codeaurora.org>
Signed-off-by: Ingo Molnar <[email protected]>
---
tools/perf/util/parse-events.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 87c424d..8cfb48c 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -691,7 +691,10 @@ static void store_event_type(const char *orgname)
FILE *file;
int id;

- sprintf(filename, "/sys/kernel/debug/tracing/events/%s/id", orgname);
+ sprintf(filename, "%s/", debugfs_path);
+ strncat(filename, orgname, strlen(orgname));
+ strcat(filename, "/id");
+
c = strchr(filename, ':');
if (c)
*c = '/';