graph/mip: make bt_get_greatest_operative_mip_version compute operative MIP version
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 9 Feb 2024 21:25:24 +0000 (16:25 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
commit8f83c12b0c24f2e69e2283f4f4e8d2898ce77064
tree9819b26d598fd232460b7a6b09ab2b7a542eb62d
parentb9398f3353461f8319a95f75ee125ba36c360714
graph/mip: make bt_get_greatest_operative_mip_version compute operative MIP version

bt_get_greatest_operative_mip_version is currently implemented assuming
that the only existing MIP version is 0.  It only checks that all
component descriptors support version 0, and then returns 0 as the
computed operative MIP version.

Since the library now supports MIP versions 0 and 1,
bt_get_greatest_operative_mip_version needs to actually compute the
greatest commonly supported version.  Implement something that will work
for any number of MIP versions.

Change validate_operative_mip_version_in_array to
get_supported_mip_version_ranges, make it is solely reponsible for
calling the component class' get_supported_mip_versions method and
append the resulting range set to the `supported_ranges` array.  Or, if
the component class doesn't implement that method, append a range set
with only `[0, 0]`.

Once this is done, we have an array with range sets representing the
supported MIP versions for each soon-to-be component.  Compute (in the
new function find_greatest_compatible_mip_version) the greatest commonly
supported version, if any.

Change-Id: Ief0fe9d3323b4e150fa08282531b55ef15be75cf
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7579
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7572
src/lib/graph/mip.c
tests/Makefile.am
tests/lib/Makefile.am
tests/lib/test-mip.c [new file with mode: 0644]
This page took 0.024885 seconds and 4 git commands to generate.