41 #define DEFAULT_MOTR_KO_IMG_PATH "/var/log/motr/m0tr_ko.img" 43 int main(
int argc,
char *argv[])
47 const char std_inout_file_name[] =
"-";
71 "input file name, if none is provided, then STDIN is used by" 73 LAMBDA(
void, (
const char *str) {
78 "output file name, if none is provided, then STDOUT is used by" 80 LAMBDA(
void, (
const char *str) {
85 "stream mode, each trace record is formatted as a" 86 " separate YAML document, so they can be fetched from" 87 " YAML stream one by one (this option has no effect as it's" 88 " 'on' by default, it has been kept for backward" 89 " compatibility, it's superseded by '-S' option)",
93 "disable stream mode (discards action of '-s' option)",
99 "dump only trace header information",
105 "path to m0tr.ko modules's core image (only required for" 106 " parsing kernel mode trace files), by default it is '" 108 LAMBDA(
void, (
const char *str) {
122 if (input_file ==
NULL)
123 err(EX_NOINPUT,
"Failed to open input file '%s'",
129 output_file = stdout;
132 if (output_file ==
NULL)
133 err(EX_CANTCREAT,
"Failed to open output file '%s'",
140 warnx(
"Error occurred while parsing input trace data");
#define M0_GETOPTS(progname, argc, argv,...)
int const char const void size_t int flags
static const char * output_file_name
int m0_init(struct m0 *instance)
#define M0_VOIDARG(ch, desc, func)
#define M0_STRINGARG(ch, desc, func)
int main(int argc, char *argv[])
void m0_node_uuid_string_set(const char *uuid)
static struct m0 instance
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)
M0_INTERNAL void m0_trace_set_mmapped_buffer(bool val)
static const char * input_file_name
#define DEFAULT_MOTR_KO_IMG_PATH