Fix: flt.utils.trimmer: no error when upstream can not seek
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 22 May 2019 19:33:33 +0000 (15:33 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 28 May 2019 12:32:13 +0000 (08:32 -0400)
commit419f470d5477e5fd9c5baf5101639e20613fca27
treea77dfd645a8c38c7f3e21748e18e1002a8aa73d7
parentb368d55308eccd26f9ccdebc27cdafdac4087fd5
Fix: flt.utils.trimmer: no error when upstream can not seek

Issue
=====
According to commit 7de0e49, every upstream message iterators of a
`flt.utils.trimmer` must support seeking. If it's not the case, the
graph should fail gracefully.

I encountered a situation where this invariant is not held. I can
reproduce this issue by commenting out the `_SEEK_BEGINNING_METHOD()`
and `_CAN_SEEK_BEGINNING_METHOD()` of the `flt.utils.muxer` and ran the
following graph:
  babeltrace run \
  --component=src:src.ctf.fs \
  --params='paths=["/home/frdeso/lttng-traces/auto-20181210-133612"]' \
  --component=mux:filter.utils.muxer  \
  --component=trim:filter.utils.trimmer \
  --params='begin="13:36:12.871289834",end="13:36:12.871303475"' \
  --component=sink:sink.text.pretty \
  \
  --connect=src.*:mux.* \
  --connect=mux.*:trim.* \
  --connect=trim.*:sink.*
Note: The `begin` and `end` parameters are event timestamps from the trace.

When the trimmer component sees that seeking is not supported, it simply
skip the seeking and continue. This triggers a `BT_ASSERT()` later on.

See commit message 7474e7d3f0d005280c6614be5c818735e65d8b3b for more details on
seeking.
See commit message 7de0e49a7c4bb3c04075703e6767d15b7beb277f for more details on
trimmer.

Solution
========
Error out if seeking is disabled on upstream message iterators.

Drawbacks
=========
None.

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