[lttng-dev] babeltrace and strictly sorting events

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue May 7 11:29:31 EDT 2013


* Thibault, Daniel (Daniel.Thibault at drdc-rddc.gc.ca) wrote:
>    Babeltrace sorts the events submitted to it from a variety of
>    source files (multiple traces, each potentially with multiple
>    domains, each potentially with multiple sources (for UST anyway),
>    each potentially with multiple channels, each potentially with
>    multiple CPU IDs) based on timestamps (babeltrace/lib/iterator.c's
>    stream_compare).  This works fine, but what about the case where
>    two events have strictly the same timestamp?  Within a single host,
>    this can only happen if they have different CPU IDs.  It can also
>    happen when merging traces from different hosts.  As it currently
>    stands, stream_compare looks at the timestamps only, so the
>    ordering in the aforementioned cases is undefined (left to the luck
>    of the heap sort).

makes sense.

> 
>    I think stream_compare needs to also check for
>    (s_a->parent.real_timestamp == s_b->parent.real_timestamp) and, in
>    that case only, compare hosts (alphabetical ordering is as good as
>    any), then CPU IDs (numerical ordering).  Obviously, this is a
>    potentially expensive change since this function is called awfully
>    often when babeltracing or lttngtopping large traces, so maybe the
>    extra tests could be controlled by a command option (called
>    --strict-ordering, say).

These extra checks would only be needed with timestamps are equal (which
is rare). So no perceivable performance impact should be measurable.

> 
>    Or is this so rare it's not worth bothering with?  In which case a
>    small cautionary note in babeltrace's man pages would be enough
>    (those man pages really ought to state that babeltrace's output is
>    time-ordered; right now they don't mention this at all).

It's kind of rare, but could be worthwhile to add. Please open a feature
request on the bug tracker against babeltrace.

Thanks,

Mathieu

> 
> Daniel U. Thibault
> R & D pour la défense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier)
> Cyber sécurité pour les missions essentielles (CME) / Mission Critical Cyber Security (MCCS)
> Protection des systèmes et contremesures (PSC) / Systems Protection & Countermeasures (SPC)
> 2459 route de la Bravoure
> Québec, QC  G3J 1X5
> CANADA
> Vox : (418) 844-4000 x4245
> Fax : (418) 844-4538
> NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
> Gouvernement du Canada / Government of Canada
> <http://www.valcartier.drdc-rddc.gc.ca/>
> 
> _______________________________________________
> 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