summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-10-30 10:10:43 +0400
committerAlexander Barkov <bar@mariadb.org>2015-10-30 10:10:43 +0400
commit59dd58b17eb79bd2daa0c72a86cd4b3b14bae4cc (patch)
tree490971d76b781de265161a05e2c521fd65db8c59 /mysys
parent56f04e0dfd0835b207a86729d2f73a8502f71bb0 (diff)
downloadmariadb-git-59dd58b17eb79bd2daa0c72a86cd4b3b14bae4cc.tar.gz
MDEV-8692 prefschema test failures on ARM (on Debian build system)
A few tests assumes that the CYCLE timer is always available, which is not true on some platforms (e.g. ARM). Fixing the tests not to reply on the CYCLE availability.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_rdtsc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c
index 028c7f810d4..ad11e8c6a6c 100644
--- a/mysys/my_rdtsc.c
+++ b/mysys/my_rdtsc.c
@@ -129,6 +129,31 @@ ulonglong my_timer_cycles_il_x86_64();
clock_gettime(CLOCK_SGI_CYCLE) for Irix platforms,
or on read_real_time for aix platforms. There is
nothing for Alpha platforms, they would be tricky.
+
+ On the platforms that do not have a CYCLE timer,
+ "wait" events are initialized to use NANOSECOND instead of CYCLE
+ during performance_schema initialization (at the server startup).
+
+ Linux performance monitor (see "man perf_event_open") can
+ provide cycle counter on the platforms that do not have
+ other kinds of cycle counters. But we don't use it so far.
+
+ ARM notes
+ ---------
+ During tests on ARMv7 Debian, perf_even_open() based cycle counter provided
+ too low frequency with too high overhead:
+ MariaDB [performance_schema]> SELECT * FROM performance_timers;
+ +-------------+-----------------+------------------+----------------+
+ | TIMER_NAME | TIMER_FREQUENCY | TIMER_RESOLUTION | TIMER_OVERHEAD |
+ +-------------+-----------------+------------------+----------------+
+ | CYCLE | 689368159 | 1 | 970 |
+ | NANOSECOND | 1000000000 | 1 | 308 |
+ | MICROSECOND | 1000000 | 1 | 417 |
+ | MILLISECOND | 1000 | 1000 | 407 |
+ | TICK | 127 | 1 | 612 |
+ +-------------+-----------------+------------------+----------------+
+ Therefore, it was decided not to use perf_even_open() on ARM
+ (i.e. go without CYCLE and have "wait" events use NANOSECOND by default).
*/
ulonglong my_timer_cycles(void)