[mysql] Support s390/s390x in performance schema's cycle-counting functions

Tom Lane tgl at fedoraproject.org
Fri Feb 4 17:53:10 UTC 2011


commit edda00527cc8dce12eb7e01f2b0b8fecd4c6d1d1
Author: Tom Lane <tgl at redhat.com>
Date:   Fri Feb 4 12:52:14 2011 -0500

    Support s390/s390x in performance schema's cycle-counting functions

 mysql-s390-tsc.patch |   41 +++++++++++++++++++++++++++++++++++++++++
 mysql.spec           |    8 +++++++-
 2 files changed, 48 insertions(+), 1 deletions(-)
---
diff --git a/mysql-s390-tsc.patch b/mysql-s390-tsc.patch
new file mode 100644
index 0000000..00811a4
--- /dev/null
+++ b/mysql-s390-tsc.patch
@@ -0,0 +1,41 @@
+Support s390/s390x in performance schema's cycle-counting functions.
+Filed upstream at http://bugs.mysql.com/bug.php?id=59953
+
+
+diff -Naur mysql-5.5.8.orig/include/my_rdtsc.h mysql-5.5.8/include/my_rdtsc.h
+--- mysql-5.5.8.orig/include/my_rdtsc.h	2010-12-03 12:58:24.000000000 -0500
++++ mysql-5.5.8/include/my_rdtsc.h	2011-02-04 11:16:45.431459913 -0500
+@@ -124,6 +124,7 @@
+ #define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME      25
+ #define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
+ #define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64       27
++#define MY_TIMER_ROUTINE_ASM_S390                28
+ 
+ #endif
+ 
+diff -Naur mysql-5.5.8.orig/mysys/my_rdtsc.c mysql-5.5.8/mysys/my_rdtsc.c
+--- mysql-5.5.8.orig/mysys/my_rdtsc.c	2010-12-03 12:58:26.000000000 -0500
++++ mysql-5.5.8/mysys/my_rdtsc.c	2011-02-04 11:16:45.432465577 -0500
+@@ -224,6 +224,13 @@
+     clock_gettime(CLOCK_SGI_CYCLE, &tp);
+     return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec;
+   }
++#elif defined(__GNUC__) && defined(__s390__)
++  /* covers both s390 and s390x */
++  {
++    ulonglong result;
++    __asm__ __volatile__ ("stck %0" : "=Q" (result) : : "cc");
++    return result;
++  }
+ #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
+   /* gethrtime may appear as either cycle or nanosecond counter */
+   return (ulonglong) gethrtime();
+@@ -533,6 +540,8 @@
+   mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
+ #elif defined(__sgi) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE)
+   mti->cycles.routine= MY_TIMER_ROUTINE_SGI_CYCLE;
++#elif defined(__GNUC__) && defined(__s390__)
++  mti->cycles.routine= MY_TIMER_ROUTINE_ASM_S390;
+ #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
+   mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME;
+ #else
diff --git a/mysql.spec b/mysql.spec
index d533a4a..fa538d7 100644
--- a/mysql.spec
+++ b/mysql.spec
@@ -1,6 +1,6 @@
 Name: mysql
 Version: 5.5.8
-Release: 8%{?dist}
+Release: 9%{?dist}
 Summary: MySQL client programs and shared libraries
 Group: Applications/Databases
 URL: http://www.mysql.com
@@ -43,6 +43,7 @@ Patch9: mysql-disable-test.patch
 Patch10: mysql-embedded-crash.patch
 Patch11: mysql-home.patch
 Patch12: mysql-plugin-bool.patch
+Patch13: mysql-s390-tsc.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: gperf, perl, readline-devel, openssl-devel
@@ -184,6 +185,7 @@ the MySQL sources.
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13 -p1
 
 # workaround for upstream bug #56342
 rm -f mysql-test/t/ssl_8k_key-master.opt
@@ -602,6 +604,10 @@ fi
 %{_mandir}/man1/mysql_client_test.1*
 
 %changelog
+* Fri Feb  4 2011 Tom Lane <tgl at redhat.com> 5.5.8-9
+- Support s390/s390x in performance schema's cycle-counting functions
+  (needed to make regression tests pass on these platforms)
+
 * Thu Feb  3 2011 Tom Lane <tgl at redhat.com> 5.5.8-8
 - PPC64 floating-point differences are not masked by -ffloat-store after all,
   so let's just disable gis regression test till upstream makes it less picky


More information about the scm-commits mailing list