lib/graph/iterator: use clock correlation validator util
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 21 Mar 2024 19:17:16 +0000 (15:17 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 26 Mar 2024 18:56:36 +0000 (14:56 -0400)
commit78d07b86b198c6d34673d6016e5926b4e50f21a4
treeb6cb776df4897ee304202166d034b356f4e9dcfb
parent879e4affa41282c93773c01801343db28e36980f
lib/graph/iterator: use clock correlation validator util

Make `graph/iterator.{c,h}` use the clock correlation validator
convenience library.

 - Replace the fields of `struct bt_message_iterator` that track the
   clock expectation state with a single `struct
   bt_clock_correlation_validator` field, only present if babeltrace is
   built in dev mode.

 - Initialize `bt_message_iterator::correlation_validator` in
   create_self_component_input_port_message_iterator.  Finalize it in
   `bt_message_iterator_destroy`.

 - Replace the bulk of
   `assert_post_dev_clock_classes_are_compatible_one` with one call to
   `bt_clock_correlation_validator_validate_message`.  If the latter
   returns an error, trigger an assertion failure based on the return
   error type and associated information.

The modifications in the Makefiles (adding `dummy.cpp`) are to force
linking with the C++ compiler driver.  This is necessary, since the
`libbabeltrace2.so` library now requires some symbols from the C++
standard library (e.g. `libstdc++.so`).  The `dummy.cpp` does not
actually need to exist.  This trick is described in the automake doc
[1].

[1] https://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries

Change-Id: I46a3a553d5e18eb6860d65d928ef33d941e9e951
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11990
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/Makefile.am
src/lib/graph/iterator.c
src/lib/graph/iterator.h
tests/lib/Makefile.am
tests/plugins/flt.lttng-utils.debug-info/Makefile.am
This page took 0.025355 seconds and 4 git commands to generate.