flt.utils.muxer: deterministically order messages of same timestamps
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 17 Jul 2019 22:23:35 +0000 (18:23 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 8 Aug 2019 18:39:52 +0000 (14:39 -0400)
commit6915f47af2a34d05a98885d0aede730f8e3a0d6a
treebaea43c5c2767bdf86a95360f7f2275fcb14c0b9
parentfb739d291234e3cfbd89e8802d72aa2032ec0b0f
flt.utils.muxer: deterministically order messages of same timestamps

Issue
=====
The ordering of messages with the exact same timestamp is runtime
dependent. It is causing flakiness in tests using a `sink.text.details`
sink component where such differences in ordering is checked.

Note: It's common to have messages with the same timestamps because that
messages with no clock snapshot are assumed to happen at the same time
that of the previous message.

Solution
========
We need to order messages deterministically even when timestamps are the
same. This commit adds functions to order, in a predictable manner,
messages that have the same timestamp (or no timestamp at all) so that
they are sorted in the same way every time a trace is read.

With this commit:
* We first try to sort the messages by their trace name, stream class
  id, or stream id,
* If not possible, we check if the messages have different types and if
  they do, we sort them using the following scheme:
    SB < PB < EV < DE < MI < PE < DP < SE
* If they are of the same type, we sort them comparing their properties.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: Id6fc1fe8b19d02ec1804e54255a73c64820d1e13
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1719
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/utils/muxer/muxer.c
This page took 0.024599 seconds and 4 git commands to generate.