29 #if defined(__GNUC__) && (__GNUC__ > 2)
35 #if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
40 #ifndef UT_DBG_USE_ABORT
60 fprintf(stderr,
" InnoDB: Assertion failure in file %s line %lu\n",
64 " InnoDB: Assertion failure in thread %lu"
65 " in file %s line %lu\n",
70 "InnoDB: Failing assertion: %s\n", expr);
73 fputs(
"InnoDB: We intentionally generate a memory trap.\n"
74 "InnoDB: Submit a detailed bug report"
75 " to http://bugs.mysql.com.\n"
76 "InnoDB: If you get repeated assertion failures"
78 "InnoDB: immediately after the mysqld startup, there may be\n"
79 "InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
80 "InnoDB: " REFMAN
"forcing-recovery.html\n"
81 "InnoDB: about forcing recovery.\n", stderr);
82 #if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
87 #if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
97 #ifndef UNIV_HOTBACKUP
98 fprintf(stderr,
"InnoDB: Thread %lu stopped in file %s line %lu\n",
105 #ifdef UNIV_COMPILE_TEST_FUNCS
107 #include <sys/types.h>
108 #include <sys/time.h>
109 #include <sys/resource.h>
114 #define timersub(a, b, r) \
116 (r)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
117 (r)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
118 if ((r)->tv_usec < 0) { \
120 (r)->tv_usec += 1000000; \
133 gettimeofday(&speedo->tv, NULL);
135 getrusage(RUSAGE_SELF, &speedo->ru);
145 const speedo_t* speedo)
147 struct rusage ru_now;
148 struct timeval tv_now;
149 struct timeval tv_diff;
151 getrusage(RUSAGE_SELF, &ru_now);
153 gettimeofday(&tv_now, NULL);
155 #define PRINT_TIMEVAL(prefix, tvp) \
156 fprintf(stderr, "%s% 5ld.%06ld sec\n", \
157 prefix, (tvp)->tv_sec, (tvp)->tv_usec)
159 timersub(&tv_now, &speedo->tv, &tv_diff);
160 PRINT_TIMEVAL(
"real", &tv_diff);
162 timersub(&ru_now.ru_utime, &speedo->ru.ru_utime, &tv_diff);
163 PRINT_TIMEVAL(
"user", &tv_diff);
165 timersub(&ru_now.ru_stime, &speedo->ru.ru_stime, &tv_diff);
166 PRINT_TIMEVAL(
"sys ", &tv_diff);