public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH 1/1] Remove static debugfs path from parse-events
@ 2009-10-04 22:49 ashwinc
  2009-10-12 20:41 ` Ingo Molnar
  2009-10-12 20:43 ` [tip:perf/urgent] perf tools: " tip-bot for Ashwin Chaugule
  0 siblings, 2 replies; 3+ messages in thread
From: ashwinc @ 2009-10-04 22:49 UTC (permalink / raw)
  To: mingo, LKML; +Cc: Thomas Gleixner, Arjan van de Ven

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]


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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: perf-events-Remove-static-debugfs-path.patch --]
[-- Type: text/x-patch; name="perf-events-Remove-static-debugfs-path.patch", Size: 1106 bytes --]

>From 289657eaae162b6a5571894ec71d1ecca5454a54 Mon Sep 17 00:00:00 2001
From: Ashwin Chaugule <ashwinc@quicinc.com>
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

	Signed-off-by: Ashwin Chaugule <ashwinc@quicinc.com>
---
 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..c661c90 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -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 = '/';
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC] [PATCH 1/1] Remove static debugfs path from parse-events
  2009-10-04 22:49 [RFC] [PATCH 1/1] Remove static debugfs path from parse-events ashwinc
@ 2009-10-12 20:41 ` Ingo Molnar
  2009-10-12 20:43 ` [tip:perf/urgent] perf tools: " tip-bot for Ashwin Chaugule
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2009-10-12 20:41 UTC (permalink / raw)
  To: ashwinc
  Cc: mingo, LKML, Thomas Gleixner, Arjan van de Ven, Peter Zijlstra,
	Frédéric Weisbecker, Steven Rostedt, Paul Mackerras


* ashwinc@codeaurora.org <ashwinc@codeaurora.org> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/urgent] perf tools: Remove static debugfs path from parse-events
  2009-10-04 22:49 [RFC] [PATCH 1/1] Remove static debugfs path from parse-events ashwinc
  2009-10-12 20:41 ` Ingo Molnar
@ 2009-10-12 20:43 ` tip-bot for Ashwin Chaugule
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Ashwin Chaugule @ 2009-10-12 20:43 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, arjan, tglx, ashwinc, mingo

Commit-ID:  63c9e01e1a0dcecc982137d527d44b5ac808b607
Gitweb:     http://git.kernel.org/tip/63c9e01e1a0dcecc982137d527d44b5ac808b607
Author:     Ashwin Chaugule <ashwinc@quicinc.com>
AuthorDate: Sun, 4 Oct 2009 15:49:34 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
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 <ashwinc@quicinc.com>
Cc: "Arjan van de Ven" <arjan@linux.intel.com>
LKML-Reference: <a751bdc6978478de6d10440e587a2cc7.squirrel@www.codeaurora.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 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 = '/';

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-12 20:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-04 22:49 [RFC] [PATCH 1/1] Remove static debugfs path from parse-events ashwinc
2009-10-12 20:41 ` Ingo Molnar
2009-10-12 20:43 ` [tip:perf/urgent] perf tools: " tip-bot for Ashwin Chaugule

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox