diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-01-22 09:13:43 -0500 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-01-22 15:02:20 -0500 |
| commit | 2cc990ba3af4f9511f0d016c73b8163591f890e7 (patch) | |
| tree | e807123fbbda4662c369e63cb35f15dc05ed31d0 /tools/lib/api | |
| parent | 5ed08dae9d2f2307c103e2dce94d801e74aefae4 (diff) | |
tools lib fs debugfs: Introduce debugfs__strerror_open_tp
There will be other cases where not just a tracepoint event is being
opened below the debugfs mountpoint, but it is rather common, so provide
one helper for that.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-q6e6zct49ql6nbcw8kkg0lbj@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/api')
| -rw-r--r-- | tools/lib/api/fs/debugfs.c | 9 | ||||
| -rw-r--r-- | tools/lib/api/fs/debugfs.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tools/lib/api/fs/debugfs.c b/tools/lib/api/fs/debugfs.c index 5e8f3913de43..bf9e21648894 100644 --- a/tools/lib/api/fs/debugfs.c +++ b/tools/lib/api/fs/debugfs.c | |||
| @@ -125,3 +125,12 @@ int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename | |||
| 125 | 125 | ||
| 126 | return 0; | 126 | return 0; |
| 127 | } | 127 | } |
| 128 | |||
| 129 | int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name) | ||
| 130 | { | ||
| 131 | char path[PATH_MAX]; | ||
| 132 | |||
| 133 | snprintf(path, PATH_MAX, "tracing/events/%s/%s", sys, name ?: "*"); | ||
| 134 | |||
| 135 | return debugfs__strerror_open(err, buf, size, path); | ||
| 136 | } | ||
diff --git a/tools/lib/api/fs/debugfs.h b/tools/lib/api/fs/debugfs.h index a1799aecd4d5..0739881a9897 100644 --- a/tools/lib/api/fs/debugfs.h +++ b/tools/lib/api/fs/debugfs.h | |||
| @@ -27,5 +27,6 @@ char *debugfs_mount(const char *mountpoint); | |||
| 27 | extern char debugfs_mountpoint[]; | 27 | extern char debugfs_mountpoint[]; |
| 28 | 28 | ||
| 29 | int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename); | 29 | int debugfs__strerror_open(int err, char *buf, size_t size, const char *filename); |
| 30 | int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name); | ||
| 30 | 31 | ||
| 31 | #endif /* __API_DEBUGFS_H__ */ | 32 | #endif /* __API_DEBUGFS_H__ */ |
