Skip to contentSkip to conversation

perf tools: Remove extra '/' character in events file path

PATCH In review xiakaixu 4 participants 5 messages Apr 26, 2014 – May 1, 2014

lore
Share & tools
lore

xiakaixu

author
#0 lore raw

PATCH 1/1 perf tools: Remove extra '/' character in events file path

The array debugfs_known_mountpoints[] will cause extra '/' character output.
Remove it.

pre:

$ perf probe -l
/sys/kernel/debug//tracing/uprobe_events file does not exist -
please rebuild kernel with CONFIG_UPROBE_EVENTS.

post:

$ perf probe -l
/sys/kernel/debug/tracing/uprobe_events file does not exist -
please rebuild kernel with CONFIG_UPROBE_EVENTS.
---
 tools/lib/api/fs/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/lib/api/fs/debugfs.c +2 -2
index 7c43479..a74fba6 100644
@@ -12,8 +12,8 @@
 char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug";
 
 static const char * const debugfs_known_mountpoints[] = {
-	"/sys/kernel/debug/",
-	"/debug/",
+	"/sys/kernel/debug",
+	"/debug",
 	0,
 };
 

-- 1.8.5.5

Acked-by on v1 1/1
#1 lore raw

Hi xiakaixu,

(Adding Jiri and Boris to CC)

Quoted 5 lines

The array debugfs_known_mountpoints[] will cause extra '/' character output.
Remove it.

pre:

Quoted 8 lines
$ perf probe -l
/sys/kernel/debug//tracing/uprobe_events file does not exist -
please rebuild kernel with CONFIG_UPROBE_EVENTS.

post:

$ perf probe -l
/sys/kernel/debug/tracing/uprobe_events file does not exist -
please rebuild kernel with CONFIG_UPROBE_EVENTS.

Looks like all of its callers already provide a '/' after the debugfs mountpoint, so

Thanks,
Namhyung

Quoted 22 lines
---
 tools/lib/api/fs/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/lib/api/fs/debugfs.c +2 -3
index 7c43479..a74fba6 100644
@@ -12,8 +12,8 @@
 char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug";
 
 static const char * const debugfs_known_mountpoints[] = {
-	"/sys/kernel/debug/",
-	"/debug/",
+	"/sys/kernel/debug",
+	"/debug",
 	0,
 };
 
-- 1.8.5.5
author
#2 lore raw
Quoted 3 lines · Namhyung Kim

Hi xiakaixu,

(Adding Jiri and Boris to CC)

OK.
thanks,

Quoted 47 lines
Quoted 6 lines

The array debugfs_known_mountpoints[] will cause extra '/' character output.
Remove it.

pre:

Quoted 8 lines
$ perf probe -l
/sys/kernel/debug//tracing/uprobe_events file does not exist -
please rebuild kernel with CONFIG_UPROBE_EVENTS.

post:

$ perf probe -l
/sys/kernel/debug/tracing/uprobe_events file does not exist -
please rebuild kernel with CONFIG_UPROBE_EVENTS.

Looks like all of its callers already provide a '/' after the debugfs mountpoint, so

Thanks,
Namhyung

Quoted 12 lines
---
 tools/lib/api/fs/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/lib/api/fs/debugfs.c +0 -0
index 7c43479..a74fba6 100644
@@ -12,8 +12,8 @@
 char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug";

tools/lib/api/fs/debugfs.c

Quoted 10 lines
tools/lib/api/fs/debugfs.c +2 -3
 
 static const char * const debugfs_known_mountpoints[] = {
-	"/sys/kernel/debug/",
-	"/debug/",
+	"/sys/kernel/debug",
+	"/debug",
 	0,
 };
 
-- 1.8.5.5

.

#3 lore raw
Quoted 7 lines · xiakaixu
Quoted 7 lines
Quoted 7 lines
tools/lib/api/fs/debugfs.c +0 -0
index 7c43479..a74fba6 100644
@@ -12,8 +12,8 @@
 char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug";
 
Quoted 5 lines
Quoted 5 lines

tools/lib/api/fs/debugfs.c line 16

Quoted 5 lines
tools/lib/api/fs/debugfs.c +2 -2
 static const char * const debugfs_known_mountpoints[] = {
-	"/sys/kernel/debug/",
-	"/debug/",
+	"/sys/kernel/debug",
+	"/debug",

Right, fs/debugfs.c needs to get merged with fs/fs.c at some point.

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#4 lore raw
In reply to xiakaixu
perf tools: Remove extra '/' character in events file path
Commit-ID:  603940b6b8b1347ec13a628165c00194ebc17ed2
Gitweb:     http://git.kernel.org/tip/603940b6b8b1347ec13a628165c00194ebc17ed2
Author:     Xia Kaixu <[email protected]>
AuthorDate: Sat, 26 Apr 2014 15:55:12 +0800
Committer:  Jiri Olsa <[email protected]>
CommitDate: Wed, 30 Apr 2014 17:02:24 +0200

perf tools: Remove extra '/' character in events file path

The array debugfs_known_mountpoints[] will cause extra '/' character output.
Remove it.

pre:

$ perf probe -l
/sys/kernel/debug//tracing/uprobe_events file does not exist -
please rebuild kernel with CONFIG_UPROBE_EVENTS.

post:

$ perf probe -l
/sys/kernel/debug/tracing/uprobe_events file does not exist -
please rebuild kernel with CONFIG_UPROBE_EVENTS.
---
 tools/lib/api/fs/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/lib/api/fs/debugfs.c +2 -2
index 7c43479..a74fba6 100644
@@ -12,8 +12,8 @@
 char debugfs_mountpoint[PATH_MAX + 1] = "/sys/kernel/debug";
 
 static const char * const debugfs_known_mountpoints[] = {
-	"/sys/kernel/debug/",
-	"/debug/",
+	"/sys/kernel/debug",
+	"/debug",
 	0,
 };