aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/parse-events.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2015-09-02 03:56:45 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-09-14 11:50:16 -0400
commitfbf99625b88fd8808bf2b80efac453d63cae08e8 (patch)
tree28056508bafff7782fefb03bfaa0321cf43cfa53 /tools/perf/tests/parse-events.c
parent60a1133a5b39738671eff1e4d77bedc1ee3fa528 (diff)
perf tools: Switch to tracing_path interface on appropriate places
Using tracing_path interface on several places, that more or less copy the functionality of tracing_path interface. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Raphael Beamonte <raphael.beamonte@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1441180605-24737-16-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/parse-events.c')
-rw-r--r--tools/perf/tests/parse-events.c16
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
1262static int count_tracepoints(void) 1262static 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);