summaryrefslogtreecommitdiff
path: root/mysys/my_rdtsc.c
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-10-30 10:10:43 +0400
committerSergei Golubchik <serg@mariadb.org>2017-07-17 12:34:58 +0200
commitd023156782ce37f508c121437b8b3544fb03ef14 (patch)
tree4e272d03c421df759150c5158d36f79a1f975a22 /mysys/my_rdtsc.c
parent6efee2254110206a037bb726de00a4e734ae8453 (diff)
downloadmariadb-git-d023156782ce37f508c121437b8b3544fb03ef14.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/my_rdtsc.c')
-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)