diff options
| author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-09-09 16:34:41 +0100 |
|---|---|---|
| committer | Russell King <rmk+kernel@armlinux.org.uk> | 2017-09-09 16:34:41 +0100 |
| commit | e558bdc21ae1f0db520eccd84015e17d8a589973 (patch) | |
| tree | b436123bd52f267b8c7f361618cded3e1e4421ea /tools/testing/selftests/sync/sync_test.c | |
| parent | ARM: 8692/1: mm: abort uaccess retries upon fatal signal (diff) | |
| parent | ARM: 8691/1: Export save_stack_trace_tsk() (diff) | |
| download | linux-e558bdc21ae1f0db520eccd84015e17d8a589973.tar.gz linux-e558bdc21ae1f0db520eccd84015e17d8a589973.zip | |
Merge branches 'fixes' and 'misc' into for-linus
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); |
