Motr
M0
|
Data Structures | |
struct | m0_panic_ctx |
Macros | |
#define | M0_ASSERT_OFF (0) |
#define | M0_ASSERT_EX_ON (0) |
#define | likely(x) __builtin_expect(!!(x), 1) |
#define | unlikely(x) __builtin_expect(!!(x), 0) |
#define | _0C(exp) |
Enumerations | |
enum | { BACKTRACE_DEPTH_MAX = 256 } |
Functions | |
void | m0_panic (const struct m0_panic_ctx *ctx,...) |
M0_INTERNAL void | m0_panic_only (const struct m0_panic_ctx *ctx,...) |
void | m0_backtrace (void) |
M0_INTERNAL void | m0__assertion_hook (void) |
M0_INTERNAL void | m0_arch_panic (const struct m0_panic_ctx *ctx, va_list ap) __attribute__((noreturn)) |
M0_INTERNAL void | m0_arch_backtrace (void) |
__attribute__ ((format(printf, 1, 2))) static inline void printf_check(const char *fmt | |
M0_INTERNAL void | m0_debugger_invoke (void) |
Variables | |
static int | m0_panic_delay_msec = 110 |
M0_EXTERN char * | m0_debugger_args [4] |
User space m0_arch_panic() implementation.
#define _0C | ( | exp | ) |
A macro to remember failed invariant conjunct.
This macro is used like the following:
If during invocation of foo_invariant() one of invariant conjuncts evaluates to false, the string representing this conjunct is stored in m0_failed_condition and printed by m0_panic(). This simplifies debugging.
__attribute__ | ( | (format(printf, 1, 2)) | ) | const |
Check printf format string against parameters.
This function does nothing except checking that the format string matches the rest of arguments and producing a compilation warning in case it doesn't. It is handy in macros which accept printf-like parameters with a format string.
For example usage, refer to M0_TRACE_POINT() macro
M0_INTERNAL void m0__assertion_hook | ( | void | ) |
void m0_arch_backtrace | ( | void | ) |
M0_INTERNAL void m0_arch_panic | ( | const struct m0_panic_ctx * | c, |
va_list | ap | ||
) |
Simple user space panic function: issue diagnostics to the stderr, flush the stream, optionally print the backtrace and abort(3) the program.
Stack back-trace printing uses GNU extensions to the libc, declared in <execinfo.h> header (checked for by ./configure). Object files should be compiled with -rdynamic for this to work in the presence of dynamic linking.
Definition at line 45 of file kassert.c.
void m0_backtrace | ( | void | ) |
M0_INTERNAL void m0_debugger_invoke | ( | void | ) |
void m0_panic | ( | const struct m0_panic_ctx * | ctx, |
... | |||
) |
Panic function.
Display panic message and abort program execution.
ctx | panic context |
... | arguments for printf format string m0_panic_ctx::pc_fmt |
Definition at line 40 of file assert.c.
M0_INTERNAL void m0_panic_only | ( | const struct m0_panic_ctx * | ctx, |
... | |||
) |
Abort program execution.
This function is similar to m0_panic(), but doesn't call M0_LOG() nor checks for a double panic. Therefore, it can be called on early stages of initialisation.
Definition at line 63 of file assert.c.