Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1213886 > unrolled thread
| Started by | Jiri Olsa <jolsa@kernel.org> |
|---|---|
| First post | 2015-08-26 15:50 +0200 |
| Last post | 2015-08-28 15:00 +0200 |
| Articles | 4 — 4 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 04/11] perf tools: Move debugfs__strerror_open into util.c object Jiri Olsa <jolsa@kernel.org> - 2015-08-26 15:50 +0200
Re: [PATCH 04/11] perf tools: Move debugfs__strerror_open into util.c object Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-26 16:00 +0200
Re: [PATCH 04/11] perf tools: Move debugfs__strerror_open into util.c object Jiri Olsa <jolsa@redhat.com> - 2015-08-26 16:20 +0200
Re: [PATCH 04/11] perf tools: Move debugfs__strerror_open into util.c object Matt Fleming <matt@codeblueprint.co.uk> - 2015-08-28 15:00 +0200
| From | Jiri Olsa <jolsa@kernel.org> |
|---|---|
| Date | 2015-08-26 15:50 +0200 |
| Subject | [PATCH 04/11] perf tools: Move debugfs__strerror_open into util.c object |
| Message-ID | <q1Jfs-7l6-17@gated-at.bofh.it> |
Moving debugfs__strerror_open out of api/fs/debugfs.c,
because it's not debugfs specific. It'll be changed to
consider tracefs mount as well in following patches.
Link: http://lkml.kernel.org/n/tip-bq0f0l4r0bjvy0pjp4m759kv@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/lib/api/fs/debugfs.c | 51 ---------------------------------------------
tools/lib/api/fs/debugfs.h | 3 ---
tools/perf/util/util.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++
tools/perf/util/util.h | 2 ++
4 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c
index eb7cf4d18f8a..896c3595c9df 100644
--- a/tools/lib/api/fs/debugfs.c
+++ b/tools/lib/api/fs/debugfs.c
@@ -76,54 +76,3 @@ out:
return debugfs_mountpoint;
}
-int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename)
-{
- char sbuf[128];
-
- switch (err) {
- case ENOENT:
- if (debugfs_found) {
- snprintf(buf, size,
- "Error:\tFile %s/%s not found.\n"
- "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
- debugfs_mountpoint, filename);
- break;
- }
- snprintf(buf, size, "%s",
- "Error:\tUnable to find debugfs\n"
- "Hint:\tWas your kernel compiled with debugfs support?\n"
- "Hint:\tIs the debugfs filesystem mounted?\n"
- "Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'");
- break;
- case EACCES: {
- const char *mountpoint = debugfs_mountpoint;
-
- if (!access(debugfs_mountpoint, R_OK) && strncmp(filename, "tracing/", 8) == 0) {
- const char *tracefs_mntpoint = tracefs_find_mountpoint();
-
- if (tracefs_mntpoint)
- mountpoint = tracefs_mntpoint;
- }
-
- snprintf(buf, size,
- "Error:\tNo permissions to read %s/%s\n"
- "Hint:\tTry 'sudo mount -o remount,mode=755 %s'\n",
- debugfs_mountpoint, filename, mountpoint);
- }
- break;
- default:
- snprintf(buf, size, "%s", strerror_r(err, sbuf, sizeof(sbuf)));
- break;
- }
-
- return 0;
-}
-
-int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
-{
- char path[PATH_MAX];
-
- snprintf(path, PATH_MAX, "tracing/events/%s/%s", sys, name ?: "*");
-
- return debugfs__strerror_open(err, buf, size, path);
-}
diff --git a/tools/lib/api/fs/debugfs.h b/tools/lib/api/fs/debugfs.h
index 455023698d2b..19a618e9dbc1 100644
--- a/tools/lib/api/fs/debugfs.h
+++ b/tools/lib/api/fs/debugfs.h
@@ -17,7 +17,4 @@ char *debugfs_mount(const char *mountpoint);
extern char debugfs_mountpoint[];
-int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename);
-int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
-
#endif /* __API_DEBUGFS_H__ */
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 7acafb3c5592..03d1d74a5ede 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -442,6 +442,58 @@ void perf_debugfs_set_path(const char *mntpt)
set_tracing_events_path("tracing/", mntpt);
}
+int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename)
+{
+ char sbuf[128];
+
+ switch (err) {
+ case ENOENT:
+ if (debugfs_configured()) {
+ snprintf(buf, size,
+ "Error:\tFile %s/%s not found.\n"
+ "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
+ debugfs_mountpoint, filename);
+ break;
+ }
+ snprintf(buf, size, "%s",
+ "Error:\tUnable to find debugfs\n"
+ "Hint:\tWas your kernel compiled with debugfs support?\n"
+ "Hint:\tIs the debugfs filesystem mounted?\n"
+ "Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'");
+ break;
+ case EACCES: {
+ const char *mountpoint = debugfs_mountpoint;
+
+ if (!access(debugfs_mountpoint, R_OK) && strncmp(filename, "tracing/", 8) == 0) {
+ const char *tracefs_mntpoint = tracefs_find_mountpoint();
+
+ if (tracefs_mntpoint)
+ mountpoint = tracefs_mntpoint;
+ }
+
+ snprintf(buf, size,
+ "Error:\tNo permissions to read %s/%s\n"
+ "Hint:\tTry 'sudo mount -o remount,mode=755 %s'\n",
+ debugfs_mountpoint, filename, mountpoint);
+ }
+ break;
+ default:
+ snprintf(buf, size, "%s", strerror_r(err, sbuf, sizeof(sbuf)));
+ break;
+ }
+
+ return 0;
+}
+
+int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
+{
+ char path[PATH_MAX];
+
+ snprintf(path, PATH_MAX, "tracing/events/%s/%s", sys, name ?: "*");
+
+ return debugfs__strerror_open(err, buf, size, path);
+}
+
char *get_tracing_file(const char *name)
{
char *file;
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 291be1d84bc3..da48c00ab0db 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -87,6 +87,8 @@ extern char tracing_path[];
extern char tracing_events_path[];
extern void perf_debugfs_set_path(const char *mountpoint);
const char *perf_debugfs_mount(const char *mountpoint);
+int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename);
+int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
char *get_tracing_file(const char *name);
void put_tracing_file(char *file);
--
2.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2015-08-26 16:00 +0200 |
| Subject | Re: [PATCH 04/11] perf tools: Move debugfs__strerror_open into util.c object |
| Message-ID | <q1Jp9-7wp-25@gated-at.bofh.it> |
| In reply to | #1213886 |
Em Wed, Aug 26, 2015 at 03:46:46PM +0200, Jiri Olsa escreveu:
> Moving debugfs__strerror_open out of api/fs/debugfs.c,
> because it's not debugfs specific. It'll be changed to
> consider tracefs mount as well in following patches.
If it is "debugfs__" it should not deal with tracefs, right?
My feeling is that they should be decoupled more, not the other way
around :-\
- Arnaldo
> Link: http://lkml.kernel.org/n/tip-bq0f0l4r0bjvy0pjp4m759kv@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
> tools/lib/api/fs/debugfs.c | 51 ---------------------------------------------
> tools/lib/api/fs/debugfs.h | 3 ---
> tools/perf/util/util.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++
> tools/perf/util/util.h | 2 ++
> 4 files changed, 54 insertions(+), 54 deletions(-)
>
> diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c
> index eb7cf4d18f8a..896c3595c9df 100644
> --- a/tools/lib/api/fs/debugfs.c
> +++ b/tools/lib/api/fs/debugfs.c
> @@ -76,54 +76,3 @@ out:
> return debugfs_mountpoint;
> }
>
> -int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename)
> -{
> - char sbuf[128];
> -
> - switch (err) {
> - case ENOENT:
> - if (debugfs_found) {
> - snprintf(buf, size,
> - "Error:\tFile %s/%s not found.\n"
> - "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
> - debugfs_mountpoint, filename);
> - break;
> - }
> - snprintf(buf, size, "%s",
> - "Error:\tUnable to find debugfs\n"
> - "Hint:\tWas your kernel compiled with debugfs support?\n"
> - "Hint:\tIs the debugfs filesystem mounted?\n"
> - "Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'");
> - break;
> - case EACCES: {
> - const char *mountpoint = debugfs_mountpoint;
> -
> - if (!access(debugfs_mountpoint, R_OK) && strncmp(filename, "tracing/", 8) == 0) {
> - const char *tracefs_mntpoint = tracefs_find_mountpoint();
> -
> - if (tracefs_mntpoint)
> - mountpoint = tracefs_mntpoint;
> - }
> -
> - snprintf(buf, size,
> - "Error:\tNo permissions to read %s/%s\n"
> - "Hint:\tTry 'sudo mount -o remount,mode=755 %s'\n",
> - debugfs_mountpoint, filename, mountpoint);
> - }
> - break;
> - default:
> - snprintf(buf, size, "%s", strerror_r(err, sbuf, sizeof(sbuf)));
> - break;
> - }
> -
> - return 0;
> -}
> -
> -int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
> -{
> - char path[PATH_MAX];
> -
> - snprintf(path, PATH_MAX, "tracing/events/%s/%s", sys, name ?: "*");
> -
> - return debugfs__strerror_open(err, buf, size, path);
> -}
> diff --git a/tools/lib/api/fs/debugfs.h b/tools/lib/api/fs/debugfs.h
> index 455023698d2b..19a618e9dbc1 100644
> --- a/tools/lib/api/fs/debugfs.h
> +++ b/tools/lib/api/fs/debugfs.h
> @@ -17,7 +17,4 @@ char *debugfs_mount(const char *mountpoint);
>
> extern char debugfs_mountpoint[];
>
> -int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename);
> -int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
> -
> #endif /* __API_DEBUGFS_H__ */
> diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
> index 7acafb3c5592..03d1d74a5ede 100644
> --- a/tools/perf/util/util.c
> +++ b/tools/perf/util/util.c
> @@ -442,6 +442,58 @@ void perf_debugfs_set_path(const char *mntpt)
> set_tracing_events_path("tracing/", mntpt);
> }
>
> +int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename)
> +{
> + char sbuf[128];
> +
> + switch (err) {
> + case ENOENT:
> + if (debugfs_configured()) {
> + snprintf(buf, size,
> + "Error:\tFile %s/%s not found.\n"
> + "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
> + debugfs_mountpoint, filename);
> + break;
> + }
> + snprintf(buf, size, "%s",
> + "Error:\tUnable to find debugfs\n"
> + "Hint:\tWas your kernel compiled with debugfs support?\n"
> + "Hint:\tIs the debugfs filesystem mounted?\n"
> + "Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'");
> + break;
> + case EACCES: {
> + const char *mountpoint = debugfs_mountpoint;
> +
> + if (!access(debugfs_mountpoint, R_OK) && strncmp(filename, "tracing/", 8) == 0) {
> + const char *tracefs_mntpoint = tracefs_find_mountpoint();
> +
> + if (tracefs_mntpoint)
> + mountpoint = tracefs_mntpoint;
> + }
> +
> + snprintf(buf, size,
> + "Error:\tNo permissions to read %s/%s\n"
> + "Hint:\tTry 'sudo mount -o remount,mode=755 %s'\n",
> + debugfs_mountpoint, filename, mountpoint);
> + }
> + break;
> + default:
> + snprintf(buf, size, "%s", strerror_r(err, sbuf, sizeof(sbuf)));
> + break;
> + }
> +
> + return 0;
> +}
> +
> +int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
> +{
> + char path[PATH_MAX];
> +
> + snprintf(path, PATH_MAX, "tracing/events/%s/%s", sys, name ?: "*");
> +
> + return debugfs__strerror_open(err, buf, size, path);
> +}
> +
> char *get_tracing_file(const char *name)
> {
> char *file;
> diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
> index 291be1d84bc3..da48c00ab0db 100644
> --- a/tools/perf/util/util.h
> +++ b/tools/perf/util/util.h
> @@ -87,6 +87,8 @@ extern char tracing_path[];
> extern char tracing_events_path[];
> extern void perf_debugfs_set_path(const char *mountpoint);
> const char *perf_debugfs_mount(const char *mountpoint);
> +int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename);
> +int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name);
> char *get_tracing_file(const char *name);
> void put_tracing_file(char *file);
>
> --
> 2.4.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Jiri Olsa <jolsa@redhat.com> |
|---|---|
| Date | 2015-08-26 16:20 +0200 |
| Subject | Re: [PATCH 04/11] perf tools: Move debugfs__strerror_open into util.c object |
| Message-ID | <q1JIu-88h-9@gated-at.bofh.it> |
| In reply to | #1213903 |
On Wed, Aug 26, 2015 at 10:52:42AM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, Aug 26, 2015 at 03:46:46PM +0200, Jiri Olsa escreveu: > > Moving debugfs__strerror_open out of api/fs/debugfs.c, > > because it's not debugfs specific. It'll be changed to > > consider tracefs mount as well in following patches. > > If it is "debugfs__" it should not deal with tracefs, right? > > My feeling is that they should be decoupled more, not the other way > around :-\ please check 5/11: perf tools: Move tracing_path stuff under same namespace jirka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Matt Fleming <matt@codeblueprint.co.uk> |
|---|---|
| Date | 2015-08-28 15:00 +0200 |
| Subject | Re: [PATCH 04/11] perf tools: Move debugfs__strerror_open into util.c object |
| Message-ID | <q2rq9-3IB-5@gated-at.bofh.it> |
| In reply to | #1213886 |
On Wed, 26 Aug, at 03:46:46PM, Jiri Olsa wrote: > Moving debugfs__strerror_open out of api/fs/debugfs.c, > because it's not debugfs specific. It'll be changed to > consider tracefs mount as well in following patches. > > Link: http://lkml.kernel.org/n/tip-bq0f0l4r0bjvy0pjp4m759kv@git.kernel.org > Signed-off-by: Jiri Olsa <jolsa@kernel.org> > --- > tools/lib/api/fs/debugfs.c | 51 --------------------------------------------- > tools/lib/api/fs/debugfs.h | 3 --- > tools/perf/util/util.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++ > tools/perf/util/util.h | 2 ++ > 4 files changed, 54 insertions(+), 54 deletions(-) Reviewed-by: Matt Fleming <matt.fleming@intel.com> -- Matt Fleming, Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web