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

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon May 6 23:01:44 EDT 2013


* Sebastian Andrzej Siewior (bigeasy at linutronix.de) wrote:
> 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 is made to go from a dmesg output to CTF.

> 
> |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?

babeltrace-log is not meant to convert from CTF pretty-printing output,
but rather from dmesg logs.

What you seem to be looking for is a CTF pretty-printed log format to
CTF converter, which does not exist today.

Sorry for the late reply,

Thanks,

Mathieu

> 
> Sebastian
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list