diff options
| author | Ingo Molnar <mingo@kernel.org> | 2017-07-30 11:15:13 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2017-07-30 11:15:13 +0200 |
| commit | f5db340f19f14a8df9dfd22d71fba1513e9f1f7e (patch) | |
| tree | 131d3345bc987aee3c922624de816492e7f323a4 /tools/testing/selftests/sync/sync_test.c | |
| parent | Merge tag 'perf-core-for-mingo-4.14-20170725' of git://git.kernel.org/pub/scm... (diff) | |
| parent | kprobes/x86: Release insn_slot in failure path (diff) | |
| download | linux-f5db340f19f14a8df9dfd22d71fba1513e9f1f7e.tar.gz linux-f5db340f19f14a8df9dfd22d71fba1513e9f1f7e.zip | |
Merge branch 'perf/urgent' into perf/core, to pick up latest fixes and refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/testing/selftests/sync/sync_test.c')
| -rw-r--r-- | tools/testing/selftests/sync/sync_test.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/sync/sync_test.c b/tools/testing/selftests/sync/sync_test.c index 9ea08d9f0b13..62fa666e501a 100644 --- a/tools/testing/selftests/sync/sync_test.c +++ b/tools/testing/selftests/sync/sync_test.c @@ -29,6 +29,7 @@ #include <unistd.h> #include <stdlib.h> #include <sys/types.h> +#include <sys/stat.h> #include <sys/wait.h> #include "synctest.h" @@ -52,10 +53,22 @@ static int run_test(int (*test)(void), char *name) exit(test()); } +static int sync_api_supported(void) +{ + struct stat sbuf; + + return 0 == stat("/sys/kernel/debug/sync/sw_sync", &sbuf); +} + int main(void) { int err = 0; + if (!sync_api_supported()) { + printf("SKIP: Sync framework not supported by kernel\n"); + return 0; + } + printf("[RUN]\tTesting sync framework\n"); err += RUN_TEST(test_alloc_timeline); |
