aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/parse-events.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/parse-events.c')
-rw-r--r--tools/perf/tests/parse-events.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 1cdab0ce00e2..ac243ebcb20a 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -3,6 +3,7 @@
3#include "evsel.h" 3#include "evsel.h"
4#include "evlist.h" 4#include "evlist.h"
5#include <api/fs/fs.h> 5#include <api/fs/fs.h>
6#include <api/fs/tracefs.h>
6#include <api/fs/debugfs.h> 7#include <api/fs/debugfs.h>
7#include "tests.h" 8#include "tests.h"
8#include "debug.h" 9#include "debug.h"
@@ -1192,11 +1193,19 @@ static int count_tracepoints(void)
1192{ 1193{
1193 char events_path[PATH_MAX]; 1194 char events_path[PATH_MAX];
1194 struct dirent *events_ent; 1195 struct dirent *events_ent;
1196 const char *mountpoint;
1195 DIR *events_dir; 1197 DIR *events_dir;
1196 int cnt = 0; 1198 int cnt = 0;
1197 1199
1198 scnprintf(events_path, PATH_MAX, "%s/tracing/events", 1200 mountpoint = tracefs_find_mountpoint();
1199 debugfs_find_mountpoint()); 1201 if (mountpoint) {
1202 scnprintf(events_path, PATH_MAX, "%s/events",
1203 mountpoint);
1204 } else {
1205 mountpoint = debugfs_find_mountpoint();
1206 scnprintf(events_path, PATH_MAX, "%s/tracing/events",
1207 mountpoint);
1208 }
1200 1209
1201 events_dir = opendir(events_path); 1210 events_dir = opendir(events_path);
1202 1211