lib: bt_graph_create(): accept MIP version
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 11 Aug 2019 03:24:13 +0000 (23:24 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 13 Aug 2019 00:28:02 +0000 (20:28 -0400)
commit056deb59eb33e87c06c0067907768ab08aff74a2
tree8e28c1d4969b56b08d9bdf224f134fcb024e7c40
parentf1f741737f03892d781ed00de554606eeea84c15
lib: bt_graph_create(): accept MIP version

This patch makes bt_graph_create() accept the message interchange
protocol (MIP) version with which to configure the graph.

This MIP version will usually come from
bt_get_greatest_operative_mip_version() or bt_get_maximal_mip_version().

The components can access the configured MIP version with
bt_self_component_get_graph_mip_version().

As of this patch the only possible MIP version is 0. bt_graph_create()
does not accept a MIP version that is greater than
bt_get_maximal_mip_version() because almost all the library functions
need to know the configured MIP version to behave accordingly, should
the semantics change in the future.

In Python, Graph.__init__() accepts a `mip_version` parameter which
defaults to 0. A Python component can get the configured MIP version of
its operating graph with the `_UserComponent._graph_mip_version`
property.

All the sites where bt_graph_create() is called pass 0 to it. This is
correct for tests as we always control the component classes and
initialization parameters, so we know that 0 is always supported by
them. The locations where bt_get_greatest_operative_mip_version() must
be used are the CLI and `bt2.TraceCollectionMessageIterator`. Those
sites will be addressed by subsequent patches.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I324a317922a8caa5557043ae02b97e58fc91d92d
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1878
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
14 files changed:
include/babeltrace2/graph/graph.h
include/babeltrace2/graph/self-component.h
src/bindings/python/bt2/bt2/component.py
src/bindings/python/bt2/bt2/graph.py
src/cli/babeltrace2.c
src/lib/graph/component.c
src/lib/graph/graph.c
src/lib/graph/graph.h
tests/bindings/python/bt2/test_component.py
tests/bindings/python/bt2/test_graph.py
tests/lib/plugin.c
tests/lib/test_graph_topo.c
tests/lib/test_simple_sink.c
tests/lib/test_trace_ir_ref.c
This page took 0.025979 seconds and 4 git commands to generate.