2014-04-26 07:55:52

by xiakaixu

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Xia Kaixu <[email protected]>
---
tools/lib/api/fs/debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c
index 7c43479..a74fba6 100644
--- a/tools/lib/api/fs/debugfs.c
+++ b/tools/lib/api/fs/debugfs.c
@@ -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


2014-04-28 00:15:05

by Namhyung Kim

[permalink] [raw]
Subject: Re: [PATCH] perf tools: Remove extra '/' character in events file path

Hi xiakaixu,

(Adding Jiri and Boris to CC)

> 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.

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

Acked-by: Namhyung Kim <[email protected]>

Thanks,
Namhyung

>
> Signed-off-by: Xia Kaixu <[email protected]>
> ---
> tools/lib/api/fs/debugfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c
> index 7c43479..a74fba6 100644
> --- a/tools/lib/api/fs/debugfs.c
> +++ b/tools/lib/api/fs/debugfs.c
> @@ -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

2014-04-28 02:02:16

by xiakaixu

[permalink] [raw]
Subject: Re: [PATCH] perf tools: Remove extra '/' character in events file path

于 2014/4/28 8:14, Namhyung Kim 写道:
> Hi xiakaixu,
>
> (Adding Jiri and Boris to CC)

OK.
thanks,
>
>> 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.
>
> Looks like all of its callers already provide a '/' after the debugfs
> mountpoint, so
>
> Acked-by: Namhyung Kim <[email protected]>
>
> Thanks,
> Namhyung
>
>>
>> Signed-off-by: Xia Kaixu <[email protected]>
>> ---
>> tools/lib/api/fs/debugfs.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c
>> index 7c43479..a74fba6 100644
>> --- a/tools/lib/api/fs/debugfs.c
>> +++ b/tools/lib/api/fs/debugfs.c
>> @@ -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
> .
>

2014-04-28 07:53:31

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH] perf tools: Remove extra '/' character in events file path

On Mon, Apr 28, 2014 at 10:01:30AM +0800, xiakaixu wrote:
> >> diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c
> >> index 7c43479..a74fba6 100644
> >> --- a/tools/lib/api/fs/debugfs.c
> >> +++ b/tools/lib/api/fs/debugfs.c
> >> @@ -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",

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

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--