30 #if defined(__GNUC__) && (__GNUC__ > 2)
36 #if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
41 #ifndef UT_DBG_USE_ABORT
61 fprintf(stderr,
" InnoDB: Assertion failure in file %s line %lu\n",
65 " InnoDB: Assertion failure in thread %lu"
66 " in file %s line %lu\n",
72 "InnoDB: Failing assertion: %s\n", expr);
75 fputs(
"InnoDB: We intentionally generate a memory trap.\n"
76 "InnoDB: Submit a detailed bug report"
77 " to http://bugs.mysql.com.\n"
78 "InnoDB: If you get repeated assertion failures"
80 "InnoDB: immediately after the mysqld startup, there may be\n"
81 "InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
82 "InnoDB: " REFMAN
"forcing-innodb-recovery.html\n"
83 "InnoDB: about forcing recovery.\n", stderr);
84 #if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
89 #if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
99 #ifndef UNIV_HOTBACKUP
100 fprintf(stderr,
"InnoDB: Thread %lu stopped in file %s line %lu\n",
108 #ifdef UNIV_COMPILE_TEST_FUNCS
110 #include <sys/types.h>
111 #include <sys/time.h>
112 #include <sys/resource.h>
117 #define timersub(a, b, r) \
119 (r)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
120 (r)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
121 if ((r)->tv_usec < 0) { \
123 (r)->tv_usec += 1000000; \
136 gettimeofday(&speedo->tv, NULL);
138 getrusage(RUSAGE_SELF, &speedo->ru);
148 const speedo_t* speedo)
150 struct rusage ru_now;
151 struct timeval tv_now;
152 struct timeval tv_diff;
154 getrusage(RUSAGE_SELF, &ru_now);
156 gettimeofday(&tv_now, NULL);
158 #define PRINT_TIMEVAL(prefix, tvp) \
159 fprintf(stderr, "%s% 5ld.%06ld sec\n", \
160 prefix, (tvp)->tv_sec, (tvp)->tv_usec)
162 timersub(&tv_now, &speedo->tv, &tv_diff);
163 PRINT_TIMEVAL(
"real", &tv_diff);
165 timersub(&ru_now.ru_utime, &speedo->ru.ru_utime, &tv_diff);
166 PRINT_TIMEVAL(
"user", &tv_diff);
168 timersub(&ru_now.ru_stime, &speedo->ru.ru_stime, &tv_diff);
169 PRINT_TIMEVAL(
"sys ", &tv_diff);
ibool ut_dbg_stop_threads
UNIV_INTERN void ut_dbg_stop_thread(const char *file, ulint line)
const char * innobase_basename(const char *path_name)
UNIV_INTERN void os_thread_sleep(ulint tm)
UNIV_INTERN void ut_print_timestamp(FILE *file)
UNIV_INTERN os_thread_id_t os_thread_get_curr_id(void)
UNIV_INTERN void ut_dbg_assertion_failed(const char *expr, const char *file, ulint line)
UNIV_INTERN ulint os_thread_pf(os_thread_id_t a)