Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/timens: Fix gettime_perf to work on powerpc

On powerpc:
- VDSO library is named linux-vdso32.so.1 or linux-vdso64.so.1
- clock_gettime is named __kernel_clock_gettime()

Ensure gettime_perf tries these names before giving up.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/469f37ab91984309eb68c0fb47e8438cdf5b6463.1617198956.git.christophe.leroy@csgroup.eu

authored by

Christophe Leroy and committed by
Michael Ellerman
f56607e8 92d9d61b

+8
+8
tools/testing/selftests/timens/gettime_perf.c
··· 25 25 if (!vdso) 26 26 vdso = dlopen("linux-gate.so.1", 27 27 RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); 28 + if (!vdso) 29 + vdso = dlopen("linux-vdso32.so.1", 30 + RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); 31 + if (!vdso) 32 + vdso = dlopen("linux-vdso64.so.1", 33 + RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); 28 34 if (!vdso) { 29 35 pr_err("[WARN]\tfailed to find vDSO\n"); 30 36 return; 31 37 } 32 38 33 39 vdso_clock_gettime = (vgettime_t)dlsym(vdso, "__vdso_clock_gettime"); 40 + if (!vdso_clock_gettime) 41 + vdso_clock_gettime = (vgettime_t)dlsym(vdso, "__kernel_clock_gettime"); 34 42 if (!vdso_clock_gettime) 35 43 pr_err("Warning: failed to find clock_gettime in vDSO\n"); 36 44