[lttng-dev] babeltrace converting text <=> ctf

Sebastian Andrzej Siewior bigeasy at linutronix.de
Thu Feb 14 06:54:04 EST 2013


I started lltng to dump a few kernel events, nothing special. Once I had
the binary CTF I converted it to text output via

|babeltrace -w trace.txt kernel/

| [10:40:10.357768920] (+?.?????????) squsb kmalloc: { cpu_id = 3 }, { call_site = …
| [10:40:10.357785010] (+0.000016090) squsb kfree: { cpu_id = 3 }, { call_site = …
| [10:40:10.357800700] (+0.000015690) squsb kmalloc: { cpu_id = 3 }, { call_site = …

and now back to CTF. Since babeltrace does not support text as input or
CTF as output (and the error message was not giving a hint) I tried it
with babeltrace-log:

|babeltrace-log < trace.txt ctf_v1

and now back to text:

|babeltrace -w ctv_v1.txt ctf_v1

and I got:

| 0 string: { }, { str = "[10:40:10.357768920] (+?.?????????) squsb kmalloc: { cpu_id = 3 }, { call_site = …
| 0 string: { }, { str = "[10:40:10.357785010] (+0.000016090) squsb kfree: { cpu_id = 3 }, { call_site = …
| 0 string: { }, { str = "[10:40:10.357800700] (+0.000015690) squsb kmalloc: { cpu_id = 3 }, { call_site = …

What I don't like here, is that the timestamp information is lost.
Looking at babeltrace-log I noticed a timestamp option. So I tried this:

|babeltrace-log -t < trace.txt ctf_v2
|babeltrace -w ctv_v2.txt ctf_v2
|[error] Invalid magic number 0x0 at packet 26 (file offset 851968).
|[error] Open file stream error.

buh. After looking at babeltrace-log I noticed that the sscanf() does
not match anything because the timestamp value is different. So I tried
to change the input so the sscanf() will match:

|babeltrace -w trace_seconds.txt --clock-seconds kernel/
|babeltrace-log -t < trace_seconds.txt ctf_v3
|babeltrace -w ctf_v3.txt ctf_v3/
|[error] Invalid magic number 0x1F72CF7C at packet 81 (file offset 2654208).
|[error] Open file stream error.

Little different but still doesn't work.
Could this be an user error or an easy to spot CTF libary bug?

Sebastian



More information about the lttng-dev mailing list