1 Star 0 Fork 21

huanghaitao/mysql5

forked from src-openEuler/mysql5 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mysql5-s390-tsc.patch 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
huanghaitao 提交于 2020-10-23 16:05 . package init
Support s390/s390x in performance schema's cycle-counting functions.
Filed upstream at http://bugs.mysql.com/bug.php?id=59953
diff -up --recursive mysql-5.7.9.orig/include/my_rdtsc.h mysql-5.7.9/include/my_rdtsc.h
--- mysql-5.7.9.orig/include/my_rdtsc.h 2015-10-12 08:21:33.000000000 +0200
+++ mysql-5.7.9/include/my_rdtsc.h 2015-11-10 16:33:36.037432669 +0100
@@ -125,6 +125,7 @@ C_MODE_END
#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
#define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27
#define MY_TIMER_ROUTINE_ASM_AARCH64 28
+#define MY_TIMER_ROUTINE_ASM_S390 29
#endif
diff -up --recursive mysql-5.7.9.orig/mysys/my_rdtsc.c mysql-5.7.9/mysys/my_rdtsc.c
--- mysql-5.7.9.orig/mysys/my_rdtsc.c 2015-10-12 08:21:33.000000000 +0200
+++ mysql-5.7.9/mysys/my_rdtsc.c 2015-11-10 16:33:36.038432668 +0100
@@ -183,6 +183,13 @@ ulonglong my_timer_cycles(void)
__asm __volatile__ ("mrs %[rt],cntvct_el0" : [rt] "=r" (result));
return result;
}
+#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();
@@ -487,6 +494,8 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
#elif defined(__GNUC__) && defined(__aarch64__)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_AARCH64;
+#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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hht8/mysql5.git
[email protected]:hht8/mysql5.git
hht8
mysql5
mysql5
master

搜索帮助