Skip to content

Commit a1ea0ca

Browse files
chleroympe
authored andcommitted
powerpc/selftests: Use gettid() instead of getppid() for null_syscall
gettid() is 10% lighter than getppid(), use it for null_syscall selftest. Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/0ad62673d3e063f848e7c99d719bb966efd433e8.1622809833.git.christophe.leroy@csgroup.eu
1 parent e2c0431 commit a1ea0ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/powerpc/benchmarks/null_syscall.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <time.h>
1515
#include <sys/types.h>
1616
#include <sys/time.h>
17+
#include <sys/syscall.h>
1718
#include <signal.h>
1819

1920
static volatile int soak_done;
@@ -121,7 +122,7 @@ static void do_null_syscall(unsigned long nr)
121122
unsigned long i;
122123

123124
for (i = 0; i < nr; i++)
124-
getppid();
125+
syscall(__NR_gettid);
125126
}
126127

127128
#define TIME(A, STR) \

0 commit comments

Comments
 (0)