diff options
Diffstat (limited to 'tools/perf/tests/parse-events.c')
-rw-r--r-- | tools/perf/tests/parse-events.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 91fbfd593c4a..3a2ebe666192 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
@@ -1261,23 +1261,11 @@ test__checkevent_breakpoint_len_rw_modifier(struct perf_evlist *evlist) | |||
1261 | 1261 | ||
1262 | static int count_tracepoints(void) | 1262 | static int count_tracepoints(void) |
1263 | { | 1263 | { |
1264 | char events_path[PATH_MAX]; | ||
1265 | struct dirent *events_ent; | 1264 | struct dirent *events_ent; |
1266 | const char *mountpoint; | ||
1267 | DIR *events_dir; | 1265 | DIR *events_dir; |
1268 | int cnt = 0; | 1266 | int cnt = 0; |
1269 | 1267 | ||
1270 | mountpoint = tracefs__mountpoint(); | 1268 | events_dir = opendir(tracing_events_path); |
1271 | if (mountpoint) { | ||
1272 | scnprintf(events_path, PATH_MAX, "%s/events", | ||
1273 | mountpoint); | ||
1274 | } else { | ||
1275 | mountpoint = debugfs__mountpoint(); | ||
1276 | scnprintf(events_path, PATH_MAX, "%s/tracing/events", | ||
1277 | mountpoint); | ||
1278 | } | ||
1279 | |||
1280 | events_dir = opendir(events_path); | ||
1281 | 1269 | ||
1282 | TEST_ASSERT_VAL("Can't open events dir", events_dir); | 1270 | TEST_ASSERT_VAL("Can't open events dir", events_dir); |
1283 | 1271 | ||
@@ -1294,7 +1282,7 @@ static int count_tracepoints(void) | |||
1294 | continue; | 1282 | continue; |
1295 | 1283 | ||
1296 | scnprintf(sys_path, PATH_MAX, "%s/%s", | 1284 | scnprintf(sys_path, PATH_MAX, "%s/%s", |
1297 | events_path, events_ent->d_name); | 1285 | tracing_events_path, events_ent->d_name); |
1298 | 1286 | ||
1299 | sys_dir = opendir(sys_path); | 1287 | sys_dir = opendir(sys_path); |
1300 | TEST_ASSERT_VAL("Can't open sys dir", sys_dir); | 1288 | TEST_ASSERT_VAL("Can't open sys dir", sys_dir); |