lib: add bt_field_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_field_class_get_graph_mip_version, which returns the MIP version
for the graph the field class is in, for the same reason as explained in
fbc90342dade ("lib: add bt_trace_class_get_graph_mip_version") for trace
class.

Note to Phil: I don't know where to put the function declaration in the
header, perhaps a new section is needed.

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

index 86ba837cd2e57cef867c04564034e1ff74a3935a..35b3e4bc6a6ea746b35510a81c818632580ecf81 100644 (file)
@@ -6300,6 +6300,27 @@ bt_field_class_variant_with_selector_field_integer_signed_option_as_option_const
        return __BT_UPCAST_CONST(bt_field_class_variant_option, option);
 }
 
+/*!
+@brief
+    Returns the effective \bt_mip (MIP) version of the trace processing
+    \bt_graph containing the \bt_comp from which \bt_p{field_class} was
+    created.
+
+@param[in] field_class
+    Field class of which to get the effective MIP version.
+
+@returns
+    Effective MIP version of \bt_p{field_class}.
+
+@bt_pre_not_null{field_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_field_class_get_graph_mip_version(
+               const bt_field_class *field_class) __BT_NOEXCEPT;
+
 /*! @} */
 
 /*!
index 1db22766e5322cf6188d9426539f019d3642b29e..92eacee2d6ba6e10a6c19791f0cd7d1273c4b36a 100644 (file)
@@ -3355,6 +3355,14 @@ bt_field_class_blob_dynamic_with_length_field_borrow_length_field_location_const
        return blob_fc->length_fl;
 }
 
+BT_EXPORT
+uint64_t bt_field_class_get_graph_mip_version(
+               const bt_field_class *field_class)
+{
+       BT_ASSERT_PRE_DEV_FC_NON_NULL(field_class);
+       return field_class->mip_version;
+}
+
 BT_EXPORT
 void bt_field_class_get_ref(const struct bt_field_class *field_class)
 {
This page took 0.027681 seconds and 4 git commands to generate.