|
#define | M0_TRACE_SUBSYS(name, value) [value] = #name, |
|
#define | NULL_STRING_STUB "(null)" |
|
#define | M0_LOG(level, ...) M0_CAT(M0_LOG, M0_COUNT_PARAMS(__VA_ARGS__))(level, __VA_ARGS__) |
|
#define | M0_ENTRY(...) M0_LOG(M0_CALL, "> " __VA_ARGS__) |
|
#define | M0_LEAVE(...) M0_LOG(M0_CALL, "< " __VA_ARGS__) |
|
#define | M0_RC_HOOK (0) |
|
#define | M0_RC(rc) |
|
#define | M0_ERR(rc) |
|
#define | M0_RC_INFO(rc, fmt, ...) |
|
#define | M0_ERR_INFO(rc, fmt, ...) |
|
#define | M0_TRACE_SUBSYSTEMS |
|
#define | M0_TRACE_SUBSYS(name, value) M0_TRACE_SUBSYS_ ## name = (1UL << value), |
|
#define | M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT, ...) |
|
#define | M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_OTHER |
|
#define | LOG_TYPEOF(a, v) typeof(a) v |
|
#define | LOG_OFFSETOF(v) offsetof(struct t_body, v) |
|
#define | LOG_SIZEOF(a) sizeof(a) |
|
#define | LOG_IS_STR_ARG(a) |
|
#define | LOG_CHECK(a) |
|
#define | LOG_GROUP(...) __VA_ARGS__ |
|
#define | M0_LOG0(level, fmt) M0_TRACE_POINT(level, 0, { ; }, {}, {}, {}, false, fmt) |
|
#define | M0_LOG1(level, fmt, a0) |
|
#define | M0_LOG2(level, fmt, a0, a1) |
|
#define | M0_LOG3(level, fmt, a0, a1, a2) |
|
#define | M0_LOG4(level, fmt, a0, a1, a2, a3) |
|
#define | M0_LOG5(level, fmt, a0, a1, a2, a3, a4) |
|
#define | M0_LOG6(level, fmt, a0, a1, a2, a3, a4, a5) |
|
#define | M0_LOG7(level, fmt, a0, a1, a2, a3, a4, a5, a6) |
|
#define | M0_LOG8(level, fmt, a0, a1, a2, a3, a4, a5, a6, a7) |
|
#define | M0_LOG9(level, fmt, a0, a1, a2, a3, a4, a5, a6, a7, a8) |
|
#define | DEFAULT_IN_FILE_NAME "/sys/kernel/debug/motr/trace/buffer" |
|
#define | DEFAULT_OUT_FILE_NAME "/var/log/motr/m0trace.bin" |
|
#define | MOTR_KO_CORE_IN_FILE_NAME "/sys/kernel/debug/motr/core" |
|
#define | MOTR_KO_CORE_OUT_FILE_NAME "/var/log/motr/m0tr_ko.img" |
|
#define | log_err(fmt, ...) plog(LOG_ERR, fmt, ## __VA_ARGS__) |
|
#define | log_warn(fmt, ...) plog(LOG_WARNING, fmt, ## __VA_ARGS__) |
|
#define | log_info(fmt, ...) plog(LOG_INFO, fmt, ## __VA_ARGS__) |
|
#define | log_debug(fmt, ...) plog(LOG_DEBUG, fmt, ## __VA_ARGS__) |
|
|
enum | { BOOTLOG_BUF_SIZE = (1 << 16)
} |
|
enum | m0_trace_subsystem { M0_TRACE_SUBSYSTEMS
} |
|
enum | { M0_TRACE_BUF_HEADER_SIZE = (1 << 16),
M0_TRACE_REC_ALIGN = 8
} |
|
enum | m0_trace_buf_type { M0_TRACE_BUF_KERNEL = 1,
M0_TRACE_BUF_USER = 2
} |
|
enum | m0_trace_buf_flags { M0_TRACE_BUF_MKFS = 1 << 0,
M0_TRACE_BUF_DIRTY = 1 << 1,
M0_TRACE_BUF_FLAGS_MAX
} |
|
enum | m0_trace_level {
M0_NONE = 0,
M0_ALWAYS = 1 << 0,
M0_FATAL = 1 << 1,
M0_ERROR = 1 << 2,
M0_WARN = 1 << 3,
M0_NOTICE = 1 << 4,
M0_INFO = 1 << 5,
M0_DEBUG = 1 << 6,
M0_CALL = 1 << 7
} |
|
enum | m0_trace_print_context {
M0_TRACE_PCTX_NONE = 0,
M0_TRACE_PCTX_FUNC = 1,
M0_TRACE_PCTX_SHORT = 2,
M0_TRACE_PCTX_FULL = 3,
M0_TRACE_PCTX_INVALID
} |
|
enum | { M0_TRACE_ARGC_MAX = 9
} |
|
enum | { MAGIC_SYM_OFFSETS_MAX
} |
|
enum | lr_action { LR_ROTATE,
LR_STOP
} |
|
enum | { MAX_LOG_NAMES = 1024
} |
|
|
| module_param (trace_immediate_mask, charp, S_IRUGO) |
|
| MODULE_PARM_DESC (trace_immediate_mask, " a bitmask or comma separated list of subsystem names" " of what should be printed immediately to console") |
|
| module_param (trace_level, charp, S_IRUGO) |
|
| MODULE_PARM_DESC (trace_level, " trace level: level[+][,level[+]] where level is one of" " call|debug|info|notice|warn|error|fatal") |
|
| module_param (trace_print_context, charp, S_IRUGO) |
|
| MODULE_PARM_DESC (trace_print_context, " controls whether to display additional trace point" " info, like subsystem, file, func, etc.; values:" " none, func, short, full") |
|
| module_param (trace_buf_size, ulong, S_IRUGO) |
|
| MODULE_PARM_DESC (trace_buf_size, "size of trace buffer in bytes") |
|
M0_INTERNAL const char * | m0_trace_file_path_get (void) |
|
M0_INTERNAL int | m0_trace_set_immediate_mask (const char *mask_str) |
|
M0_INTERNAL const struct m0_trace_stats * | m0_trace_get_stats (void) |
|
M0_INTERNAL void | m0_trace_stats_update (uint32_t rec_size) |
|
void | m0_console_vprintf (const char *fmt, va_list args) |
|
void | m0_console_flush (void) |
|
void | m0_error_printf (const char *fmt,...) |
|
M0_INTERNAL int | m0_arch_trace_init () |
|
M0_INTERNAL void | m0_arch_trace_fini (void) |
|
M0_INTERNAL void | m0_arch_trace_buf_header_init (struct m0_trace_buf_header *tbh) |
|
| M0_BASSERT (bootlog.bl_buf==bootlog.bl_area.ta_buf) |
|
| M0_BASSERT (((sizeof bootlog.bl_buf) &((sizeof bootlog.bl_buf) - 1))==0) |
|
| M0_BASSERT (sizeof(m0_trace_immediate_mask)==8) |
|
M0_INTERNAL int | m0_trace_init (void) |
|
M0_INTERNAL void | m0_trace_fini (void) |
|
static uint64_t | m0_rdtsc (void) |
|
static uint32_t | calc_string_data_size (const struct m0_trace_descr *td, const void *body) |
|
static void | copy_string_data (char *dst_str, const char *body, const struct m0_trace_descr *td) |
|
M0_INTERNAL void | m0_trace_level_allow (unsigned level) |
|
M0_INTERNAL void | m0_trace_allot (const struct m0_trace_descr *td, const void *body) |
|
M0_INTERNAL const char * | m0_trace_subsys_name (uint64_t subsys) |
|
static char * | subsys_str (uint64_t subsys, char *buf) |
|
static char * | uppercase (char *s) |
|
static char * | lowercase (char *s) |
|
static unsigned long | subsys_name_to_mask (char *subsys_name) |
|
M0_INTERNAL int | m0_trace_subsys_list_to_mask (char *subsys_names, unsigned long *ret_mask) |
|
M0_INTERNAL const char * | m0_trace_level_name (enum m0_trace_level level) |
|
static enum m0_trace_level | trace_level_value (char *level_name) |
|
static enum m0_trace_level | trace_level_value_plus (char *level_name) |
|
M0_INTERNAL enum m0_trace_level | m0_trace_level_parse (char *str) |
|
M0_INTERNAL enum m0_trace_print_context | m0_trace_print_context_parse (const char *ctx_name) |
|
M0_INTERNAL int | m0_trace_set_print_context (const char *ctx_name) |
|
M0_INTERNAL int | m0_trace_set_level (const char *level_str) |
|
M0_INTERNAL const struct m0_trace_buf_header * | m0_trace_logbuf_header_get (void) |
|
M0_INTERNAL const void * | m0_trace_logbuf_get (void) |
|
M0_INTERNAL uint32_t | m0_trace_logbuf_size_get (void) |
|
M0_INTERNAL void | m0_trace_logbuf_size_set (size_t size) |
|
M0_INTERNAL uint64_t | m0_trace_logbuf_pos_get (void) |
|
M0_INTERNAL const void * | m0_trace_magic_sym_addr_get (void) |
|
M0_INTERNAL const char * | m0_trace_magic_sym_name_get (void) |
|
int | m0_trace_magic_sym_extra_addr_add (const void *addr) |
|
M0_INTERNAL void | m0_trace_print_subsystems (void) |
|
M0_INTERNAL int | m0_trace_args_unpack (const struct m0_trace_rec_header *trh, m0_trace_rec_args_t args, const void *buf) |
|
M0_INTERNAL void | m0_trace_record_print (const struct m0_trace_rec_header *trh, const void *buf) |
|
void | m0_console_printf (const char *fmt,...) |
|
static int | format_yaml_str (char *str, size_t max_size, size_t align_size) |
|
M0_INTERNAL int | m0_trace_record_print_yaml (char *outbuf, size_t outbuf_size, const struct m0_trace_rec_header *trh, const void *tr_body, bool yaml_stream_mode) |
|
M0_INTERNAL const struct m0_trace_rec_header * | m0_trace_last_record_get (void) |
|
M0_INTERNAL void | m0_trace_buf_header_init (struct m0_trace_buf_header *tbh, size_t buf_size) |
|
M0_INTERNAL void | m0_trace_switch_to_static_logbuf (void) |
|
static void | m0_rc_hook (int rc) |
|
static void | m0_err_hook (int rc) |
|
| M0_BASSERT (M0_TRACE_BUF_FLAGS_MAX< UINT16_MAX) |
|
| M0_BASSERT (sizeof(struct m0_trace_buf_header)==M0_TRACE_BUF_HEADER_SIZE) |
|
| __attribute__ ((format(printf, 1, 2))) void m0_console_printf(const char *fmt |
|
static int | logbuf_map () |
|
M0_INTERNAL void | m0_trace_set_mmapped_buffer (bool val) |
|
M0_INTERNAL bool | m0_trace_use_mmapped_buffer (void) |
|
int | m0_trace_set_buffer_size (size_t size) |
|
static int | set_trace_dir (const char *path) |
|
static unsigned | align (FILE *file, uint64_t align, uint64_t pos) |
|
static const struct m0_trace_buf_header * | read_trace_buf_header (FILE *trace_file) |
|
static void | print_trace_buf_header (FILE *ofile, const struct m0_trace_buf_header *tbh) |
|
static int | mmap_m0tr_ko (const char *m0tr_ko_path, void **ko_addr) |
|
static int | calc_trace_descr_offset (const struct m0_trace_buf_header *tbh, const char *m0tr_ko_path, ptrdiff_t *td_offset) |
|
static int | calc_extra_trace_descr_offsets (const struct m0_trace_buf_header *tbh, const void *magic_symbols[], size_t nr, ptrdiff_t td_offsets[]) |
|
static void | patch_trace_descr (struct m0_trace_descr *td, ptrdiff_t offset) |
|
M0_INTERNAL int | m0_trace_parse (FILE *trace_file, FILE *output_file, const char *m0tr_ko_path, enum m0_trace_parse_flags flags, const void *magic_symbols[], unsigned int magic_symbols_nr) |
|
static void | plog (int level, const char *format,...) __attribute__((format(printf |
|
void | sig_term_quit_int_handler (int signum, siginfo_t *siginfo, void *uctx) |
|
static const struct m0_trace_buf_header * | read_trace_buf_header (int ifd) |
|
static int | write_trace_header (const struct m0_trace_buf_header *header, int *ofd, const char *ofname) |
|
static int | write_trace_data (int *fd_ptr, const void *buf, size_t size) |
|
static const char * | get_cur_pos (const struct m0_trace_buf_header *logheader, const char *logbuf) |
|
static bool | is_log_rotation_needed (int *fd_ptr) |
|
static void | wake_up_rotator_thread (enum lr_action a) |
|
static int | rotate_original_log (struct rotator_ctx *rctx) |
|
static void | log_rotator_thread (struct rotator_ctx *rctx) |
|
static int | process_trace_buffer (int *ofd_ptr, const struct m0_trace_buf_header *logheader, const char *logbuf) |
|
static int | init_log_names (void) |
|
int | save_kore_file (void) |
|
int | main (int argc, char *argv[]) |
|
See doc/logging-and-tracing.
Fast and light-weight tracing facility
The purpose of tracing module is to provide an interface usable for the following purposes:
- temporary tracing to investigate and hunt down bugs and
- always-on tracing used to postmortem analysis of a Motr
installation.
Always-on mode must be non-intrusive and light-weight, otherwise users would tend to disable it. On the other hand, the interface should be convenient to use (i.e., to place trace points and to analyze a trace) otherwise programmers would tend to ignore it. These conflicting requirements lead to a implementation subtler than one might expect.
Specifically, the tracing module should conform to the following requirements:
- minimal synchronization between threads;
- minimal amount of data-copying and, more generally, minimal processor
cost of producing a trace record;
- minimal instruction cache foot-print of tracing calls;
- printf-like interface.
Usage
Users produce trace records by calling M0_LOG() macro like
These records are placed in a shared cyclic buffer. The buffer can be "parsed", producing for each record formatted output together with additional information:
- file, line and function (__FILE__, __LINE__ and __func__) for M0_LOG()
call,
- processor-dependent time-stamp.
Parsing occurs in the following situations:
- synchronously when a record is produced, or
- asynchronously by a background thread, or
- after the process (including a kernel) that generated records
crashed. To this end the cyclic buffer is backed up by a memory mapped
file (only for user space processes).
Implementation
To minimize processor cost of tracing, the implementation avoids run-time interpretation of format string. Instead a static (in C language sense) record descriptor (m0_trace_descr) is created, which contains all the static information about the trace point: file, line, function, format string. The record, placed in the cyclic buffer, contains only time-stamp, arguments (foo->f_val, i in the example above) and the pointer to the descriptor. Substitution of arguments into the format string happens during record parsing. This approach poses two problems:
- how to copy arguments (which are variable in number and size) to the
cyclic buffer and
- how to estimate the number of bytes that have to be allocated in the
buffer for this copying.
Both problems are solved by means of ugly preprocessor tricks and gcc extensions. For a list of arguments A0, A1, ..., An, one of M0_LOG{n}() macros defines a C type declaration
struct t_body { typeof(A0) v0; typeof(A1) v1; ... typeof(An) vn; };
This declaration is used to
- find how much space in the cyclic buffer is needed to store the
arguments: sizeof(struct t_body);
- to copy all the arguments into allocated space:
*(struct t_body *)space = (struct t_body){ A0, ..., An }
This uses C99 struct literal syntax.
In addition, M0_LOG{n}() macro produces 2 integer arrays:
{ sizeof(a0), ..., sizeof(an) };
These arrays are used during parsing to extract the arguments from the buffer.
User-space specific declarations.
Tracing facilities kernel specific stuff
Tracing facilities implementation.
Trace entries are placed in a largish buffer backed up by a memory mapped file. Buffer space allocation is controlled by a single atomic variable (m0_trace_buf_header::tbh_cur_pos).
Trace entries contain pointers from the process address space. To interpret them, m0_trace_parse() must be called in the same binary. See utils/ut_main.c for example.
- Note
- things like address space layout randomization might break this implementation.
User-space m0_trace_parse() implementation.
◆ DEFAULT_IN_FILE_NAME
#define DEFAULT_IN_FILE_NAME "/sys/kernel/debug/motr/trace/buffer" |
◆ DEFAULT_OUT_FILE_NAME
#define DEFAULT_OUT_FILE_NAME "/var/log/motr/m0trace.bin" |
◆ LOG_CHECK
Value: (sizeof(a) == 1 || sizeof(a) == 2 || sizeof(a) == 4 || \
sizeof(a) == 8))
#define M0_HAS_TYPE(expr, type)
Definition at line 618 of file trace.h.
◆ log_debug
◆ log_err
#define log_err |
( |
|
fmt, |
|
|
|
... |
|
) |
| plog(LOG_ERR, fmt, ## __VA_ARGS__) |
◆ LOG_GROUP
#define LOG_GROUP |
( |
|
... | ) |
__VA_ARGS__ |
◆ log_info
◆ LOG_IS_STR_ARG
#define LOG_IS_STR_ARG |
( |
|
a | ) |
|
Value: M0_HAS_TYPE((a), const char*) ?: \
M0_HAS_TYPE((a), char[]) ?: \
M0_HAS_TYPE((a), const char[]) ?: false
#define M0_HAS_TYPE(expr, type)
Definition at line 611 of file trace.h.
◆ LOG_OFFSETOF
#define LOG_OFFSETOF |
( |
|
v | ) |
offsetof(struct t_body, v) |
◆ LOG_SIZEOF
#define LOG_SIZEOF |
( |
|
a | ) |
sizeof(a) |
◆ LOG_TYPEOF
#define LOG_TYPEOF |
( |
|
a, |
|
|
|
v |
|
) |
| typeof(a) v |
◆ log_warn
#define log_warn |
( |
|
fmt, |
|
|
|
... |
|
) |
| plog(LOG_WARNING, fmt, ## __VA_ARGS__) |
◆ M0_ENTRY
◆ M0_ERR
Value:({ \
typeof(
rc) __rc = (
rc); \
M0_ASSERT(__rc != 0); \
m0_err_hook(__rc); \
__rc; \
})
Definition at line 201 of file trace.h.
◆ M0_ERR_INFO
#define M0_ERR_INFO |
( |
|
rc, |
|
|
|
fmt, |
|
|
|
... |
|
) |
| |
Value:({ \
typeof(
rc) __rc = (
rc); \
M0_ASSERT(__rc != 0); \
M0_LOG(
M0_ERROR,
"<! rc=%d " fmt, __rc, ## __VA_ARGS__ ); \
__rc; \
})
char * fmt(const char *format,...) __attribute__((format(printf
Definition at line 215 of file trace.h.
◆ M0_LEAVE
◆ M0_LOG
M0_LOG(level, fmt, ...) is the main user interface for the tracing. It accepts the arguments in printf(3) format for the numbers, but there are some tricks for string arguments.
String arguments should be specified like this:
i.e. explicitly typecast to the pointer. It is because typeof("foo") is not the same as typeof((char*)"foo").
- Note
- The number of arguments after fmt is limited to 9
M0_LOG() counts the number of arguments and calls correspondent M0_LOGx().
Definition at line 167 of file trace.h.
◆ M0_LOG0
◆ M0_LOG1
Value: LOG_IS_STR_ARG(a0), \
fmt, a0); \
LOG_CHECK(a0); })
enum m0_trace_level level
#define LOG_IS_STR_ARG(a)
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition at line 632 of file trace.h.
◆ M0_LOG2
Value: fmt, a0, a1); \
enum m0_trace_level level
#define LOG_IS_STR_ARG(a)
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition at line 642 of file trace.h.
◆ M0_LOG3
#define M0_LOG3 |
( |
|
level, |
|
|
|
fmt, |
|
|
|
a0, |
|
|
|
a1, |
|
|
|
a2 |
|
) |
| |
Value: LOG_IS_STR_ARG(a2) }), \
fmt, a0, a1, a2); \
enum m0_trace_level level
#define LOG_IS_STR_ARG(a)
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition at line 652 of file trace.h.
◆ M0_LOG4
#define M0_LOG4 |
( |
|
level, |
|
|
|
fmt, |
|
|
|
a0, |
|
|
|
a1, |
|
|
|
a2, |
|
|
|
a3 |
|
) |
| |
Value: LOG_TYPEOF(a3, v3); }, \
LOG_OFFSETOF(v3) }), \
LOG_SIZEOF(a3) }), \
LOG_IS_STR_ARG(a3), \
fmt, a0, a1, a2, a3); \
enum m0_trace_level level
#define LOG_IS_STR_ARG(a)
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition at line 663 of file trace.h.
◆ M0_LOG5
#define M0_LOG5 |
( |
|
level, |
|
|
|
fmt, |
|
|
|
a0, |
|
|
|
a1, |
|
|
|
a2, |
|
|
|
a3, |
|
|
|
a4 |
|
) |
| |
Value: LOG_IS_STR_ARG(a4) }), \
fmt, a0, a1, a2, a3, a4); \
LOG_CHECK(a4); })
enum m0_trace_level level
#define LOG_IS_STR_ARG(a)
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition at line 678 of file trace.h.
◆ M0_LOG6
#define M0_LOG6 |
( |
|
level, |
|
|
|
fmt, |
|
|
|
a0, |
|
|
|
a1, |
|
|
|
a2, |
|
|
|
a3, |
|
|
|
a4, |
|
|
|
a5 |
|
) |
| |
Value: fmt, a0, a1, a2, a3, a4, a5); \
enum m0_trace_level level
#define LOG_IS_STR_ARG(a)
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition at line 695 of file trace.h.
◆ M0_LOG7
#define M0_LOG7 |
( |
|
level, |
|
|
|
fmt, |
|
|
|
a0, |
|
|
|
a1, |
|
|
|
a2, |
|
|
|
a3, |
|
|
|
a4, |
|
|
|
a5, |
|
|
|
a6 |
|
) |
| |
Value: LOG_TYPEOF(a6, v6); }, \
LOG_IS_STR_ARG(a6) }), \
fmt, a0, a1, a2, a3, a4, a5, a6); \
enum m0_trace_level level
#define LOG_IS_STR_ARG(a)
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition at line 712 of file trace.h.
◆ M0_LOG8
#define M0_LOG8 |
( |
|
level, |
|
|
|
fmt, |
|
|
|
a0, |
|
|
|
a1, |
|
|
|
a2, |
|
|
|
a3, |
|
|
|
a4, |
|
|
|
a5, |
|
|
|
a6, |
|
|
|
a7 |
|
) |
| |
Value: LOG_IS_STR_ARG(a7), \
fmt, a0, a1, a2, a3, a4, a5, a6, a7); \
enum m0_trace_level level
#define LOG_IS_STR_ARG(a)
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition at line 734 of file trace.h.
◆ M0_LOG9
#define M0_LOG9 |
( |
|
level, |
|
|
|
fmt, |
|
|
|
a0, |
|
|
|
a1, |
|
|
|
a2, |
|
|
|
a3, |
|
|
|
a4, |
|
|
|
a5, |
|
|
|
a6, |
|
|
|
a7, |
|
|
|
a8 |
|
) |
| |
Value: LOG_IS_STR_ARG(a8) }), \
fmt, a0, a1, a2, a3, a4, a5, a6, a7, a8); \
enum m0_trace_level level
#define LOG_IS_STR_ARG(a)
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition at line 757 of file trace.h.
◆ M0_RC
Value:({ \
typeof(
rc) __rc = (
rc); \
M0_LOG(
M0_CALL,
"< rc=%d", __rc); \
m0_rc_hook(__rc); \
__rc; \
})
Definition at line 194 of file trace.h.
◆ M0_RC_HOOK
Set this to 1 to enable "rc hook".
When rc hook is enabled, every call to M0_RC() invokes an empty function lib/misc.c:m0_rc_hook() and every call to M0_ERR() invokes an empty function lib/misc.c:m0_err_hook(). By placing (conditional) break-points in these functions, one can quickly pinpoint the moment when a particular error occurred.
Definition at line 182 of file trace.h.
◆ M0_RC_INFO
#define M0_RC_INFO |
( |
|
rc, |
|
|
|
fmt, |
|
|
|
... |
|
) |
| |
Value:({ \
typeof(
rc) __rc = (
rc); \
M0_LOG(
M0_CALL,
"< rc=%d " fmt, __rc, ## __VA_ARGS__ ); \
__rc; \
})
char * fmt(const char *format,...) __attribute__((format(printf
Definition at line 209 of file trace.h.
◆ M0_TRACE_POINT
#define M0_TRACE_POINT |
( |
|
LEVEL, |
|
|
|
NR, |
|
|
|
DECL, |
|
|
|
OFFSET, |
|
|
|
SIZEOF, |
|
|
|
ISSTR, |
|
|
|
HASSTR, |
|
|
|
FMT, |
|
|
|
... |
|
) |
| |
Value:({ \
struct t_body DECL; \
static
const int _offset[
NR] = OFFSET; \
static
const int _sizeof[
NR] = SIZEOF; \
static
const bool _isstr[
NR] = ISSTR; \
.td_func = __func__, \
.td_file = __FILE__, \
.td_line = __LINE__, \
.td_size = sizeof(struct t_body), \
.td_offset = _offset, \
.td_sizeof = _sizeof, \
.td_isstr = _isstr, \
.td_hasstr = (HASSTR), \
}; \
printf_check(FMT , ## __VA_ARGS__); \
m0_trace_allot(&__trace_descr, &(const struct t_body){ __VA_ARGS__ });\
})
#define M0_TRACE_SUBSYSTEM
This is a low-level entry point into tracing sub-system.
Don't call this directly, use M0_LOG() macros instead.
Add a fixed-size trace entry into the trace buffer.
- Parameters
-
LEVEL | a log level |
NR | the number of arguments |
DECL | C definition of a trace entry format |
OFFSET | the set of offsets of each argument |
SIZEOF | the set of sizes of each argument |
ISSTR | the set of bool flags, which indicate whether corresponding argument is a string |
HASSTR | bool flag, which is set true iff there is at least one string argument present |
FMT | the printf-like format string |
- Note
- The variadic arguments must match the number and types of fields in the format.
Definition at line 572 of file trace.h.
◆ M0_TRACE_SUBSYS [1/2]
◆ M0_TRACE_SUBSYS [2/2]
#define M0_TRACE_SUBSYS |
( |
|
name, |
|
|
|
value |
|
) |
| M0_TRACE_SUBSYS_ ## name = (1UL << value), |
◆ M0_TRACE_SUBSYSTEM
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_OTHER |
◆ M0_TRACE_SUBSYSTEMS
#define M0_TRACE_SUBSYSTEMS |
The subsystems definitions.
- Note
- : Such kind of definition (via defines) allow to keep enum and string array in sync.
XXX: Until we have first real release, please keep the lower list sorted. After release, all new subsystems should be added to the end of list in order to provide compatibility between trace logs of different software versions.
Definition at line 239 of file trace.h.
◆ MOTR_KO_CORE_IN_FILE_NAME
#define MOTR_KO_CORE_IN_FILE_NAME "/sys/kernel/debug/motr/core" |
◆ MOTR_KO_CORE_OUT_FILE_NAME
#define MOTR_KO_CORE_OUT_FILE_NAME "/var/log/motr/m0tr_ko.img" |
◆ NULL_STRING_STUB
#define NULL_STRING_STUB "(null)" |
◆ anonymous enum
Enumerator |
---|
BOOTLOG_BUF_SIZE | |
Definition at line 73 of file trace.c.
◆ anonymous enum
Enumerator |
---|
M0_TRACE_BUF_HEADER_SIZE | Size, reserved for trace buffer header. Must be multiple of page size on all supported platforms.
|
M0_TRACE_REC_ALIGN | Alignment for trace records in trace buffer
|
Definition at line 325 of file trace.h.
◆ anonymous enum
Enumerator |
---|
M0_TRACE_ARGC_MAX | |
Definition at line 601 of file trace.h.
◆ anonymous enum
Enumerator |
---|
MAGIC_SYM_OFFSETS_MAX | |
Definition at line 514 of file utrace.c.
◆ anonymous enum
◆ lr_action
Enumerator |
---|
LR_ROTATE | |
LR_STOP | |
Definition at line 90 of file traced.c.
◆ m0_trace_buf_flags
Enumerator |
---|
M0_TRACE_BUF_MKFS | |
M0_TRACE_BUF_DIRTY | |
M0_TRACE_BUF_FLAGS_MAX | |
Definition at line 343 of file trace.h.
◆ m0_trace_buf_type
Enumerator |
---|
M0_TRACE_BUF_KERNEL | |
M0_TRACE_BUF_USER | |
Definition at line 338 of file trace.h.
◆ m0_trace_level
Trace levels. To be used as a first argument of M0_LOG().
Enumerator |
---|
M0_NONE | special level, which represents an invalid trace level, should not be used directly with M0_LOG()
|
M0_ALWAYS | special level, it's always displayed on console, intended for printf-style debugging, should be removed from code before committing
|
M0_FATAL | system is unusable and not able to perform it's basic function
|
M0_ERROR | local error condition, i.e.: resource unavailable, no connectivity, incorrect value, etc.
|
M0_WARN | warning condition, i.e.: condition which requires some special treatment, something which not happens normally, corner case, etc.
|
M0_NOTICE | normal but significant condition
|
M0_INFO | some useful information about current system's state
|
M0_DEBUG | lower-level, detailed information to aid debugging and analysis of incorrect behavior
|
M0_CALL | special level, used only with M0_ENTRY() and M0_LEAVE() to trace function calls, should not be used directly with M0_LOG();
|
Definition at line 454 of file trace.h.
◆ m0_trace_print_context
Enumerator |
---|
M0_TRACE_PCTX_NONE | |
M0_TRACE_PCTX_FUNC | |
M0_TRACE_PCTX_SHORT | |
M0_TRACE_PCTX_FULL | |
M0_TRACE_PCTX_INVALID | |
Definition at line 496 of file trace.h.
◆ m0_trace_subsystem
The subsystem bitmask definitions
Enumerator |
---|
M0_TRACE_SUBSYSTEMS | |
Definition at line 291 of file trace.h.
◆ __attribute__()
__attribute__ |
( |
(format(printf, 1, 2)) |
| ) |
const |
◆ align()
static unsigned align |
( |
FILE * |
file, |
|
|
uint64_t |
align, |
|
|
uint64_t |
pos |
|
) |
| |
|
static |
◆ calc_extra_trace_descr_offsets()
static int calc_extra_trace_descr_offsets |
( |
const struct m0_trace_buf_header * |
tbh, |
|
|
const void * |
magic_symbols[], |
|
|
size_t |
nr, |
|
|
ptrdiff_t |
td_offsets[] |
|
) |
| |
|
static |
◆ calc_string_data_size()
static uint32_t calc_string_data_size |
( |
const struct m0_trace_descr * |
td, |
|
|
const void * |
body |
|
) |
| |
|
static |
◆ calc_trace_descr_offset()
static int calc_trace_descr_offset |
( |
const struct m0_trace_buf_header * |
tbh, |
|
|
const char * |
m0tr_ko_path, |
|
|
ptrdiff_t * |
td_offset |
|
) |
| |
|
static |
◆ copy_string_data()
static void copy_string_data |
( |
char * |
dst_str, |
|
|
const char * |
body, |
|
|
const struct m0_trace_descr * |
td |
|
) |
| |
|
static |
◆ format_yaml_str()
static int format_yaml_str |
( |
char * |
str, |
|
|
size_t |
max_size, |
|
|
size_t |
align_size |
|
) |
| |
|
static |
◆ get_cur_pos()
static const char* get_cur_pos |
( |
const struct m0_trace_buf_header * |
logheader, |
|
|
const char * |
logbuf |
|
) |
| |
|
static |
◆ init_log_names()
static int init_log_names |
( |
void |
| ) |
|
|
static |
◆ is_log_rotation_needed()
static bool is_log_rotation_needed |
( |
int * |
fd_ptr | ) |
|
|
static |
◆ log_rotator_thread()
static void log_rotator_thread |
( |
struct rotator_ctx * |
rctx | ) |
|
|
static |
◆ logbuf_map()
static int logbuf_map |
( |
| ) |
|
|
static |
◆ lowercase()
static char* lowercase |
( |
char * |
s | ) |
|
|
inlinestatic |
◆ m0_arch_trace_buf_header_init()
◆ m0_arch_trace_fini()
M0_INTERNAL void m0_arch_trace_fini |
( |
void |
| ) |
|
◆ m0_arch_trace_init()
M0_INTERNAL int m0_arch_trace_init |
( |
void |
| ) |
|
◆ M0_BASSERT() [1/5]
M0_BASSERT |
( |
bootlog. |
bl_buf = =bootlog.bl_area.ta_buf | ) |
|
◆ M0_BASSERT() [2/5]
◆ M0_BASSERT() [3/5]
◆ M0_BASSERT() [4/5]
◆ M0_BASSERT() [5/5]
◆ m0_console_flush()
void m0_console_flush |
( |
void |
| ) |
|
◆ m0_console_printf()
void m0_console_printf |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ m0_console_vprintf()
M0_INTERNAL void m0_console_vprintf |
( |
const char * |
fmt, |
|
|
va_list |
args |
|
) |
| |
◆ m0_err_hook()
static void m0_err_hook |
( |
int |
rc | ) |
|
|
inlinestatic |
◆ m0_error_printf()
void m0_error_printf |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
◆ m0_rc_hook()
static void m0_rc_hook |
( |
int |
rc | ) |
|
|
inlinestatic |
◆ m0_rdtsc()
static uint64_t m0_rdtsc |
( |
void |
| ) |
|
|
inlinestatic |
pccnt access from user-space in AARCH64 platform is enabled by enable_user_space_access_pccnt() call from the kernel module, so this function will work only if the kernel module is present on this platform. TODO: investigate how to resolve it for the user-space mode in case there is no kernel module present.
Definition at line 161 of file trace.c.
◆ m0_trace_allot()
M0_INTERNAL void m0_trace_allot |
( |
const struct m0_trace_descr * |
td, |
|
|
const void * |
body |
|
) |
| |
- Todo:
- put memory barrier here before writing the magic
Definition at line 225 of file trace.c.
◆ m0_trace_args_unpack()
◆ m0_trace_buf_header_init()
M0_INTERNAL void m0_trace_buf_header_init |
( |
struct m0_trace_buf_header * |
tbh, |
|
|
size_t |
buf_size |
|
) |
| |
◆ m0_trace_file_path_get()
M0_INTERNAL const char * m0_trace_file_path_get |
( |
void |
| ) |
|
◆ m0_trace_fini()
M0_INTERNAL void m0_trace_fini |
( |
void |
| ) |
|
◆ m0_trace_get_stats()
◆ m0_trace_init()
M0_INTERNAL int m0_trace_init |
( |
void |
| ) |
|
◆ m0_trace_last_record_get()
◆ m0_trace_level_allow()
M0_INTERNAL void m0_trace_level_allow |
( |
unsigned |
level | ) |
|
Allows trace records up to the specified level. By default, all levels are allowed.
Definition at line 218 of file trace.c.
◆ m0_trace_level_name()
M0_INTERNAL const char* m0_trace_level_name |
( |
enum m0_trace_level |
level | ) |
|
◆ m0_trace_level_parse()
Parses textual trace level specification and returns a corresponding m0_trace_level enum value.
- Parameters
-
str | textual trace level specification in form "level[+][,level[+]]", where level is one of "call|debug|info|warn|error|fatal", for example: 'warn+' or 'debug', 'call,warn,error' |
- Returns
- m0_trace_level enum value, on success
-
M0_NONE on failure
Definition at line 521 of file trace.c.
◆ m0_trace_logbuf_get()
M0_INTERNAL const void* m0_trace_logbuf_get |
( |
void |
| ) |
|
◆ m0_trace_logbuf_header_get()
◆ m0_trace_logbuf_pos_get()
M0_INTERNAL uint64_t m0_trace_logbuf_pos_get |
( |
void |
| ) |
|
◆ m0_trace_logbuf_size_get()
M0_INTERNAL uint32_t m0_trace_logbuf_size_get |
( |
void |
| ) |
|
◆ m0_trace_logbuf_size_set()
M0_INTERNAL void m0_trace_logbuf_size_set |
( |
size_t |
size | ) |
|
◆ m0_trace_magic_sym_addr_get()
M0_INTERNAL const void* m0_trace_magic_sym_addr_get |
( |
void |
| ) |
|
◆ m0_trace_magic_sym_extra_addr_add()
int m0_trace_magic_sym_extra_addr_add |
( |
const void * |
addr | ) |
|
◆ m0_trace_magic_sym_name_get()
M0_INTERNAL const char* m0_trace_magic_sym_name_get |
( |
void |
| ) |
|
◆ m0_trace_parse()
M0_INTERNAL int m0_trace_parse |
( |
FILE * |
trace_file, |
|
|
FILE * |
output_file, |
|
|
const char * |
m0tr_ko_path, |
|
|
enum m0_trace_parse_flags |
flags, |
|
|
const void * |
magic_symbols[], |
|
|
unsigned int |
magic_symbols_nr |
|
) |
| |
Parse log buffer from a trace file.
Normally a trace file would be called "m0trace.12345" or something like that, where number represents a PID of the process which created that trace file.
Returns sysexits.h error codes.
Definition at line 527 of file utrace.c.
◆ m0_trace_print_context_parse()
◆ m0_trace_print_subsystems()
M0_INTERNAL void m0_trace_print_subsystems |
( |
void |
| ) |
|
◆ m0_trace_record_print()
M0_INTERNAL void m0_trace_record_print |
( |
const struct m0_trace_rec_header * |
trh, |
|
|
const void * |
buf |
|
) |
| |
◆ m0_trace_record_print_yaml()
M0_INTERNAL int m0_trace_record_print_yaml |
( |
char * |
outbuf, |
|
|
size_t |
outbuf_size, |
|
|
const struct m0_trace_rec_header * |
trh, |
|
|
const void * |
tr_body, |
|
|
bool |
yaml_stream_mode |
|
) |
| |
◆ m0_trace_set_buffer_size()
int m0_trace_set_buffer_size |
( |
size_t |
size | ) |
|
◆ m0_trace_set_immediate_mask()
M0_INTERNAL int m0_trace_set_immediate_mask |
( |
const char * |
mask_str | ) |
|
◆ m0_trace_set_level()
M0_INTERNAL int m0_trace_set_level |
( |
const char * |
level_str | ) |
|
◆ m0_trace_set_mmapped_buffer()
M0_INTERNAL void m0_trace_set_mmapped_buffer |
( |
bool |
val | ) |
|
◆ m0_trace_set_print_context()
M0_INTERNAL int m0_trace_set_print_context |
( |
const char * |
ctx_name | ) |
|
◆ m0_trace_stats_update()
M0_INTERNAL void m0_trace_stats_update |
( |
uint32_t |
rec_size | ) |
|
◆ m0_trace_subsys_list_to_mask()
M0_INTERNAL int m0_trace_subsys_list_to_mask |
( |
char * |
subsys_names, |
|
|
unsigned long * |
ret_mask |
|
) |
| |
Produces a numeric bitmask from a comma-separated list of subsystem names. If '!' is present at the beginning of list, then mask is inverted
- Parameters
-
subsys_names | comma-separated list of subsystem names with optional '!' at the beginning |
ret_mask | a pointer to a variable where to store mask, the stored value is valid only if no error is returned |
- Returns
- 0 on success
-
-EINVAL on failure
Definition at line 414 of file trace.c.
◆ m0_trace_subsys_name()
M0_INTERNAL const char* m0_trace_subsys_name |
( |
uint64_t |
subsys | ) |
|
◆ m0_trace_switch_to_static_logbuf()
M0_INTERNAL void m0_trace_switch_to_static_logbuf |
( |
void |
| ) |
|
◆ m0_trace_use_mmapped_buffer()
M0_INTERNAL bool m0_trace_use_mmapped_buffer |
( |
void |
| ) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
◆ mmap_m0tr_ko()
static int mmap_m0tr_ko |
( |
const char * |
m0tr_ko_path, |
|
|
void ** |
ko_addr |
|
) |
| |
|
static |
◆ module_param() [1/4]
◆ module_param() [2/4]
◆ module_param() [3/4]
◆ module_param() [4/4]
◆ MODULE_PARM_DESC() [1/4]
◆ MODULE_PARM_DESC() [2/4]
◆ MODULE_PARM_DESC() [3/4]
MODULE_PARM_DESC |
( |
trace_print_context |
, |
|
|
" controls whether to display additional trace point" " |
info, |
|
|
like |
subsystem, |
|
|
file |
, |
|
|
func |
, |
|
|
etc.;values:" " |
none, |
|
|
func |
, |
|
|
short |
, |
|
|
full" |
|
|
) |
| |
◆ MODULE_PARM_DESC() [4/4]
◆ patch_trace_descr()
static void patch_trace_descr |
( |
struct m0_trace_descr * |
td, |
|
|
ptrdiff_t |
offset |
|
) |
| |
|
static |
◆ plog()
static void plog |
( |
int |
level, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
|
static |
◆ print_trace_buf_header()
◆ process_trace_buffer()
static int process_trace_buffer |
( |
int * |
ofd_ptr, |
|
|
const struct m0_trace_buf_header * |
logheader, |
|
|
const char * |
logbuf |
|
) |
| |
|
static |
◆ read_trace_buf_header() [1/2]
◆ read_trace_buf_header() [2/2]
◆ rotate_original_log()
static int rotate_original_log |
( |
struct rotator_ctx * |
rctx | ) |
|
|
static |
◆ save_kore_file()
int save_kore_file |
( |
void |
| ) |
|
◆ set_trace_dir()
static int set_trace_dir |
( |
const char * |
path | ) |
|
|
static |
◆ sig_term_quit_int_handler()
void sig_term_quit_int_handler |
( |
int |
signum, |
|
|
siginfo_t * |
siginfo, |
|
|
void * |
uctx |
|
) |
| |
◆ subsys_name_to_mask()
static unsigned long subsys_name_to_mask |
( |
char * |
subsys_name | ) |
|
|
static |
◆ subsys_str()
static char* subsys_str |
( |
uint64_t |
subsys, |
|
|
char * |
buf |
|
) |
| |
|
static |
◆ trace_level_value()
◆ trace_level_value_plus()
static enum m0_trace_level trace_level_value_plus |
( |
char * |
level_name | ) |
|
|
static |
◆ uppercase()
static char* uppercase |
( |
char * |
s | ) |
|
|
inlinestatic |
◆ wake_up_rotator_thread()
static void wake_up_rotator_thread |
( |
enum lr_action |
a | ) |
|
|
static |
◆ write_trace_data()
static int write_trace_data |
( |
int * |
fd_ptr, |
|
|
const void * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
static |
◆ write_trace_header()
static int write_trace_header |
( |
const struct m0_trace_buf_header * |
header, |
|
|
int * |
ofd, |
|
|
const char * |
ofname |
|
) |
| |
|
static |
◆ __attribute__
Discard the pre-allocation for object.
- Parameters
-
ctx | balloc operation context environment. |
req | discard request which includes all parameters. |
- Returns
- 0 means success. Upon failure, non-zero error number is returned.
modify the allocation status forcibly.
This function may be used by fsck or some other tools to modify the allocation status directly.
- Parameters
-
ctx | balloc operation context environment. |
alloc | true to make the specifed extent as allocated, otherwise make the extent as free. |
ext | user supplied extent to check. |
- Returns
- 0 means success. Upon failure, non-zero error number is returned.
Query the allocation status.
- Parameters
-
ctx | balloc operation context environment. |
ext | user supplied extent to check. |
- Returns
- true if the extent is fully allocated. Otherwise, false is returned.
Definition at line 2745 of file balloc.c.
◆ allowed_level
unsigned allowed_level = UINT_MAX |
|
static |
◆ bl_area
◆ bl_buf
◆ bootlog
This buffer is used for early trace records issued before real buffer is initialized by m0_trace_init().
◆ bufmask
◆ daemon_mode
◆ fsync_enabled
bool fsync_enabled = false |
|
static |
◆ input_file_name
◆ keep_logs
◆ level
◆ log_level
◆ log_names
◆ log_rotation_dealy
uint32_t log_rotation_dealy = 5 |
|
static |
◆ logfd
◆ m0_logbuf [1/2]
void* m0_logbuf = bootlog.bl_area.ta_buf |
Trace buffer pointer
Definition at line 86 of file trace.c.
◆ m0_logbuf [2/2]
Trace buffer pointer
Definition at line 86 of file trace.c.
◆ m0_logbuf_header [1/2]
Trace buffer header pointer
Definition at line 85 of file trace.c.
◆ m0_logbuf_header [2/2]
Trace buffer header pointer
Definition at line 85 of file trace.c.
◆ m0_logbufsize
◆ m0_pid_cached
◆ m0_trace_immediate_mask [1/2]
unsigned long m0_trace_immediate_mask = 0 |
The subsystems bitmask of what should be printed immediately to the console.
Definition at line 91 of file trace.c.
◆ m0_trace_immediate_mask [2/2]
unsigned long m0_trace_immediate_mask |
The subsystems bitmask of what should be printed immediately to the console.
Definition at line 91 of file trace.c.
◆ m0_trace_level [1/2]
Controls which M0_LOG() messages are displayed on console when M0_TRACE_IMMEDIATE_DEBUG is enabled.
If log level of trace point is less or equal to m0_trace_level, then it's displayed, otherwise not.
By default m0_trace_level is set to M0_WARN. Also,
- See also
- documentation of M0_CALL log level, it has special meaning.
Definition at line 98 of file trace.c.
◆ m0_trace_level [2/2]
Controls which M0_LOG() messages are displayed on console when M0_TRACE_IMMEDIATE_DEBUG is enabled.
If log level of trace point is less or equal to m0_trace_level, then it's displayed, otherwise not.
By default m0_trace_level is set to M0_WARN. Also,
- See also
- documentation of M0_CALL log level, it has special meaning.
Definition at line 98 of file trace.c.
◆ m0_trace_print_context [1/2]
Controls whether to display additional trace point info, like timestamp, subsystem, file, func, etc.
Acceptable values are elements of enum m0_trace_print_context.
Definition at line 95 of file trace.c.
◆ m0_trace_print_context [2/2]
Controls whether to display additional trace point info, like timestamp, subsystem, file, func, etc.
Acceptable values are elements of enum m0_trace_print_context.
Definition at line 95 of file trace.c.
◆ M0_XCA_DOMAIN
enum { ... } M0_XCA_DOMAIN |
◆ max_log_size
uint32_t max_log_size = 1024 |
|
static |
◆ name
◆ output_file_name
◆ output_kore_file_name
◆ pipe_mode
◆ progname
◆ rotation_enabled
bool rotation_enabled = true |
|
static |
◆ rotator_action
◆ rotator_cond
◆ rotator_mutex
◆ save_kore
◆ stats
◆ stop_processing
volatile bool stop_processing = false |
|
static |
◆ trace_buf_size [1/2]
◆ trace_buf_size [2/2]
◆ trace_file_path
char trace_file_path[PATH_MAX] |
|
static |
◆ trace_immediate_mask
char* trace_immediate_mask |
|
static |
◆ trace_level
◆ trace_levels
struct { ... } trace_levels[] |
Initial value:= {
[0] = { .name =
"NONE", .level =
M0_NONE },
[1] = { .name =
"ALWAYS", .level =
M0_ALWAYS },
[2] = { .name =
"FATAL", .level =
M0_FATAL },
[3] = { .name =
"ERROR", .level =
M0_ERROR },
[4] = { .name =
"WARN", .level =
M0_WARN },
[5] = { .name =
"NOTICE", .level =
M0_NOTICE },
[6] = { .name =
"INFO", .level =
M0_INFO },
[7] = { .name =
"DEBUG", .level =
M0_DEBUG },
[8] = { .name =
"CALL", .level =
M0_CALL },
}
The array of trace level names
◆ trace_magic_symbol
◆ trace_magic_symbol_name
const char trace_magic_symbol_name[] = "trace_magic_symbol" |
|
static |
◆ trace_print_context
char* trace_print_context |
|
static |
◆ trace_print_ctx_str
const char* trace_print_ctx_str[] |
|
static |
Initial value:Array of trace print context names
Definition at line 125 of file trace.c.
◆ trace_subsys_str
const char* trace_subsys_str[] |
|
static |
Initial value:The array of subsystem names
Definition at line 104 of file trace.c.
◆ use_mmaped_buffer
bool use_mmaped_buffer = true |
|
static |
◆ use_syslog
◆ write_data_mutex