[lttng-dev] babeltrace python binding and multiple streams with out of order samples
carlo.caione at gmail.com
Tue May 28 09:11:22 EDT 2019
I'm using the babeltrace python bindings (v1.5.x) to convert some raw
data I have into a CTF file.
This raw data is organized in fixed data chunks composed by serializing
the events for each CPU:
[cpu0, cpu0, cpu0, ..., cpu1, cpu1, cpu1, ..., cpu2,... ]
Each event for each CPU has a timestamp that is monotonic within each
I wanted to create one stream per CPU and since the events are the same
for each CPU, I was using a single stream_class linked to a stream
object for each CPU. Something in the structure similar to  with:
stream_cpu0 = writer.create_stream(stream_class)
stream_cpu1 = writer.create_stream(stream_class)
stream_cpu2 = writer.create_stream(stream_class)
The problem is that being the clock one for the stream_class when
feeding the events to the library I get a:
ValueError: Invalid time value
When the first event on cpu1 is parsed, because the timestamp is in the
past with respect to the timestamp of the latest event of the cpu0.
I can sort the events before feeding them to babeltrace but this seems
sub-optimal to me. My question is: am I using the library correctly or
there is any way to achieve this?
More information about the lttng-dev