I am trying to use the babeltrace lib to read a trace file. So here it the flow: 1. babeltrace /var/log/some_trace > trc.txt 2. My program does this in trying to add a trace after creating context:
code
int err = bt_context_add_trace(ctx, path, "text", nullptr,
nullptr, nullptr);
code
- Compile and Run the program gives this error: code [error] [Context] Format "text" unknown. code
The idea is that I have trace generated on multiple machines - and though I can use my program to directly read the binary trace files on my local system, for other systems, I convert the trace using babeltrace and then process all these traces together.
The package I have installed is this: babeltrace-devel-1.2.4-1.el7.x86_64
The third parameter of
bt_context_add_traceis the input format's name. For binary (CTF) traces, you will want to use the"ctf"format, rather than"text". You can use the latter as your output format, however.