Motr  M0
Tracing

Data Structures

struct  m0_trace_stats
 
struct  m0_trace_buf_header
 
struct  m0_trace_rec_header
 
struct  m0_trace_descr
 
struct  rotator_ctx
 

Macros

#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__)
 

Enumerations

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 }
 

Functions

 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_statsm0_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_headerm0_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_headerm0_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_headerread_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_headerread_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[])
 

Variables

static char * trace_immediate_mask
 
static char * trace_level
 
static char * trace_print_context
 
static unsigned long trace_buf_size = M0_TRACE_KBUF_SIZE
 
static struct m0_trace_stats stats
 
static const uint64_t trace_magic_symbol = M0_TRACE_MAGIC
 
static const char trace_magic_symbol_name [] = "trace_magic_symbol"
 
enum { ... }  M0_XCA_DOMAIN
 
struct {
   struct m0_trace_area   bl_area
 
   char   bl_buf [BOOTLOG_BUF_SIZE]
 
bootlog
 
struct m0_trace_buf_headerm0_logbuf_header = &bootlog.bl_area.ta_header
 
void * m0_logbuf = bootlog.bl_area.ta_buf
 
size_t m0_logbufsize = sizeof bootlog.bl_buf
 
static size_t bufmask = sizeof bootlog.bl_buf - 1
 
unsigned long m0_trace_immediate_mask = 0
 
unsigned int m0_trace_print_context = M0_TRACE_PCTX_SHORT
 
unsigned int m0_trace_level = M0_WARN | M0_ERROR | M0_FATAL
 
static const char * trace_subsys_str []
 
struct {
   const char *   name
 
   enum m0_trace_level   level
 
trace_levels []
 
static const char * trace_print_ctx_str []
 
static unsigned allowed_level = UINT_MAX
 
unsigned long m0_trace_immediate_mask
 
unsigned int m0_trace_print_context
 
unsigned int m0_trace_level
 
struct m0_trace_buf_headerm0_logbuf_header
 
void * m0_logbuf
 
pid_t m0_pid_cached
 
static int logfd
 
static bool use_mmaped_buffer = true
 
static char trace_file_path [PATH_MAX]
 
static size_t trace_buf_size = M0_TRACE_UBUF_SIZE
 
static const char * progname
 
static const char * input_file_name = DEFAULT_IN_FILE_NAME
 
static const char * output_file_name = DEFAULT_OUT_FILE_NAME
 
static const char * output_kore_file_name = MOTR_KO_CORE_OUT_FILE_NAME
 
static bool daemon_mode = false
 
static bool pipe_mode = false
 
static bool fsync_enabled = false
 
static bool use_syslog = false
 
static bool save_kore = true
 
static int log_level = LOG_INFO
 
static bool rotation_enabled = true
 
static uint32_t log_rotation_dealy = 5
 
static uint32_t max_log_size = 1024
 
static uint32_t keep_logs = 6
 
static struct m0_mutex write_data_mutex
 
static struct m0_mutex rotator_mutex
 
static struct m0_cond rotator_cond
 
static enum lr_action rotator_action = LR_ROTATE
 
static volatile bool stop_processing = false
 
static char log_names [MAX_LOG_NAMES][PATH_MAX]
 
enum m0_md_lustre_logrec_type __attribute__
 

Detailed Description

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

M0_LOG(M0_INFO, "Cached value found: %llx, attempt: %i", foo->f_val, i);

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:

{ offsetof(struct t_body, v0), ..., offsetof(struct t_body, vn) };
{ 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.

Macro Definition Documentation

◆ DEFAULT_IN_FILE_NAME

#define DEFAULT_IN_FILE_NAME   "/sys/kernel/debug/motr/trace/buffer"

Definition at line 60 of file traced.c.

◆ DEFAULT_OUT_FILE_NAME

#define DEFAULT_OUT_FILE_NAME   "/var/log/motr/m0trace.bin"

Definition at line 61 of file traced.c.

◆ LOG_CHECK

#define LOG_CHECK (   a)
Value:
M0_CASSERT(!M0_HAS_TYPE(a, const char []) && \
(sizeof(a) == 1 || sizeof(a) == 2 || sizeof(a) == 4 || \
sizeof(a) == 8))
#define M0_CASSERT(cond)
#define M0_HAS_TYPE(expr, type)
Definition: misc.h:344

Definition at line 618 of file trace.h.

◆ log_debug

#define log_debug (   fmt,
  ... 
)    plog(LOG_DEBUG, fmt, ## __VA_ARGS__)

Definition at line 111 of file traced.c.

◆ log_err

#define log_err (   fmt,
  ... 
)    plog(LOG_ERR, fmt, ## __VA_ARGS__)

Definition at line 108 of file traced.c.

◆ LOG_GROUP

#define LOG_GROUP (   ...)    __VA_ARGS__

LOG_GROUP() is used to pass { x0, ..., xn } as a single argument to M0_TRACE_POINT().

Definition at line 627 of file trace.h.

◆ log_info

#define log_info (   fmt,
  ... 
)    plog(LOG_INFO, fmt, ## __VA_ARGS__)

Definition at line 110 of file traced.c.

◆ LOG_IS_STR_ARG

#define LOG_IS_STR_ARG (   a)
Value:
M0_HAS_TYPE((a), char*) ?: \
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: misc.h:344

Definition at line 611 of file trace.h.

◆ LOG_OFFSETOF

#define LOG_OFFSETOF (   v)    offsetof(struct t_body, v)

Definition at line 609 of file trace.h.

◆ LOG_SIZEOF

#define LOG_SIZEOF (   a)    sizeof(a)

Definition at line 610 of file trace.h.

◆ LOG_TYPEOF

#define LOG_TYPEOF (   a,
 
)    typeof(a) v

Definition at line 608 of file trace.h.

◆ log_warn

#define log_warn (   fmt,
  ... 
)    plog(LOG_WARNING, fmt, ## __VA_ARGS__)

Definition at line 109 of file traced.c.

◆ M0_ENTRY

#define M0_ENTRY (   ...)    M0_LOG(M0_CALL, "> " __VA_ARGS__)

Definition at line 170 of file trace.h.

◆ M0_ERR

#define M0_ERR (   rc)
Value:
({ \
typeof(rc) __rc = (rc); \
M0_ASSERT(__rc != 0); \
M0_LOG(M0_ERROR, "<! rc=%d", __rc); \
m0_err_hook(__rc); \
__rc; \
})
int32_t rc
Definition: trigger_fop.h:47

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
int32_t rc
Definition: trigger_fop.h:47

Definition at line 215 of file trace.h.

◆ M0_LEAVE

#define M0_LEAVE (   ...)    M0_LOG(M0_CALL, "< " __VA_ARGS__)

Definition at line 171 of file trace.h.

◆ M0_LOG

#define M0_LOG (   level,
  ... 
)    M0_CAT(M0_LOG, M0_COUNT_PARAMS(__VA_ARGS__))(level, __VA_ARGS__)

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:

M0_LOG(M0_DEBUG, "%s", (char *)"foo");

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

#define M0_LOG0 (   level,
  fmt 
)    M0_TRACE_POINT(level, 0, { ; }, {}, {}, {}, false, fmt)

Definition at line 629 of file trace.h.

◆ M0_LOG1

#define M0_LOG1 (   level,
  fmt,
  a0 
)
Value:
{ LOG_TYPEOF(a0, v0); }, \
{ LOG_OFFSETOF(v0) }, \
{ LOG_SIZEOF(a0) }, \
{ LOG_IS_STR_ARG(a0) }, \
LOG_IS_STR_ARG(a0), \
fmt, a0); \
LOG_CHECK(a0); })
#define LOG_SIZEOF(a)
Definition: trace.h:610
enum m0_trace_level level
Definition: trace.c:111
#define LOG_OFFSETOF(v)
Definition: trace.h:609
#define LOG_TYPEOF(a, v)
Definition: trace.h:608
#define LOG_IS_STR_ARG(a)
Definition: trace.h:611
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition: trace.h:572

Definition at line 632 of file trace.h.

◆ M0_LOG2

#define M0_LOG2 (   level,
  fmt,
  a0,
  a1 
)
Value:
{ LOG_TYPEOF(a0, v0); LOG_TYPEOF(a1, v1); }, \
LOG_GROUP({ LOG_OFFSETOF(v0), LOG_OFFSETOF(v1) }), \
LOG_GROUP({ LOG_SIZEOF(a0), LOG_SIZEOF(a1) }), \
fmt, a0, a1); \
LOG_CHECK(a0); LOG_CHECK(a1); })
#define LOG_SIZEOF(a)
Definition: trace.h:610
enum m0_trace_level level
Definition: trace.c:111
#define LOG_OFFSETOF(v)
Definition: trace.h:609
#define LOG_CHECK(a)
Definition: trace.h:618
#define LOG_GROUP(...)
Definition: trace.h:627
#define LOG_TYPEOF(a, v)
Definition: trace.h:608
#define LOG_IS_STR_ARG(a)
Definition: trace.h:611
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition: trace.h:572

Definition at line 642 of file trace.h.

◆ M0_LOG3

#define M0_LOG3 (   level,
  fmt,
  a0,
  a1,
  a2 
)
Value:
{ LOG_TYPEOF(a0, v0); LOG_TYPEOF(a1, v1); LOG_TYPEOF(a2, v2); }, \
LOG_GROUP({ LOG_OFFSETOF(v0), LOG_OFFSETOF(v1), LOG_OFFSETOF(v2) }), \
LOG_GROUP({ LOG_SIZEOF(a0), LOG_SIZEOF(a1), LOG_SIZEOF(a2) }), \
LOG_IS_STR_ARG(a2) }), \
fmt, a0, a1, a2); \
LOG_CHECK(a0); LOG_CHECK(a1); LOG_CHECK(a2); })
#define LOG_SIZEOF(a)
Definition: trace.h:610
enum m0_trace_level level
Definition: trace.c:111
#define LOG_OFFSETOF(v)
Definition: trace.h:609
#define LOG_CHECK(a)
Definition: trace.h:618
#define LOG_GROUP(...)
Definition: trace.h:627
#define LOG_TYPEOF(a, v)
Definition: trace.h:608
#define LOG_IS_STR_ARG(a)
Definition: trace.h:611
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition: trace.h:572

Definition at line 652 of file trace.h.

◆ M0_LOG4

#define M0_LOG4 (   level,
  fmt,
  a0,
  a1,
  a2,
  a3 
)
Value:
{ LOG_TYPEOF(a0, v0); LOG_TYPEOF(a1, v1); LOG_TYPEOF(a2, v2); \
LOG_TYPEOF(a3, v3); }, \
LOG_GROUP({ LOG_OFFSETOF(v0), LOG_OFFSETOF(v1), LOG_OFFSETOF(v2), \
LOG_OFFSETOF(v3) }), \
LOG_SIZEOF(a3) }), \
LOG_IS_STR_ARG(a2), LOG_IS_STR_ARG(a3) }), \
LOG_IS_STR_ARG(a3), \
fmt, a0, a1, a2, a3); \
LOG_CHECK(a0); LOG_CHECK(a1); LOG_CHECK(a2); LOG_CHECK(a3); })
#define LOG_SIZEOF(a)
Definition: trace.h:610
enum m0_trace_level level
Definition: trace.c:111
#define LOG_OFFSETOF(v)
Definition: trace.h:609
#define LOG_CHECK(a)
Definition: trace.h:618
#define LOG_GROUP(...)
Definition: trace.h:627
#define LOG_TYPEOF(a, v)
Definition: trace.h:608
#define LOG_IS_STR_ARG(a)
Definition: trace.h:611
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition: trace.h:572

Definition at line 663 of file trace.h.

◆ M0_LOG5

#define M0_LOG5 (   level,
  fmt,
  a0,
  a1,
  a2,
  a3,
  a4 
)
Value:
{ LOG_TYPEOF(a0, v0); LOG_TYPEOF(a1, v1); LOG_TYPEOF(a2, v2); \
LOG_TYPEOF(a3, v3); LOG_TYPEOF(a4, v4); }, \
LOG_GROUP({ LOG_OFFSETOF(v0), LOG_OFFSETOF(v1), LOG_OFFSETOF(v2), \
LOG_OFFSETOF(v3), LOG_OFFSETOF(v4) }), \
LOG_SIZEOF(a3), LOG_SIZEOF(a4) }), \
LOG_IS_STR_ARG(a2), LOG_IS_STR_ARG(a3), \
LOG_IS_STR_ARG(a4) }), \
LOG_IS_STR_ARG(a3) || LOG_IS_STR_ARG(a4), \
fmt, a0, a1, a2, a3, a4); \
LOG_CHECK(a0); LOG_CHECK(a1); LOG_CHECK(a2); LOG_CHECK(a3); \
LOG_CHECK(a4); })
#define LOG_SIZEOF(a)
Definition: trace.h:610
enum m0_trace_level level
Definition: trace.c:111
#define LOG_OFFSETOF(v)
Definition: trace.h:609
#define LOG_CHECK(a)
Definition: trace.h:618
#define LOG_GROUP(...)
Definition: trace.h:627
#define LOG_TYPEOF(a, v)
Definition: trace.h:608
#define LOG_IS_STR_ARG(a)
Definition: trace.h:611
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition: trace.h:572

Definition at line 678 of file trace.h.

◆ M0_LOG6

#define M0_LOG6 (   level,
  fmt,
  a0,
  a1,
  a2,
  a3,
  a4,
  a5 
)
Value:
{ LOG_TYPEOF(a0, v0); LOG_TYPEOF(a1, v1); LOG_TYPEOF(a2, v2); \
LOG_TYPEOF(a3, v3); LOG_TYPEOF(a4, v4); LOG_TYPEOF(a5, v5); }, \
LOG_GROUP({ LOG_OFFSETOF(v0), LOG_OFFSETOF(v1), LOG_OFFSETOF(v2), \
LOG_OFFSETOF(v3), LOG_OFFSETOF(v4), LOG_OFFSETOF(v5) }), \
LOG_SIZEOF(a3), LOG_SIZEOF(a4), LOG_SIZEOF(a5) }), \
LOG_IS_STR_ARG(a2), LOG_IS_STR_ARG(a3), \
LOG_IS_STR_ARG(a4), LOG_IS_STR_ARG(a5) }), \
LOG_IS_STR_ARG(a3) || LOG_IS_STR_ARG(a4) || LOG_IS_STR_ARG(a5), \
fmt, a0, a1, a2, a3, a4, a5); \
LOG_CHECK(a0); LOG_CHECK(a1); LOG_CHECK(a2); LOG_CHECK(a3); \
LOG_CHECK(a4); LOG_CHECK(a5); })
#define LOG_SIZEOF(a)
Definition: trace.h:610
enum m0_trace_level level
Definition: trace.c:111
#define LOG_OFFSETOF(v)
Definition: trace.h:609
#define LOG_CHECK(a)
Definition: trace.h:618
#define LOG_GROUP(...)
Definition: trace.h:627
#define LOG_TYPEOF(a, v)
Definition: trace.h:608
#define LOG_IS_STR_ARG(a)
Definition: trace.h:611
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition: trace.h:572

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(a0, v0); LOG_TYPEOF(a1, v1); LOG_TYPEOF(a2, v2); \
LOG_TYPEOF(a3, v3); LOG_TYPEOF(a4, v4); LOG_TYPEOF(a5, v5); \
LOG_TYPEOF(a6, v6); }, \
LOG_GROUP({ LOG_OFFSETOF(v0), LOG_OFFSETOF(v1), LOG_OFFSETOF(v2), \
LOG_OFFSETOF(v3), LOG_OFFSETOF(v4), \
LOG_OFFSETOF(v5), LOG_OFFSETOF(v6) }), \
LOG_SIZEOF(a3), LOG_SIZEOF(a4), \
LOG_SIZEOF(a5), LOG_SIZEOF(a6) }), \
LOG_IS_STR_ARG(a2), LOG_IS_STR_ARG(a3), \
LOG_IS_STR_ARG(a4), LOG_IS_STR_ARG(a5), \
LOG_IS_STR_ARG(a6) }), \
LOG_IS_STR_ARG(a3) || LOG_IS_STR_ARG(a4) || \
LOG_IS_STR_ARG(a5) || LOG_IS_STR_ARG(a6), \
fmt, a0, a1, a2, a3, a4, a5, a6); \
LOG_CHECK(a0); LOG_CHECK(a1); LOG_CHECK(a2); LOG_CHECK(a3); \
LOG_CHECK(a4); LOG_CHECK(a5); LOG_CHECK(a6); })
#define LOG_SIZEOF(a)
Definition: trace.h:610
enum m0_trace_level level
Definition: trace.c:111
#define LOG_OFFSETOF(v)
Definition: trace.h:609
#define LOG_CHECK(a)
Definition: trace.h:618
#define LOG_GROUP(...)
Definition: trace.h:627
#define LOG_TYPEOF(a, v)
Definition: trace.h:608
#define LOG_IS_STR_ARG(a)
Definition: trace.h:611
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition: trace.h:572

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_TYPEOF(a0, v0); LOG_TYPEOF(a1, v1); LOG_TYPEOF(a2, v2); \
LOG_TYPEOF(a3, v3); LOG_TYPEOF(a4, v4); LOG_TYPEOF(a5, v5); \
LOG_TYPEOF(a6, v6); LOG_TYPEOF(a7, v7); }, \
LOG_GROUP({ LOG_OFFSETOF(v0), LOG_OFFSETOF(v1), LOG_OFFSETOF(v2), \
LOG_OFFSETOF(v3), LOG_OFFSETOF(v4), LOG_OFFSETOF(v5), \
LOG_OFFSETOF(v6), LOG_OFFSETOF(v7) }), \
LOG_SIZEOF(a3), LOG_SIZEOF(a4), LOG_SIZEOF(a5), \
LOG_SIZEOF(a6), LOG_SIZEOF(a7) }), \
LOG_IS_STR_ARG(a2), LOG_IS_STR_ARG(a3), \
LOG_IS_STR_ARG(a4), LOG_IS_STR_ARG(a5), \
LOG_IS_STR_ARG(a6), LOG_IS_STR_ARG(a7) }), \
LOG_IS_STR_ARG(a3) || LOG_IS_STR_ARG(a4) || \
LOG_IS_STR_ARG(a5) || LOG_IS_STR_ARG(a6) || \
LOG_IS_STR_ARG(a7), \
fmt, a0, a1, a2, a3, a4, a5, a6, a7); \
LOG_CHECK(a0); LOG_CHECK(a1); LOG_CHECK(a2); LOG_CHECK(a3); \
LOG_CHECK(a4); LOG_CHECK(a5); LOG_CHECK(a6); LOG_CHECK(a7); })
#define LOG_SIZEOF(a)
Definition: trace.h:610
enum m0_trace_level level
Definition: trace.c:111
#define LOG_OFFSETOF(v)
Definition: trace.h:609
#define LOG_CHECK(a)
Definition: trace.h:618
#define LOG_GROUP(...)
Definition: trace.h:627
#define LOG_TYPEOF(a, v)
Definition: trace.h:608
#define LOG_IS_STR_ARG(a)
Definition: trace.h:611
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition: trace.h:572

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_TYPEOF(a0, v0); LOG_TYPEOF(a1, v1); LOG_TYPEOF(a2, v2); \
LOG_TYPEOF(a3, v3); LOG_TYPEOF(a4, v4); LOG_TYPEOF(a5, v5); \
LOG_TYPEOF(a6, v6); LOG_TYPEOF(a7, v7); LOG_TYPEOF(a8, v8); }, \
LOG_GROUP({ LOG_OFFSETOF(v0), LOG_OFFSETOF(v1), LOG_OFFSETOF(v2), \
LOG_OFFSETOF(v3), LOG_OFFSETOF(v4), LOG_OFFSETOF(v5), \
LOG_OFFSETOF(v6), LOG_OFFSETOF(v7), LOG_OFFSETOF(v8) }), \
LOG_SIZEOF(a3), LOG_SIZEOF(a4), LOG_SIZEOF(a5), \
LOG_SIZEOF(a6), LOG_SIZEOF(a7), LOG_SIZEOF(a8) }), \
LOG_IS_STR_ARG(a2), LOG_IS_STR_ARG(a3), \
LOG_IS_STR_ARG(a4), LOG_IS_STR_ARG(a5), \
LOG_IS_STR_ARG(a6), LOG_IS_STR_ARG(a7), \
LOG_IS_STR_ARG(a8) }), \
LOG_IS_STR_ARG(a3) || LOG_IS_STR_ARG(a4) || \
LOG_IS_STR_ARG(a5) || LOG_IS_STR_ARG(a6) || \
LOG_IS_STR_ARG(a7) || LOG_IS_STR_ARG(a8), \
fmt, a0, a1, a2, a3, a4, a5, a6, a7, a8); \
LOG_CHECK(a0); LOG_CHECK(a1); LOG_CHECK(a2); LOG_CHECK(a3); \
LOG_CHECK(a4); LOG_CHECK(a5); LOG_CHECK(a6); LOG_CHECK(a7); LOG_CHECK(a8); })
#define LOG_SIZEOF(a)
Definition: trace.h:610
enum m0_trace_level level
Definition: trace.c:111
#define LOG_OFFSETOF(v)
Definition: trace.h:609
#define LOG_CHECK(a)
Definition: trace.h:618
#define LOG_GROUP(...)
Definition: trace.h:627
#define LOG_TYPEOF(a, v)
Definition: trace.h:608
#define LOG_IS_STR_ARG(a)
Definition: trace.h:611
#define M0_TRACE_POINT(LEVEL, NR, DECL, OFFSET, SIZEOF, ISSTR, HASSTR, FMT,...)
Definition: trace.h:572

Definition at line 757 of file trace.h.

◆ M0_RC

return M0_RC (   rc)
Value:
({ \
typeof(rc) __rc = (rc); \
M0_LOG(M0_CALL, "< rc=%d", __rc); \
m0_rc_hook(__rc); \
__rc; \
})
Definition: trace.h:493
int32_t rc
Definition: trigger_fop.h:47

Definition at line 194 of file trace.h.

◆ M0_RC_HOOK

#define M0_RC_HOOK   (0)

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; \
})
Definition: trace.h:493
char * fmt(const char *format,...) __attribute__((format(printf
int32_t rc
Definition: trigger_fop.h:47

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; \
static const struct m0_trace_descr __trace_descr = { \
.td_level = (LEVEL), \
.td_fmt = (FMT), \
.td_func = __func__, \
.td_file = __FILE__, \
.td_line = __LINE__, \
.td_subsys = M0_TRACE_SUBSYSTEM, \
.td_size = sizeof(struct t_body), \
.td_nr = (NR), \
.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
Definition: trace.h:598
uint64_t td_magic
Definition: trace.h:506
Definition: storage.c:317
const char * td_fmt
Definition: trace.h:507
#define LEVEL

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
LEVELa log level
NRthe number of arguments
DECLC definition of a trace entry format
OFFSETthe set of offsets of each argument
SIZEOFthe set of sizes of each argument
ISSTRthe set of bool flags, which indicate whether corresponding argument is a string
HASSTRbool flag, which is set true iff there is at least one string argument present
FMTthe 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]

#define M0_TRACE_SUBSYS (   name,
  value 
)    [value] = #name,

Definition at line 102 of file trace.c.

◆ M0_TRACE_SUBSYS [2/2]

#define M0_TRACE_SUBSYS (   name,
  value 
)    M0_TRACE_SUBSYS_ ## name = (1UL << value),

Definition at line 289 of file trace.h.

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_OTHER

Definition at line 598 of file trace.h.

◆ 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"

Definition at line 62 of file traced.c.

◆ MOTR_KO_CORE_OUT_FILE_NAME

#define MOTR_KO_CORE_OUT_FILE_NAME   "/var/log/motr/m0tr_ko.img"

Definition at line 63 of file traced.c.

◆ NULL_STRING_STUB

#define NULL_STRING_STUB   "(null)"

Definition at line 180 of file trace.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BOOTLOG_BUF_SIZE 

Definition at line 73 of file trace.c.

◆ anonymous enum

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

anonymous enum
Enumerator
M0_TRACE_ARGC_MAX 

Definition at line 601 of file trace.h.

◆ anonymous enum

anonymous enum
Enumerator
MAGIC_SYM_OFFSETS_MAX 

Definition at line 514 of file utrace.c.

◆ anonymous enum

anonymous enum
Enumerator
MAX_LOG_NAMES 

Definition at line 98 of file traced.c.

◆ lr_action

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.

Function Documentation

◆ __attribute__()

__attribute__ ( (format(printf, 1, 2))  ) const

◆ align()

static unsigned align ( FILE *  file,
uint64_t  align,
uint64_t  pos 
)
static

Definition at line 301 of file utrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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

Definition at line 476 of file utrace.c.

Here is the caller graph for this function:

◆ calc_string_data_size()

static uint32_t calc_string_data_size ( const struct m0_trace_descr td,
const void *  body 
)
static

Definition at line 182 of file trace.c.

Here is the caller graph for this function:

◆ 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

Definition at line 438 of file utrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_string_data()

static void copy_string_data ( char *  dst_str,
const char *  body,
const struct m0_trace_descr td 
)
static

Definition at line 201 of file trace.c.

Here is the caller graph for this function:

◆ format_yaml_str()

static int format_yaml_str ( char *  str,
size_t  max_size,
size_t  align_size 
)
static

Definition at line 812 of file trace.c.

Here is the caller graph for this function:

◆ get_cur_pos()

static const char* get_cur_pos ( const struct m0_trace_buf_header logheader,
const char *  logbuf 
)
static

Definition at line 234 of file traced.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_log_names()

static int init_log_names ( void  )
static

Definition at line 467 of file traced.c.

Here is the caller graph for this function:

◆ is_log_rotation_needed()

static bool is_log_rotation_needed ( int *  fd_ptr)
static

Definition at line 248 of file traced.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ log_rotator_thread()

static void log_rotator_thread ( struct rotator_ctx rctx)
static

Definition at line 332 of file traced.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logbuf_map()

static int logbuf_map ( )
static

Definition at line 62 of file utrace.c.

Here is the call graph for this function:

◆ lowercase()

static char* lowercase ( char *  s)
inlinestatic

Definition at line 376 of file trace.c.

Here is the caller graph for this function:

◆ m0_arch_trace_buf_header_init()

M0_INTERNAL void m0_arch_trace_buf_header_init ( struct m0_trace_buf_header tbh)

Definition at line 233 of file ktrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_arch_trace_fini()

M0_INTERNAL void m0_arch_trace_fini ( void  )

Definition at line 225 of file ktrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_arch_trace_init()

M0_INTERNAL int m0_arch_trace_init ( void  )

Definition at line 178 of file ktrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ M0_BASSERT() [1/5]

M0_BASSERT ( bootlog.  bl_buf = =bootlog.bl_area.ta_buf)

◆ M0_BASSERT() [2/5]

M0_BASSERT ( ((sizeof bootlog.bl_buf) &((sizeof bootlog.bl_buf) - 1))  = =0)

◆ M0_BASSERT() [3/5]

M0_BASSERT ( sizeof(m0_trace_immediate_mask = =8)

◆ M0_BASSERT() [4/5]

M0_BASSERT ( )

◆ M0_BASSERT() [5/5]

M0_BASSERT ( sizeof(struct m0_trace_buf_header = =M0_TRACE_BUF_HEADER_SIZE)

◆ m0_console_flush()

void m0_console_flush ( void  )

Definition at line 165 of file ktrace.c.

Here is the caller graph for this function:

◆ m0_console_printf()

void m0_console_printf ( const char *  fmt,
  ... 
)

Definition at line 801 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_console_vprintf()

M0_INTERNAL void m0_console_vprintf ( const char *  fmt,
va_list  args 
)

Definition at line 160 of file ktrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_err_hook()

static void m0_err_hook ( int  rc)
inlinestatic

Definition at line 190 of file trace.h.

◆ m0_error_printf()

void m0_error_printf ( const char *  fmt,
  ... 
)

Definition at line 169 of file ktrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_rc_hook()

static void m0_rc_hook ( int  rc)
inlinestatic

Definition at line 188 of file trace.h.

◆ 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.

Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:

◆ m0_trace_args_unpack()

M0_INTERNAL int m0_trace_args_unpack ( const struct m0_trace_rec_header trh,
m0_trace_rec_args_t  args,
const void *  buf 
)

Definition at line 690 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_buf_header_init()

M0_INTERNAL void m0_trace_buf_header_init ( struct m0_trace_buf_header tbh,
size_t  buf_size 
)

Definition at line 956 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_file_path_get()

M0_INTERNAL const char * m0_trace_file_path_get ( void  )

Definition at line 72 of file ktrace.c.

Here is the caller graph for this function:

◆ m0_trace_fini()

M0_INTERNAL void m0_trace_fini ( void  )

Definition at line 148 of file trace.c.

Here is the call graph for this function:

◆ m0_trace_get_stats()

M0_INTERNAL const struct m0_trace_stats * m0_trace_get_stats ( void  )

Definition at line 113 of file ktrace.c.

◆ m0_trace_init()

M0_INTERNAL int m0_trace_init ( void  )

Definition at line 132 of file trace.c.

Here is the call graph for this function:

◆ m0_trace_last_record_get()

M0_INTERNAL const struct m0_trace_rec_header* m0_trace_last_record_get ( void  )

Definition at line 929 of file trace.c.

Here is the call graph for this function:

◆ 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)

Definition at line 460 of file trace.c.

Here is the caller graph for this function:

◆ m0_trace_level_parse()

M0_INTERNAL enum m0_trace_level m0_trace_level_parse ( char *  str)

Parses textual trace level specification and returns a corresponding m0_trace_level enum value.

Parameters
strtextual 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_logbuf_get()

M0_INTERNAL const void* m0_trace_logbuf_get ( void  )

Definition at line 618 of file trace.c.

◆ m0_trace_logbuf_header_get()

M0_INTERNAL const struct m0_trace_buf_header* m0_trace_logbuf_header_get ( void  )

Definition at line 612 of file trace.c.

◆ m0_trace_logbuf_pos_get()

M0_INTERNAL uint64_t m0_trace_logbuf_pos_get ( void  )

Definition at line 638 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_logbuf_size_get()

M0_INTERNAL uint32_t m0_trace_logbuf_size_get ( void  )

Definition at line 624 of file trace.c.

◆ m0_trace_logbuf_size_set()

M0_INTERNAL void m0_trace_logbuf_size_set ( size_t  size)

Definition at line 630 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_magic_sym_addr_get()

M0_INTERNAL const void* m0_trace_magic_sym_addr_get ( void  )

Definition at line 644 of file trace.c.

Here is the caller graph for this function:

◆ m0_trace_magic_sym_extra_addr_add()

int m0_trace_magic_sym_extra_addr_add ( const void *  addr)

Definition at line 654 of file trace.c.

◆ m0_trace_magic_sym_name_get()

M0_INTERNAL const char* m0_trace_magic_sym_name_get ( void  )

Definition at line 649 of file trace.c.

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_print_context_parse()

M0_INTERNAL enum m0_trace_print_context m0_trace_print_context_parse ( const char *  ctx_name)

Definition at line 548 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_print_subsystems()

M0_INTERNAL void m0_trace_print_subsystems ( void  )

Definition at line 678 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_record_print()

M0_INTERNAL void m0_trace_record_print ( const struct m0_trace_rec_header trh,
const void *  buf 
)

Definition at line 746 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 
)

Definition at line 836 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_set_buffer_size()

int m0_trace_set_buffer_size ( size_t  size)

Definition at line 166 of file utrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_set_immediate_mask()

M0_INTERNAL int m0_trace_set_immediate_mask ( const char *  mask_str)

Definition at line 77 of file ktrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_set_level()

M0_INTERNAL int m0_trace_set_level ( const char *  level_str)

Definition at line 581 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_set_mmapped_buffer()

M0_INTERNAL void m0_trace_set_mmapped_buffer ( bool  val)

Definition at line 156 of file utrace.c.

Here is the caller graph for this function:

◆ m0_trace_set_print_context()

M0_INTERNAL int m0_trace_set_print_context ( const char *  ctx_name)

Definition at line 562 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_stats_update()

M0_INTERNAL void m0_trace_stats_update ( uint32_t  rec_size)

Definition at line 119 of file ktrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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_namescomma-separated list of subsystem names with optional '!' at the beginning
ret_maska 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_subsys_name()

M0_INTERNAL const char* m0_trace_subsys_name ( uint64_t  subsys)

Definition at line 339 of file trace.c.

Here is the caller graph for this function:

◆ m0_trace_switch_to_static_logbuf()

M0_INTERNAL void m0_trace_switch_to_static_logbuf ( void  )

Definition at line 986 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_trace_use_mmapped_buffer()

M0_INTERNAL bool m0_trace_use_mmapped_buffer ( void  )

Definition at line 161 of file utrace.c.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 537 of file traced.c.

Here is the call graph for this function:

◆ mmap_m0tr_ko()

static int mmap_m0tr_ko ( const char *  m0tr_ko_path,
void **  ko_addr 
)
static

Definition at line 409 of file utrace.c.

Here is the caller graph for this function:

◆ module_param() [1/4]

module_param ( trace_immediate_mask  ,
charp  ,
S_IRUGO   
)

◆ module_param() [2/4]

module_param ( trace_level  ,
charp  ,
S_IRUGO   
)

◆ module_param() [3/4]

module_param ( trace_print_context  ,
charp  ,
S_IRUGO   
)

◆ module_param() [4/4]

module_param ( trace_buf_size  ,
ulong  ,
S_IRUGO   
)

◆ MODULE_PARM_DESC() [1/4]

MODULE_PARM_DESC ( trace_immediate_mask  ,
" a bitmask or comma separated list of subsystem names" " of what should be printed immediately to console  
)

◆ MODULE_PARM_DESC() [2/4]

MODULE_PARM_DESC ( trace_level  ,
" trace level: level] where level is one of" " call|debug|info|notice|warn|error|fatal"  [+][, level[+] 
)

◆ 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]

MODULE_PARM_DESC ( trace_buf_size  ,
"size of trace buffer in bytes"   
)

◆ patch_trace_descr()

static void patch_trace_descr ( struct m0_trace_descr td,
ptrdiff_t  offset 
)
static

Definition at line 504 of file utrace.c.

Here is the caller graph for this function:

◆ plog()

static void plog ( int  level,
const char *  format,
  ... 
)
static

Definition at line 114 of file traced.c.

◆ print_trace_buf_header()

static void print_trace_buf_header ( FILE *  ofile,
const struct m0_trace_buf_header tbh 
)
static

Definition at line 339 of file utrace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process_trace_buffer()

static int process_trace_buffer ( int *  ofd_ptr,
const struct m0_trace_buf_header logheader,
const char *  logbuf 
)
static

Definition at line 390 of file traced.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_trace_buf_header() [1/2]

static const struct m0_trace_buf_header* read_trace_buf_header ( int  ifd)
static

Definition at line 141 of file traced.c.

Here is the caller graph for this function:

◆ read_trace_buf_header() [2/2]

static const struct m0_trace_buf_header* read_trace_buf_header ( FILE *  trace_file)
static

Definition at line 311 of file utrace.c.

Here is the caller graph for this function:

◆ rotate_original_log()

static int rotate_original_log ( struct rotator_ctx rctx)
static

Definition at line 293 of file traced.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_kore_file()

int save_kore_file ( void  )

Definition at line 484 of file traced.c.

Here is the caller graph for this function:

◆ set_trace_dir()

static int set_trace_dir ( const char *  path)
static

Definition at line 186 of file utrace.c.

◆ sig_term_quit_int_handler()

void sig_term_quit_int_handler ( int  signum,
siginfo_t *  siginfo,
void *  uctx 
)

Definition at line 135 of file traced.c.

Here is the caller graph for this function:

◆ subsys_name_to_mask()

static unsigned long subsys_name_to_mask ( char *  subsys_name)
static

Definition at line 386 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subsys_str()

static char* subsys_str ( uint64_t  subsys,
char *  buf 
)
static

Definition at line 351 of file trace.c.

Here is the caller graph for this function:

◆ trace_level_value()

static enum m0_trace_level trace_level_value ( char *  level_name)
static

Definition at line 472 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ trace_level_value_plus()

static enum m0_trace_level trace_level_value_plus ( char *  level_name)
static

Definition at line 488 of file trace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uppercase()

static char* uppercase ( char *  s)
inlinestatic

Definition at line 366 of file trace.c.

Here is the caller graph for this function:

◆ wake_up_rotator_thread()

static void wake_up_rotator_thread ( enum lr_action  a)
static

Definition at line 285 of file traced.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_trace_data()

static int write_trace_data ( int *  fd_ptr,
const void *  buf,
size_t  size 
)
static

Definition at line 206 of file traced.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_trace_header()

static int write_trace_header ( const struct m0_trace_buf_header header,
int *  ofd,
const char *  ofname 
)
static

Definition at line 177 of file traced.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ __attribute__

__attribute__

Discard the pre-allocation for object.

Parameters
ctxballoc operation context environment.
reqdiscard 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
ctxballoc operation context environment.
alloctrue to make the specifed extent as allocated, otherwise make the extent as free.
extuser supplied extent to check.
Returns
0 means success. Upon failure, non-zero error number is returned.

Query the allocation status.

Parameters
ctxballoc operation context environment.
extuser 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

Definition at line 216 of file trace.c.

◆ bl_area

struct m0_trace_area bl_area

Definition at line 80 of file trace.c.

◆ bl_buf

char bl_buf[BOOTLOG_BUF_SIZE]

Definition at line 81 of file trace.c.

◆ bootlog

struct { ... } bootlog

This buffer is used for early trace records issued before real buffer is initialized by m0_trace_init().

◆ bufmask

size_t bufmask = sizeof bootlog.bl_buf - 1
static

Definition at line 88 of file trace.c.

◆ daemon_mode

bool daemon_mode = false
static

Definition at line 70 of file traced.c.

◆ fsync_enabled

bool fsync_enabled = false
static

Definition at line 72 of file traced.c.

◆ input_file_name

const char* input_file_name = DEFAULT_IN_FILE_NAME
static

Definition at line 66 of file traced.c.

◆ keep_logs

uint32_t keep_logs = 6
static

Definition at line 79 of file traced.c.

◆ level

enum m0_trace_level level

Definition at line 111 of file trace.c.

◆ log_level

int log_level = LOG_INFO
static

Definition at line 75 of file traced.c.

◆ log_names

char log_names[MAX_LOG_NAMES][PATH_MAX]
static

Definition at line 102 of file traced.c.

◆ log_rotation_dealy

uint32_t log_rotation_dealy = 5
static

Definition at line 77 of file traced.c.

◆ logfd

int logfd
static

Definition at line 57 of file utrace.c.

◆ 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]

void* m0_logbuf

Trace buffer pointer

Definition at line 86 of file trace.c.

◆ m0_logbuf_header [1/2]

struct m0_trace_buf_header* m0_logbuf_header = &bootlog.bl_area.ta_header

Trace buffer header pointer

Definition at line 85 of file trace.c.

◆ m0_logbuf_header [2/2]

struct m0_trace_buf_header* m0_logbuf_header

Trace buffer header pointer

Definition at line 85 of file trace.c.

◆ m0_logbufsize

size_t m0_logbufsize = sizeof bootlog.bl_buf

Definition at line 87 of file trace.c.

◆ m0_pid_cached

pid_t m0_pid_cached

Definition at line 55 of file utrace.c.

◆ 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]

unsigned int m0_trace_level

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]

unsigned int m0_trace_print_context

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

Definition at line 78 of file traced.c.

◆ name

const char* name

Definition at line 110 of file trace.c.

◆ output_file_name

const char* output_file_name = DEFAULT_OUT_FILE_NAME
static

Definition at line 67 of file traced.c.

◆ output_kore_file_name

const char* output_kore_file_name = MOTR_KO_CORE_OUT_FILE_NAME
static

Definition at line 68 of file traced.c.

◆ pipe_mode

bool pipe_mode = false
static

Definition at line 71 of file traced.c.

◆ progname

const char* progname
static

Definition at line 65 of file traced.c.

◆ rotation_enabled

bool rotation_enabled = true
static

Definition at line 76 of file traced.c.

◆ rotator_action

enum lr_action rotator_action = LR_ROTATE
static

Definition at line 95 of file traced.c.

◆ rotator_cond

struct m0_cond rotator_cond
static

Definition at line 83 of file traced.c.

◆ rotator_mutex

struct m0_mutex rotator_mutex
static

Definition at line 82 of file traced.c.

◆ save_kore

bool save_kore = true
static

Definition at line 74 of file traced.c.

◆ stats

struct m0_trace_stats stats
static

Definition at line 69 of file ktrace.c.

◆ stop_processing

volatile bool stop_processing = false
static

Definition at line 96 of file traced.c.

◆ trace_buf_size [1/2]

size_t trace_buf_size = M0_TRACE_UBUF_SIZE
static

Definition at line 60 of file utrace.c.

◆ trace_buf_size [2/2]

unsigned long trace_buf_size = M0_TRACE_KBUF_SIZE
static

Definition at line 65 of file ktrace.c.

◆ trace_file_path

char trace_file_path[PATH_MAX]
static

Definition at line 59 of file utrace.c.

◆ trace_immediate_mask

char* trace_immediate_mask
static

Definition at line 46 of file ktrace.c.

◆ trace_level

char* trace_level
static

Definition at line 52 of file ktrace.c.

◆ 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 },
}
Definition: trace.h:493
Definition: trace.h:482
Definition: trace.h:459
Definition: trace.h:478

The array of trace level names

◆ trace_magic_symbol

const uint64_t trace_magic_symbol = M0_TRACE_MAGIC
static

Definition at line 67 of file trace.c.

◆ trace_magic_symbol_name

const char trace_magic_symbol_name[] = "trace_magic_symbol"
static

Definition at line 68 of file trace.c.

◆ trace_print_context

char* trace_print_context
static

Definition at line 58 of file ktrace.c.

◆ 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

Definition at line 58 of file utrace.c.

◆ use_syslog

bool use_syslog = false
static

Definition at line 73 of file traced.c.

◆ write_data_mutex

struct m0_mutex write_data_mutex
static

Definition at line 81 of file traced.c.