summaryrefslogtreecommitdiff
path: root/tools/perf/tests/open-syscall.c
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2015-04-16 13:52:53 (GMT)
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-05-29 15:43:41 (GMT)
commit43f322b4ab3f203d8eefbdad6e58e1637221e4a7 (patch)
treebec98764c8084937c6bbb5a6c4f8469b7f03d8b8 /tools/perf/tests/open-syscall.c
parent3237f28188c3e41a938781a369652772a23e97a9 (diff)
downloadlinux-43f322b4ab3f203d8eefbdad6e58e1637221e4a7.tar.xz
perf tests: Switch from open to openat
Multiple perf tests fail on arm64 due to missing open syscall: 2: detect open syscall event : FAILED! open(2) is a legacy syscall, replaced with openat(2) since 2.6.16. Thus new architectures in kernel, such as arm64, don't implement these legacy syscalls. The patch replaces all sys_enter_open events with sys_enter_openat, renames the related tests and test output to avoid confusion. Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Reviewed-by: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1429192375-13706-2-git-send-email-riku.voipio@linaro.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/open-syscall.c')
-rw-r--r--tools/perf/tests/open-syscall.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/perf/tests/open-syscall.c b/tools/perf/tests/open-syscall.c
index 07aa319..9f9491b 100644
--- a/tools/perf/tests/open-syscall.c
+++ b/tools/perf/tests/open-syscall.c
@@ -3,11 +3,11 @@
#include "debug.h"
#include "tests.h"
-int test__open_syscall_event(void)
+int test__openat_syscall_event(void)
{
int err = -1, fd;
struct perf_evsel *evsel;
- unsigned int nr_open_calls = 111, i;
+ unsigned int nr_openat_calls = 111, i;
struct thread_map *threads = thread_map__new(-1, getpid(), UINT_MAX);
char sbuf[STRERR_BUFSIZE];
@@ -16,7 +16,7 @@ int test__open_syscall_event(void)
return -1;
}
- evsel = perf_evsel__newtp("syscalls", "sys_enter_open");
+ evsel = perf_evsel__newtp("syscalls", "sys_enter_openat");
if (evsel == NULL) {
if (tracefs_configured())
pr_debug("is tracefs mounted on /sys/kernel/tracing?\n");
@@ -34,8 +34,8 @@ int test__open_syscall_event(void)
goto out_evsel_delete;
}
- for (i = 0; i < nr_open_calls; ++i) {
- fd = open("/etc/passwd", O_RDONLY);
+ for (i = 0; i < nr_openat_calls; ++i) {
+ fd = openat(0, "/etc/passwd", O_RDONLY);
close(fd);
}
@@ -44,9 +44,9 @@ int test__open_syscall_event(void)
goto out_close_fd;
}
- if (evsel->counts->cpu[0].val != nr_open_calls) {
+ if (evsel->counts->cpu[0].val != nr_openat_calls) {
pr_debug("perf_evsel__read_on_cpu: expected to intercept %d calls, got %" PRIu64 "\n",
- nr_open_calls, evsel->counts->cpu[0].val);
+ nr_openat_calls, evsel->counts->cpu[0].val);
goto out_close_fd;
}