byte-unixbench/UnixBench/src
Yuanhong Peng 3d069b2e9c Directly call syscall(SYS_getpid) instead of getpid() in syscall test
According to http://man7.org/linux/man-pages/man2/getpid.2.html:

> From glibc version 2.3.4 up to and including version 2.24, the glibc
wrapper function for getpid() cached PIDs, with the goal of avoiding
additional system calls when a process calls getpid() repeatedly.

So it's not suitable to messure the system call performance through
getpid(). Directly call syscall(SYS_getpid) is more appropriate.

From glibc version 2.25, cached pid is removed to fix some bugs which
makes the testsuite wrongly report performance regression on system call.

Same issue is reported to unixbench upstream long time ago, but nobody
cares. https://github.com/kdlucas/byte-unixbench/pull/58

Signed-off-by: Yuanhong Peng <yummypeng@linux.alibaba.com>

github: closes #58
2022-02-24 01:28:31 -05:00
..
arith.c arith: use volatile to attempt to thwart optimizer 2016-09-17 20:09:01 -04:00
big.c remove declarations which dup from system headers 2016-03-24 15:48:16 -04:00
context1.c Fix Result Report Race Condition in Pipe-based Context Switching Test (#42) 2016-10-07 00:56:46 -04:00
dhry_1.c remove declarations which dup from system headers 2016-03-24 15:48:16 -04:00
dhry_2.c Version 5.1.2. 2009-10-28 01:52:39 +00:00
dhry.h Version 5.1.2. 2009-10-28 01:52:39 +00:00
dummy.c Version 5.1.2. 2009-10-28 01:52:39 +00:00
execl.c Version 5.1.2. 2009-10-28 01:52:39 +00:00
fstime.c remove declarations which dup from system headers 2016-03-24 15:48:16 -04:00
hanoi.c Version 5.1.2. 2009-10-28 01:52:39 +00:00
looper.c Version 5.1.2. 2009-10-28 01:52:39 +00:00
pipe.c Version 5.1.2. 2009-10-28 01:52:39 +00:00
spawn.c Version 5.1.2. 2009-10-28 01:52:39 +00:00
syscall.c Directly call syscall(SYS_getpid) instead of getpid() in syscall test 2022-02-24 01:28:31 -05:00
time-polling.c remove declarations which dup from system headers 2016-03-24 15:48:16 -04:00
timeit.c Version 5.1.2. 2009-10-28 01:52:39 +00:00
ubgears.c Version 5.1.2. 2009-10-28 01:52:39 +00:00
whets.c Version 5.1.2. 2009-10-28 01:52:39 +00:00