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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:20 +0000 (11:58 -0400)
commitc3923e1ffbb10370c0133db1e5b08cdc6080bdd3
treed9644ff634cf18717301c54ff1b71efae7c5ad5b
parent013ff1e5cf14eee9b210a0d8763051c93c624ac8
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.024835 seconds and 4 git commands to generate.