lib: add bt_clock_class_get_graph_mip_version()
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 22 Oct 2024 19:48:45 +0000 (15:48 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 4 Nov 2024 16:17:44 +0000 (11:17 -0500)
Add bt_clock_class_get_graph_mip_version, which returns the MIP version
for the graph the clock class is in, for the same reason as explained in
fbc90342dade ("lib: add bt_trace_class_get_graph_mip_version") for trace
class.

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

index f1861dee9f976546e488d1826154886becf52850..da2d327a24d16da3f6b4133ba366763971545be1 100644 (file)
@@ -1479,6 +1479,27 @@ See bt_clock_class_borrow_user_attributes().
 extern const bt_value *bt_clock_class_borrow_user_attributes_const(
                const bt_clock_class *clock_class) __BT_NOEXCEPT;
 
+/*!
+@brief
+    Returns the effective \bt_mip (MIP) version of the trace processing
+    \bt_graph containing the \bt_comp from which
+    \bt_p{clock_class} was created.
+
+@param[in] clock_class
+    Clock class of which to get the effective MIP version.
+
+@returns
+    Effective MIP version of \bt_p{clock_class}.
+
+@bt_pre_not_null{clock_class}
+
+@sa bt_self_component_get_graph_mip_version() &mdash;
+    Returns the effective MIP version of the trace processing
+    graph which contains a given component.
+*/
+extern uint64_t bt_clock_class_get_graph_mip_version(
+               const bt_clock_class *clock_class) __BT_NOEXCEPT;
+
 /*! @} */
 
 /*!
index 70777b8cbe1ccd38d8d684af297476d2019f81dc..d642f033b4455cafea61c22c34ca2557c3cf539b 100644 (file)
@@ -614,6 +614,14 @@ void bt_clock_class_set_user_attributes(
        bt_object_get_ref_no_null_check(clock_class->user_attributes);
 }
 
+BT_EXPORT
+uint64_t bt_clock_class_get_graph_mip_version(
+               const bt_clock_class *clock_class)
+{
+       BT_ASSERT_PRE_DEV_CLK_CLS_NON_NULL(clock_class);
+       return clock_class->mip_version;
+}
+
 BT_EXPORT
 void bt_clock_class_get_ref(const struct bt_clock_class *clock_class)
 {
This page took 0.025692 seconds and 4 git commands to generate.