diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-15 01:17:12 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-15 01:17:12 +0300 |
commit | 5d89d9f502f9c33ed0270d716f238429861e1942 (patch) | |
tree | 6a353640e6836ca465f2dcf00323a7f8a793ae59 /Documentation/vDSO/vdso_test.c | |
parent | 50cff89837a43a7c62ac080de9742a298d6418b3 (diff) | |
parent | fecf861e765b2f9ce1a0487c3940afaed80ef7a8 (diff) | |
download | linux-5d89d9f502f9c33ed0270d716f238429861e1942.tar.xz |
Merge tag 'linux-kselftest-4.9-rc1-update' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kselftest updates from Shuah Khan:
"This update consists of:
- Fixes and improvements to existing tests
- Moving code from Documentation to selftests, samples, and tools:
* Moves dnotify_test, prctl, ptp, vDSO, ia64, watchdog, and
networking tests from Documentation to selftests.
* Moves mic/mpssd, misc-devices/mei, timers, watchdog, auxdisplay,
and blackfin examples from Documentation to samples.
* Moves accounting, laptops/dslm, and pcmcia/crc32hash tools from
Documentation to tools.
* Deletes BUILD_DOCSRC and its dependencies"
* tag 'linux-kselftest-4.9-rc1-update' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (21 commits)
selftests/futex: Check ANSI terminal color support
Doc: update 00-INDEX files to reflect the runnable code move
samples: move blackfin gptimers-example from Documentation
tools: move pcmcia crc32hash tool from Documentation
tools: move laptops dslm tool from Documentation
tools: move accounting tool from Documentation
samples: move auxdisplay example code from Documentation
samples: move watchdog example code from Documentation
samples: move timers example code from Documentation
samples: move misc-devices/mei example code from Documentation
samples: move mic/mpssd example code from Documentation
selftests: Move networking/timestamping from Documentation
selftests: move watchdog tests from Documentation/watchdog
selftests: move ia64 tests from Documentation/ia64
selftests: move vDSO tests from Documentation/vDSO
selftests: move ptp tests from Documentation/ptp
selftests: move prctl tests from Documentation/prctl
selftests: move dnotify_test from Documentation/filesystems
selftests/timers: Add missing error code assignment before test
selftests/zram: replace ZRAM_LZ4_COMPRESS
...
Diffstat (limited to 'Documentation/vDSO/vdso_test.c')
-rw-r--r-- | Documentation/vDSO/vdso_test.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/Documentation/vDSO/vdso_test.c b/Documentation/vDSO/vdso_test.c deleted file mode 100644 index 8daeb7d7032c..000000000000 --- a/Documentation/vDSO/vdso_test.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * vdso_test.c: Sample code to test parse_vdso.c - * Copyright (c) 2014 Andy Lutomirski - * Subject to the GNU General Public License, version 2 - * - * Compile with: - * gcc -std=gnu99 vdso_test.c parse_vdso.c - * - * Tested on x86, 32-bit and 64-bit. It may work on other architectures, too. - */ - -#include <stdint.h> -#include <elf.h> -#include <stdio.h> -#include <sys/auxv.h> -#include <sys/time.h> - -extern void *vdso_sym(const char *version, const char *name); -extern void vdso_init_from_sysinfo_ehdr(uintptr_t base); -extern void vdso_init_from_auxv(void *auxv); - -int main(int argc, char **argv) -{ - unsigned long sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR); - if (!sysinfo_ehdr) { - printf("AT_SYSINFO_EHDR is not present!\n"); - return 0; - } - - vdso_init_from_sysinfo_ehdr(getauxval(AT_SYSINFO_EHDR)); - - /* Find gettimeofday. */ - typedef long (*gtod_t)(struct timeval *tv, struct timezone *tz); - gtod_t gtod = (gtod_t)vdso_sym("LINUX_2.6", "__vdso_gettimeofday"); - - if (!gtod) { - printf("Could not find __vdso_gettimeofday\n"); - return 1; - } - - struct timeval tv; - long ret = gtod(&tv, 0); - - if (ret == 0) { - printf("The time is %lld.%06lld\n", - (long long)tv.tv_sec, (long long)tv.tv_usec); - } else { - printf("__vdso_gettimeofday failed\n"); - } - - return 0; -} |