glibc/sysdeps
Adhemerval Zanella a9091a1244 linux: Optimize fallback 32-bit clock_gettime
This patch avoid probing the __NR_clock_getttime64 syscall each time
__clock_gettime64 is issued on a kernel without 64 bit time support.
Once ENOSYS is obtained, only 32-bit clock_gettime are used.

The following snippet:

  clock_gettime (CLOCK_REALTIME, &(struct timespec) { 0 });
  clock_gettime (CLOCK_MONOTONIC, &(struct timespec) { 0 });
  clock_gettime (CLOCK_BOOTTIME, &(struct timespec) { 0 });
  clock_gettime (20, &(struct timespec) { 0 });

On a kernel without 64 bit time support and with vDSO support results
on the following syscalls:

  syscall_0x193(0, 0xff87ba30, [...]) = -1 ENOSYS (Function not implemented)
  clock_gettime(CLOCK_BOOTTIME, {tv_sec=927082, tv_nsec=474382032}) = 0
  clock_gettime(0x14 /* CLOCK_??? */, 0xff87b9f8) = -1 EINVAL (Invalid argument)

While on a kernel without vDSO support:

  syscall_0x193(0, 0xbec95550, 0xb6ed2000, 0x1, 0xbec95550, 0) = -1 (errno 38)
  clock_gettime(CLOCK_REALTIME, {tv_sec=1576615930, tv_nsec=638250162}) = 0
  clock_gettime(CLOCK_MONOTONIC, {tv_sec=1665478, tv_nsec=638779620}) = 0
  clock_gettime(CLOCK_BOOTTIME, {tv_sec=1675418, tv_nsec=292932704}) = 0
  clock_gettime(0x14 /* CLOCK_??? */, 0xbec95530) = -1 EINVAL (Invalid argument)

Checked on i686-linux-gnu on 4.15 kernel and on a 5.3 kernel.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2020-01-03 11:22:07 -03:00
..
aarch64 Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
alpha Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
arm Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
csky Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
generic elf: Move vDSO setup to rtld (BZ#24967) 2020-01-03 11:22:07 -03:00
gnu Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
hppa Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
htl Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
hurd Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
i386 Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
ia64 Linux: Use system call tables during build 2020-01-02 10:18:23 +01:00
ieee754 Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
init_array Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
m68k Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
mach Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
microblaze Linux: Use system call tables during build 2020-01-02 10:18:23 +01:00
mips Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
nios2 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
nptl Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
posix Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
powerpc elf: Move vDSO setup to rtld (BZ#24967) 2020-01-03 11:22:07 -03:00
pthread Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
riscv Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
s390 Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
sh Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sparc Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
unix linux: Optimize fallback 32-bit clock_gettime 2020-01-03 11:22:07 -03:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
x86 Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
x86_64 Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00