All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: babeltrace python binding and multiple streams with out of order samples
       [not found] <ee93b1b8-6e02-d40a-067a-99ab88b2cadf@gmail.com>
@ 2019-06-10 17:59 ` Jérémie Galarneau
  0 siblings, 0 replies; 2+ messages in thread
From: Jérémie Galarneau @ 2019-06-10 17:59 UTC (permalink / raw)
  To: Carlo Caione; +Cc: lttng-dev


[-- Attachment #1.1: Type: text/plain, Size: 2139 bytes --]

Hi Carlo,

Events do indeed need to be passed in order. You
can use a heap to sort the streams as they are read. This is the strategy
used
by babeltrace to multiplex streams and present them chronologically.

Otherwise, if the streams contain the same event descriptions, you could
convert
the per-CPU event sets independently and combine the stream files with
a single metadata file to obtain a "complete" trace.

Regards,
Jérémie

On Tue, 28 May 2019 at 09:11, Carlo Caione <carlo.caione@gmail.com> wrote:

> Hi,
> 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
> CPU set.
>
> 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 [0] 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?
>
> Thank you,
>
> [0] https://lists.lttng.org/pipermail/lttng-dev/2015-November/025231.html
>
> --
> Carlo Caione
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>


-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

[-- Attachment #1.2: Type: text/html, Size: 3090 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

* babeltrace python binding and multiple streams with out of order samples
@ 2019-05-28 13:11 Carlo Caione
  0 siblings, 0 replies; 2+ messages in thread
From: Carlo Caione @ 2019-05-28 13:11 UTC (permalink / raw)
  To: lttng-dev

Hi,
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 
CPU set.

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 [0] 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?

Thank you,

[0] https://lists.lttng.org/pipermail/lttng-dev/2015-November/025231.html

--
Carlo Caione

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-10 17:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ee93b1b8-6e02-d40a-067a-99ab88b2cadf@gmail.com>
2019-06-10 17:59 ` babeltrace python binding and multiple streams with out of order samples Jérémie Galarneau
2019-05-28 13:11 Carlo Caione

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.