From: Simon Marchi Date: Tue, 22 Oct 2024 19:48:45 +0000 (-0400) Subject: lib: add bt_field_class_get_graph_mip_version() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=bd7167cc5674a8e0a6feec619fc31eaf6f14f817;p=babeltrace.git lib: add bt_field_class_get_graph_mip_version() 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 Change-Id: I97b4a440020cb006bee9a79a5dce9cbade565914 Reviewed-on: https://review.lttng.org/c/babeltrace/+/13395 Reviewed-by: Philippe Proulx --- diff --git a/include/babeltrace2/trace-ir/field-class.h b/include/babeltrace2/trace-ir/field-class.h index 86ba837c..35b3e4bc 100644 --- a/include/babeltrace2/trace-ir/field-class.h +++ b/include/babeltrace2/trace-ir/field-class.h @@ -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() — + 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; + /*! @} */ /*! diff --git a/src/lib/trace-ir/field-class.c b/src/lib/trace-ir/field-class.c index 1db22766..92eacee2 100644 --- a/src/lib/trace-ir/field-class.c +++ b/src/lib/trace-ir/field-class.c @@ -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) {