bt2: pass all params to `babeltrace.trace-info` query when computing stream intersection
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 3 Sep 2019 14:35:23 +0000 (10:35 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:23 +0000 (11:58 -0400)
commit8762085cd04d132388386f5020d882cfe1424b12
tree3569ea1ac933bb32952e4bee3f64ef1e468526fd
parent2532cf78d0cd0fec227267685be6cc5383ac7303
bt2: pass all params to `babeltrace.trace-info` query when computing stream intersection

TraceCollectionMessageIterator currently makes it mandatory to pass an
`inputs` parameter to source components when using the stream
intersection mode.  It then picks out that parameter and passes just by
itself to the `babeltrace.trace-info` query.

This is not right for two reasons:

1. The `babeltrace.trace-info` query should be executed with the same
   parameters as what the component will be created with.  This is because
   some parameters can influence the response of the query, such as
   `clock-class-offset-ns` for `src.ctf.fs`.
2. The `inputs` parameter is not mandatory.  It is a convention to which
   source component classes can adhere to work with auto source discovery,
   but it's not mandatory.  Stream intersection mode should work even with
   a source component class that doesn't use it.

A test is added, where a CTF trace is read using the stream intersection
mode, as well as a `clock-class-offset-s` parameter.  Without this
patch, the test would fail because the trimmer components would be
created with a range that doesn't consider the offset.  Therefore all
messages produced by the source (which have the offset applied) fall
outside the trimmers' ranges.  With this patch, the
`babeltrace.trace-info` query returns stream ranges with the offset
applied, so the trimmers have the correct ranges.

Change-Id: I79c86cafafe123c6d306d196d5dde71002b711f7
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1998
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/bt2/trace_collection_message_iterator.py
tests/bindings/python/bt2/test_trace_collection_message_iterator.py
This page took 0.027322 seconds and 4 git commands to generate.