~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/ut0dbg.h

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
/*****************************************************************
25
25
Report a failed assertion. */
26
 
 
 
26
UNIV_INTERN
27
27
void
28
28
ut_dbg_assertion_failed(
29
29
/*====================*/
31
31
        const char* file,       /* in: source file containing the assertion */
32
32
        ulint line);            /* in: line number of the assertion */
33
33
 
 
34
#ifdef __NETWARE__
 
35
/* Flag for ignoring further assertion failures.
 
36
On NetWare, have a graceful exit rather than a segfault to avoid abends. */
 
37
extern ibool    panic_shutdown;
 
38
/* Abort the execution. */
 
39
void ut_dbg_panic(void);
 
40
# define UT_DBG_PANIC ut_dbg_panic()
 
41
/* Stop threads in ut_a(). */
 
42
# define UT_DBG_STOP    while (0)       /* We do not do this on NetWare */
 
43
#else /* __NETWARE__ */
34
44
# if defined(__WIN__) || defined(__INTEL_COMPILER)
35
45
#  undef UT_DBG_USE_ABORT
36
46
# elif defined(__GNUC__) && (__GNUC__ > 2)
49
59
 
50
60
/*****************************************************************
51
61
Stop a thread after assertion failure. */
52
 
 
 
62
UNIV_INTERN
53
63
void
54
64
ut_dbg_stop_thread(
55
65
/*===============*/
61
71
/* Abort the execution. */
62
72
#  define UT_DBG_PANIC abort()
63
73
/* Stop threads (null operation) */
64
 
#  define UT_DBG_STOP while (0)
 
74
#  define UT_DBG_STOP while (0) {}
65
75
# else /* UT_DBG_USE_ABORT */
66
76
/* Abort the execution. */
67
77
#  define UT_DBG_PANIC                                  \
72
82
                ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
73
83
        } while (0)
74
84
# endif /* UT_DBG_USE_ABORT */
 
85
#endif /* __NETWARE__ */
75
86
 
76
87
/* Abort execution if EXPR does not evaluate to nonzero. */
77
88
#define ut_a(EXPR) do {                                         \
99
110
 
100
111
#define UT_NOT_USED(A)  A = A
101
112
 
 
113
#ifdef UNIV_COMPILE_TEST_FUNCS
 
114
 
 
115
#include <sys/types.h>
 
116
#include <sys/time.h>
 
117
#include <sys/resource.h>
 
118
 
 
119
/* structure used for recording usage statistics */
 
120
typedef struct speedo_struct {
 
121
        struct rusage   ru;
 
122
        struct timeval  tv;
 
123
} speedo_t;
 
124
 
 
125
/***********************************************************************
 
126
Resets a speedo (records the current time in it). */
 
127
UNIV_INTERN
 
128
void
 
129
speedo_reset(
 
130
/*=========*/
 
131
        speedo_t*       speedo);        /* out: speedo */
 
132
 
 
133
/***********************************************************************
 
134
Shows the time elapsed and usage statistics since the last reset of a
 
135
speedo. */
 
136
UNIV_INTERN
 
137
void
 
138
speedo_show(
 
139
/*========*/
 
140
        const speedo_t* speedo);        /* in: speedo */
 
141
 
 
142
#endif /* UNIV_COMPILE_TEST_FUNCS */
 
143
 
102
144
#endif