From: Simon Marchi Date: Fri, 5 May 2023 17:41:02 +0000 (-0400) Subject: lib: record MIP version in clock class X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=84311dbc1c5b70348e09b671d297afc4ffc875db;p=babeltrace.git lib: record MIP version in clock class 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 Reviewed-on: https://review.lttng.org/c/babeltrace/+/12675 Reviewed-by: Philippe Proulx Tested-by: jenkins --- diff --git a/src/lib/trace-ir/clock-class.c b/src/lib/trace-ir/clock-class.c index 886501ec..78fa1cb9 100644 --- a/src/lib/trace-ir/clock-class.c +++ b/src/lib/trace-ir/clock-class.c @@ -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( diff --git a/src/lib/trace-ir/clock-class.h b/src/lib/trace-ir/clock-class.h index 50df464b..3c2243d1 100644 --- a/src/lib/trace-ir/clock-class.h +++ b/src/lib/trace-ir/clock-class.h @@ -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;