mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
benchtests: Restore the clock_gettime option
commit 7621e38bf3
Author: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Date: Tue Jan 29 17:43:45 2019 +0000
Add generic hp-timing support
removed the clock_gettime option. Restore the clock_gettime option for
some x86 CPUs on which value from RDTSC may not be incremented at a fixed
rate.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
parent
f607047668
commit
e52434a2e4
@ -132,11 +132,17 @@ endif
|
||||
|
||||
CPPFLAGS-nonlib += -DDURATION=$(BENCH_DURATION) -D_ISOMAC
|
||||
|
||||
# Use clock_gettime to measure performance of functions. The default is
|
||||
# to use the architecture-specific high precision timing instructions.
|
||||
ifdef USE_CLOCK_GETTIME
|
||||
CPPFLAGS-nonlib += -DUSE_CLOCK_GETTIME
|
||||
else
|
||||
# On x86 processors, use RDTSCP, instead of RDTSC, to measure performance
|
||||
# of functions. All x86 processors since 2010 support RDTSCP instruction.
|
||||
ifdef USE_RDTSCP
|
||||
CPPFLAGS-nonlib += -DUSE_RDTSCP
|
||||
endif
|
||||
endif
|
||||
|
||||
DETAILED_OPT :=
|
||||
|
||||
|
@ -27,7 +27,12 @@ BENCH_DURATION.
|
||||
|
||||
The benchmark suite does function call measurements using architecture-specific
|
||||
high precision timing instructions whenever available. When such support is
|
||||
not available, it uses clock_gettime (CLOCK_MONOTONIC).
|
||||
not available, it uses clock_gettime (CLOCK_MONOTONIC). One can force the
|
||||
benchmark to use clock_gettime by invoking make as follows:
|
||||
|
||||
$ make USE_CLOCK_GETTIME=1 bench
|
||||
|
||||
Again, one must run `make bench-clean' before changing the measurement method.
|
||||
|
||||
On x86 processors, RDTSCP instruction provides more precise timing data
|
||||
than RDTSC instruction. All x86 processors since 2010 support RDTSCP
|
||||
|
@ -18,7 +18,11 @@
|
||||
|
||||
#undef attribute_hidden
|
||||
#define attribute_hidden
|
||||
#include <hp-timing.h>
|
||||
#ifdef USE_CLOCK_GETTIME
|
||||
# include <sysdeps/generic/hp-timing.h>
|
||||
#else
|
||||
# include <hp-timing.h>
|
||||
#endif
|
||||
#include <stdint.h>
|
||||
|
||||
#define GL(x) _##x
|
||||
|
Loading…
Reference in New Issue
Block a user