bionic/benchmarks
Elliott Hughes 7086ad6919 Cache getpid.
In practice, with this implementation we never need to make a system call.
We get the main thread's tid (which is the same as our pid) back from
the set_tid_address system call we have to make during initialization.
A new pthread will have the same pid as its parent, and a fork child's
main (and only) thread will have a pid equal to its tid, which we get for
free from the kernel before clone returns.

The only time we'd actually have to make a getpid system call now is if
we take a signal during fork and the signal handler calls getpid. (That,
or we call getpid in the dynamic linker while it's still dealing with its
own relocations and hasn't even set up the main thread yet.)

Bug: 15387103
Change-Id: I6d4718ed0a5c912fc75b5f738c49a023dbed5189
2014-06-20 09:06:57 -07:00
..
Android.mk Turn on -Wunused and fix the mistakes it uncovers. 2014-06-03 15:22:34 -07:00
benchmark_main.cpp Fix GCC 4.9 complaint about int/size_t mismatch. 2014-06-12 12:52:58 -07:00
benchmark.h bionic: move benchmarks out of tests directory 2013-12-10 18:24:30 -08:00
math_benchmark.cpp AArch64: libm: Fix ARM64 fenv_t and refactor ARM64 libm implementation. 2014-06-09 13:52:28 -07:00
property_benchmark.cpp Modify hard-coded directory. 2014-05-01 13:10:48 -07:00
pthread_benchmark.cpp Add __pure2 to a few more functions, most notably gettid and pthread_self. 2014-06-11 16:32:10 -07:00
semaphore_benchmark.cpp Add various benchmarks. 2014-03-11 11:20:52 -07:00
stdio_benchmark.cpp Add various benchmarks. 2014-03-11 11:20:52 -07:00
string_benchmark.cpp bionic: move benchmarks out of tests directory 2013-12-10 18:24:30 -08:00
time_benchmark.cpp Add a couple more system call benchmarks. 2014-06-09 18:35:21 -07:00
unistd_benchmark.cpp Cache getpid. 2014-06-20 09:06:57 -07:00