Fix: source.ctf.lttng-live: assertion on equal messages
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 25 Oct 2019 21:32:42 +0000 (17:32 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 29 Oct 2019 21:25:21 +0000 (17:25 -0400)
commitba90bce7d0ad9b931293b4a722b5c2bec5bb6ebe
tree6b37d683c6b2bb57c0fa3c8c416bf0fc1f16bb67
parent0fb3cc654c80807743bfe16b67f4b0b48c9a1e32
Fix: source.ctf.lttng-live: assertion on equal messages

The following assertion fails when consuming a per-pid trace
of short-lived applications.
 (╯°□°)╯︵ ┻━┻  muxing.c:849: common_muxing_compare_messages(): Assertion `left_msg != right_msg` failed.

The live source performs a muxing step during which it can see that a
trace has ended. When that happens, the trace is removed from the
array of traces and the iteration on that array resumes from the
beginning. This causes the message comparator to assert as two
identical messages can be compared.

Not reseting the trace index to 0 causes the iteration to continue
from the same position in the array. This is fine since the "fast"
variant of the glib pointer array removal function replaces the
removed pointer by the last one. This is both more efficient and
solved the problem of comparing a message to itself (the oldest
message) during a second pass on the traces array.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I5045a0483b17f0bcb48ff7eb0d88f82bf19f68d4
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2262
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/plugins/ctf/lttng-live/lttng-live.c
This page took 0.024372 seconds and 4 git commands to generate.