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)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2019 15:38:52 +0000 (11:38 -0400)
commit3f3d89b4f77852d8df9c11e909e9ed5fa03218ed
tree9c42ac15459da9439515ff7368110772b364eb44
parent30947af01a064c13fd12c8faf8f13e3d9fd8087f
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.0244 seconds and 4 git commands to generate.