Fix: muxer: check for MUXER_MSG_ITER_CLOCK_CLASS_EXPECTATION_NONE in validate_new_str...
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 9 Aug 2019 20:30:09 +0000 (16:30 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 10 Aug 2019 17:36:51 +0000 (13:36 -0400)
There is a problem currently when trying to send multiple streams that
don't have a clock class (which is a supported use case) to a muxer
instance.

The first time we enter validate_new_stream_clock_class without a clock
class, we set the expectation to
MUXER_MSG_ITER_CLOCK_CLASS_EXPECTATION_NONE.  The second time we enter
without a clock class, we wrongfully go to the error case.  We are
missing a check for MUXER_MSG_ITER_CLOCK_CLASS_EXPECTATION_NONE, which
is the expected and valid case.  This patch adds it.

Also, the error message is erroneous.  If we are in that situation, we
expect a stream class _without_ a clock class, but are met with a stream
class _with_ a clock class.  Fix that at the same time.

Change-Id: Iea692578498ea87a33ecba5d2fd54b2980056cd0
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1862
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/utils/muxer/muxer.c

index 6cf8ae6c65751a437214b8b6dc781f9fa14a59e8..ecd5d8d92f059147f0bec1f01dceae1b6ed94b8a 100644 (file)
@@ -833,8 +833,9 @@ int validate_new_stream_clock_class(struct muxer_msg_iter *muxer_msg_iter,
                        /* Expect no clock class */
                        muxer_msg_iter->clock_class_expectation =
                                MUXER_MSG_ITER_CLOCK_CLASS_EXPECTATION_NONE;
-               } else {
-                       BT_COMP_LOGE("Expecting stream class with a default clock class: "
+               } else if (muxer_msg_iter->clock_class_expectation !=
+                               MUXER_MSG_ITER_CLOCK_CLASS_EXPECTATION_NONE) {
+                       BT_COMP_LOGE("Expecting stream class without a default clock class: "
                                "stream-class-addr=%p, stream-class-name=\"%s\", "
                                "stream-class-id=%" PRIu64,
                                stream_class, bt_stream_class_get_name(stream_class),
This page took 0.025888 seconds and 4 git commands to generate.