Fix: lttng-live discarded event count after inactivity
authorJulien Desfossez <jdesfossez@efficios.com>
Tue, 9 Jan 2018 22:12:54 +0000 (17:12 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Jan 2018 19:12:57 +0000 (14:12 -0500)
commit680ea180c84c5fdabdf078160559303b7e35fc89
tree70052c1a9fa2298a4656eb8bd0bf69892fcac36a
parenta82e6c948bf4bc3e0f02537b394e0bffa333ef0e
Fix: lttng-live discarded event count after inactivity

When a stream is inactive, the consumer produces fake indexes which are
beacons to let the viewer know a stream has not produced any data up to
a certain timestamp. These beacon are actually real packet indexes with
all the fields set to 0 except for the timestamp_end. Currently we keep
these beacons just like we keep real indexes. The problem is that when
we switch packet, we compare the events_discarded field in the index we
just received with the same field in the previous index. In the case
where a stream has been inactive, we have received inactivity beacons,
and set the discarded_event field to 0, so the difference with the next
real index might be wrong.

In fact, since the inactivity beacons are only used to push the
timestamp end of a stream, we don't need to keep them and we actually
need to keep most of the data from the real previous index. So we now
copy the entire prev_index into the cur_index when we receive an
inactivity beacon. We could refactor the code to avoid performing the
pointer swap of cur and prev indexes, but this implies a redesign of
much of the packet switching code which would affect other code paths.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/lttng-live/lttng-live-comm.c
This page took 0.024995 seconds and 4 git commands to generate.