summaryrefslogtreecommitdiff
path: root/tools/lib/api/fs/tracing_path.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-09-15 08:50:59 +0200
committerIngo Molnar <mingo@kernel.org>2015-09-15 08:50:59 +0200
commit9059b284caecb628fac826c2c5cc8ee85708eec1 (patch)
treeb3b772a434395bb16fe9b8b4156a46f0508eb250 /tools/lib/api/fs/tracing_path.c
parent8f3e5684d3fbd91ead283916676fa3dac22615e5 (diff)
parent92d424ae898e0d04ac34263aa33e40acc1e1f3d1 (diff)
Merge tag 'perf-core-for-mingo-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: User visible changes: - Add 'socket' sort entry, to sort by the processor socket in 'perf top' and 'perf report'. (Kan Liang) - Introduce --socket-filter to 'perf report', for filtering by processor socket. (Kan Liang) - Add new "Zoom into Processor Socket" operation in the perf hists browser, used in 'perf top' and 'perf report'. (Kan Liang) - Fix the 'CPU' hist browser column width calculation. (Arnaldo Carvalho de Melo) Infrastructure changes: - 'perf test' fixes for the object code reading entry. (Jan Stancek) - Add processor socket and cpu topology 'perf test' entries. (Kan Liang) - Introduce more sysfs__read_TYPE() helpers. (Arnaldo Carvalho de Melo) - Group cpu information reading functions in tools/lib/api/cpu.[ch], starting with cpu__get_max_freq() from a patchkit by Kan Liang. (Arnaldo Carvalho de Melo) - Retrieve the MSR PMU type from a perf.data file header and store it in struct perf_env. (Kan Liang) - Add tools/include into CTAGS file list. (Jiri Olsa) - Add iterator function for perf tests. (Matt Fleming) - Switch to tracing_patch interface. (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/lib/api/fs/tracing_path.c')
-rw-r--r--tools/lib/api/fs/tracing_path.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c
index 3b3e4f5fc50b..38aca2dd1946 100644
--- a/tools/lib/api/fs/tracing_path.c
+++ b/tools/lib/api/fs/tracing_path.c
@@ -7,8 +7,7 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
-#include "debugfs.h"
-#include "tracefs.h"
+#include "fs.h"
#include "tracing_path.h"
@@ -29,7 +28,7 @@ static const char *tracing_path_tracefs_mount(void)
{
const char *mnt;
- mnt = tracefs_mount(NULL);
+ mnt = tracefs__mount();
if (!mnt)
return NULL;
@@ -42,7 +41,7 @@ static const char *tracing_path_debugfs_mount(void)
{
const char *mnt;
- mnt = debugfs_mount(NULL);
+ mnt = debugfs__mount();
if (!mnt)
return NULL;
@@ -90,33 +89,39 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)
switch (err) {
case ENOENT:
- if (debugfs_configured()) {
+ /*
+ * We will get here if we can't find the tracepoint, but one of
+ * debugfs or tracefs is configured, which means you probably
+ * want some tracepoint which wasn't compiled in your kernel.
+ * - jirka
+ */
+ if (debugfs__configured() || tracefs__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);
+ tracing_events_path, 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"
+ "Error:\tUnable to find debugfs/tracefs\n"
+ "Hint:\tWas your kernel compiled with debugfs/tracefs support?\n"
+ "Hint:\tIs the debugfs/tracefs filesystem mounted?\n"
"Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'");
break;
case EACCES: {
- const char *mountpoint = debugfs_mountpoint;
+ const char *mountpoint = debugfs__mountpoint();
- if (!access(debugfs_mountpoint, R_OK) && strncmp(filename, "tracing/", 8) == 0) {
- const char *tracefs_mntpoint = tracefs_find_mountpoint();
+ if (!access(mountpoint, R_OK) && strncmp(filename, "tracing/", 8) == 0) {
+ const char *tracefs_mntpoint = tracefs__mountpoint();
if (tracefs_mntpoint)
- mountpoint = tracefs_mntpoint;
+ mountpoint = tracefs__mountpoint();
}
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);
+ tracing_events_path, filename, mountpoint);
}
break;
default:
@@ -131,7 +136,7 @@ int tracing_path__strerror_open_tp(int err, char *buf, size_t size, const char *
{
char path[PATH_MAX];
- snprintf(path, PATH_MAX, "tracing/events/%s/%s", sys, name ?: "*");
+ snprintf(path, PATH_MAX, "%s/%s", sys, name ?: "*");
return strerror_open(err, buf, size, path);
}