Skip to contentSkip to conversation

Remove static debugfs path from parse-events

RFC PATCH Applied [email protected] 3 participants 3 messages Oct 4, 2009 – Oct 12, 2009 perf events

lore
Share & tools
lore
#0 lore raw

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

Quoted 1 line

From 289657eaae162b6a5571894ec71d1ecca5454a54 Mon Sep 17 00:00:00 2001

From: Ashwin Chaugule <[email protected]>
Date: Wed, 30 Sep 2009 13:36:58 -0400
Subject: [PATCH] [perf-events] Remove static debugfs path

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

modified: tools/perf/util/parse-events.c

---
 tools/perf/util/parse-events.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
tools/perf/util/parse-events.c +4 -1
index 87c424d..c661c90 100644
@@ -690,8 +690,11 @@ static void store_event_type(const char *orgname)
 	char filename[PATH_MAX], *c;
 	FILE *file;
 	int id;
+	
+	sprintf(filename, "%s/", debugfs_path);
+	strncat(filename, orgname, strlen(orgname));
+	strcat(filename, "/id");
 
-	sprintf(filename, "/sys/kernel/debug/tracing/events/%s/id", orgname);
 	c = strchr(filename, ':');
 	if (c)
 		*c = '/';
Signature · 1 line
1.5.6.3
Applied
#1 lore raw
Quoted 4 lines · * [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 ;-)

Quoted 2 lines

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

Applied, thanks Ashwin!

Ingo

#2 lore raw

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

In reply to [email protected]
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.

Cc "Arjan van de Ven" <[email protected]>

LKML-Reference: <[email protected]>

---
 tools/perf/util/parse-events.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
tools/perf/util/parse-events.c +4 -1
index 87c424d..8cfb48c 100644
@@ -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 = '/';