benchtests: Add random() benchmark
commit0997c3d0c87433ac8c78043aaa9b6b7e91df2882
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Tue, 28 Nov 2023 13:33:56 +0000 (28 13:33 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Thu, 18 Apr 2024 13:30:21 +0000 (18 14:30 +0100)
tree323435b4d17f9f3b899a4d17e325d9f4bbc5c81e
parent05c3495296bc38c3c46117c45ee6e663581e3370
benchtests: Add random() benchmark

Add a simple benchmark to measure the overhead of internal libc locks in
the random() implementation on both single- and multi-threaded cases.
This relies on the implementation of random using internal locks to
access shared global data, and that the runtime uses multi-threaded
locking once a thread has been created (even after it finishes).

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
benchtests/Makefile
benchtests/bench-random-lock.c [new file with mode: 0644]