perf tools: Make perf aware of tracefs
As tracefs may be mounted instead of debugfs to get to the event directories, have perf know about tracefs, and use that file system over debugfs if it is present. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/20150202193553.340946602@goodmis.org [ Fixed up error messages about tracefs pointed out by Namhyung ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
dd6dda27a8
commit
23773ca18b
@@ -3,6 +3,7 @@
|
||||
#include "evsel.h"
|
||||
#include "evlist.h"
|
||||
#include <api/fs/fs.h>
|
||||
#include <api/fs/tracefs.h>
|
||||
#include <api/fs/debugfs.h>
|
||||
#include "tests.h"
|
||||
#include "debug.h"
|
||||
@@ -1192,11 +1193,19 @@ static int count_tracepoints(void)
|
||||
{
|
||||
char events_path[PATH_MAX];
|
||||
struct dirent *events_ent;
|
||||
const char *mountpoint;
|
||||
DIR *events_dir;
|
||||
int cnt = 0;
|
||||
|
||||
scnprintf(events_path, PATH_MAX, "%s/tracing/events",
|
||||
debugfs_find_mountpoint());
|
||||
mountpoint = tracefs_find_mountpoint();
|
||||
if (mountpoint) {
|
||||
scnprintf(events_path, PATH_MAX, "%s/events",
|
||||
mountpoint);
|
||||
} else {
|
||||
mountpoint = debugfs_find_mountpoint();
|
||||
scnprintf(events_path, PATH_MAX, "%s/tracing/events",
|
||||
mountpoint);
|
||||
}
|
||||
|
||||
events_dir = opendir(events_path);
|
||||
|
||||
|
Reference in New Issue
Block a user