lib: record MIP version in clock class
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 5 May 2023 17:41:02 +0000 (13:41 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
Record the graph's MIP version in struct bt_clock_class, so that we can
check in in clock class API functions.

Change-Id: I88b6a2f79c24706a5e9eae9199ff7c3862afc0dc
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12675
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/lib/trace-ir/clock-class.c
src/lib/trace-ir/clock-class.h

index 886501ec3b0944888cdea1ea5ce769bd965cf312..78fa1cb9418cce005caf5dbbb381fda77081f90b 100644 (file)
@@ -22,6 +22,8 @@
 #include "common/assert.h"
 #include "lib/func-status.h"
 #include "lib/value.h"
+#include "lib/graph/component.h"
+#include "lib/graph/graph.h"
 
 #define BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(_cc)                         \
        BT_ASSERT_PRE_DEV_HOT("clock-class", (_cc), "Clock class",      \
@@ -74,6 +76,9 @@ struct bt_clock_class *bt_clock_class_create(bt_self_component *self_comp)
 
        bt_object_init_shared(&clock_class->base, destroy_clock_class);
 
+       clock_class->mip_version =
+               bt_component_borrow_graph((void *) self_comp)->mip_version;
+
        clock_class->user_attributes = bt_value_map_create();
        if (!clock_class->user_attributes) {
                BT_LIB_LOGE_APPEND_CAUSE(
index 50df464b4e263e9ce7ea067ee9f806c3612187d6..3c2243d1fe05b2c37182be0ba4ebab10cb3a82dd 100644 (file)
@@ -24,6 +24,9 @@
 struct bt_clock_class {
        struct bt_object base;
 
+       /* Effective MIP version for this clock class */
+       uint64_t mip_version;
+
        /* Owned by this */
        struct bt_value *user_attributes;
 
This page took 0.02523 seconds and 4 git commands to generate.