diff options
author | Tzachi Zidenberg <tsahee@amazon.com> | 2020-07-06 13:43:30 +0300 |
---|---|---|
committer | Tzachi Zidenberg <tsahee@amazon.com> | 2020-07-23 15:07:13 +0300 |
commit | c76b45a5242f50d00c16f0bbf1dbecd4e359e02c (patch) | |
tree | 262571433ede080aa64d6c9d57dbc551d080549d /mysys | |
parent | 5f2628d1eea21d9732f582b77782b072e5e04014 (diff) | |
download | mariadb-git-c76b45a5242f50d00c16f0bbf1dbecd4e359e02c.tar.gz |
MDEV-23249: Support aarch64 architecture timer
aarch64 timer is available to userspace via arch register.
clang's __builtin_readcyclecounter is wrong for aarch64 (reads the PMU
cycle counter instead of the archi-timer register), so we don't use it.
my_rdtsc unit-test on AWS m6g shows:
frequency: 121830845
resolution: 1
overhead: 1
This counter is not strictly increasing, but it is non-decreasing.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_rdtsc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c index dce3ca2be3b..2d93239f7dd 100644 --- a/mysys/my_rdtsc.c +++ b/mysys/my_rdtsc.c @@ -362,6 +362,8 @@ void my_timer_init(MY_TIMER_INFO *mti) mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32; #elif defined(__GNUC__) && defined(__s390__) mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390; +#elif defined(__GNUC__) && defined (__aarch64__) + mti->cycles.routine= MY_TIMER_ROUTINE_AARCH64; #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME; #else |