lib: restrict bt_clock_class_{g,s}et_uuid to MIP 0
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 5 May 2023 17:44:25 +0000 (13:44 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
Change-Id: Id689c9b470f03837355216a56e8e44b2724fd7cd
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12676
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/lib/assert-cond.h
src/lib/trace-ir/clock-class.c

index 46224ce4e1d6359e0ee1c76746948e5984a443f4..cba1655ae388c584a93a557729695bac43e71748 100644 (file)
                _mip_version >= _val,                                           \
                "MIP version is less than %" PRIu64, _val)
 
+/*
+ * Asserts that the effective MIP version for `_clock_class` is equal to `_val`.
+ */
+#define BT_ASSERT_PRE_CC_MIP_VERSION_EQ(_clock_class, _val)            \
+       BT_ASSERT_PRE_MIP_VERSION_EQ((_clock_class)->mip_version, _val)
+
 /*
  * Asserts that the effective MIP version for `_trace_class` is equal to `_val`.
  */
index 78fa1cb9418cce005caf5dbbb381fda77081f90b..0a6437ec562823f78452ac9e405bff614fa00616 100644 (file)
@@ -251,6 +251,7 @@ BT_EXPORT
 bt_uuid bt_clock_class_get_uuid(const struct bt_clock_class *clock_class)
 {
        BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
+       BT_ASSERT_PRE_CC_MIP_VERSION_EQ(clock_class, 0);
        return clock_class->uuid.value;
 }
 
@@ -261,6 +262,7 @@ void bt_clock_class_set_uuid(struct bt_clock_class *clock_class,
        BT_ASSERT_PRE_CLK_CLS_NON_NULL(clock_class);
        BT_ASSERT_PRE_UUID_NON_NULL(uuid);
        BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
+       BT_ASSERT_PRE_CC_MIP_VERSION_EQ(clock_class, 0);
        bt_uuid_copy(clock_class->uuid.uuid, uuid);
        clock_class->uuid.value = clock_class->uuid.uuid;
        BT_LIB_LOGD("Set clock class's UUID: %!+K", clock_class);
This page took 0.025408 seconds and 4 git commands to generate.