From: Simon Marchi Date: Tue, 28 Nov 2023 05:18:52 +0000 (-0500) Subject: plugins: make text and utils component classes report support for MIP 1 X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=497c1e2072916b67a3d8aaddb211c0025998e01a;p=babeltrace.git plugins: make text and utils component classes report support for MIP 1 Make the following component classes report they support MIP 1 (everything from the text and utils plugins): - sink.text.details - source.text.dmesg - sink.text.pretty - sink.utils.counter - sink.utils.dummy - filter.utils.muxer - filter.utils.trimmer Change-Id: Ic2a6d3fbb2ac511d048d7b26de5811a64f24cc69 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/7551 Tested-by: jenkins Reviewed-by: Philippe Proulx Reviewed-on: https://review.lttng.org/c/babeltrace/+/7575 --- diff --git a/src/plugins/text/details/details.c b/src/plugins/text/details/details.c index c484e055..65ad9b7b 100644 --- a/src/plugins/text/details/details.c +++ b/src/plugins/text/details/details.c @@ -31,6 +31,16 @@ #define WITH_UUID_PARAM_NAME "with-uuid" #define COMPACT_PARAM_NAME "compact" +bt_component_class_get_supported_mip_versions_method_status +details_supported_mip_versions( + bt_self_component_class_sink *self_component_class __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *initialize_method_data __attribute__((unused)), + bt_logging_level logging_level __attribute__((unused)), + bt_integer_range_set_unsigned *supported_versions) { + return (int) bt_integer_range_set_unsigned_add_range(supported_versions, 0, 1); +} + void details_destroy_details_trace_class_meta( struct details_trace_class_meta *details_tc_meta) { diff --git a/src/plugins/text/details/details.h b/src/plugins/text/details/details.h index 6adda8a6..853ed6b3 100644 --- a/src/plugins/text/details/details.h +++ b/src/plugins/text/details/details.h @@ -148,6 +148,12 @@ struct details_comp { GString *str; }; +bt_component_class_get_supported_mip_versions_method_status +details_supported_mip_versions(bt_self_component_class_sink *self_component_class, + const bt_value *params, void *initialize_method_data, + bt_logging_level logging_level, + bt_integer_range_set_unsigned *supported_versions); + bt_component_class_initialize_method_status details_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, diff --git a/src/plugins/text/dmesg/dmesg.c b/src/plugins/text/dmesg/dmesg.c index 790b58d4..86c8c0e9 100644 --- a/src/plugins/text/dmesg/dmesg.c +++ b/src/plugins/text/dmesg/dmesg.c @@ -70,6 +70,17 @@ struct dmesg_component { bt_clock_class *clock_class; }; +bt_component_class_get_supported_mip_versions_method_status +dmesg_supported_mip_versions( + bt_self_component_class_source *self_component_class __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *initialize_method_data __attribute__((unused)), + bt_logging_level logging_level __attribute__((unused)), + bt_integer_range_set_unsigned *supported_versions) +{ + return (int) bt_integer_range_set_unsigned_add_range(supported_versions, 0, 1); +} + static bt_field_class *create_event_payload_fc(struct dmesg_component *dmesg_comp, bt_trace_class *trace_class) diff --git a/src/plugins/text/dmesg/dmesg.h b/src/plugins/text/dmesg/dmesg.h index e3759318..71dced16 100644 --- a/src/plugins/text/dmesg/dmesg.h +++ b/src/plugins/text/dmesg/dmesg.h @@ -11,6 +11,12 @@ #include "common/macros.h" #include +bt_component_class_get_supported_mip_versions_method_status +dmesg_supported_mip_versions(bt_self_component_class_source *self_component_class, + const bt_value *params, void *initialize_method_data, + bt_logging_level logging_level, + bt_integer_range_set_unsigned *supported_versions); + bt_component_class_initialize_method_status dmesg_init( bt_self_component_source *self_comp, bt_self_component_source_configuration *config, diff --git a/src/plugins/text/plugin.c b/src/plugins/text/plugin.c index 21624b14..37fb03ec 100644 --- a/src/plugins/text/plugin.c +++ b/src/plugins/text/plugin.c @@ -20,6 +20,8 @@ BT_PLUGIN_LICENSE("MIT"); /* pretty sink */ BT_PLUGIN_SINK_COMPONENT_CLASS(pretty, pretty_consume); +BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(pretty, + pretty_supported_mip_versions); BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(pretty, pretty_init); BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(pretty, pretty_finalize); BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(pretty, @@ -35,6 +37,8 @@ BT_PLUGIN_SOURCE_COMPONENT_CLASS_DESCRIPTION(dmesg, "Read Linux ring buffer lines (dmesg(1) output) from a file or from standard input."); BT_PLUGIN_SOURCE_COMPONENT_CLASS_HELP(dmesg, "See the babeltrace2-source.text.dmesg(7) manual page."); +BT_PLUGIN_SOURCE_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(dmesg, + dmesg_supported_mip_versions); BT_PLUGIN_SOURCE_COMPONENT_CLASS_INITIALIZE_METHOD(dmesg, dmesg_init); BT_PLUGIN_SOURCE_COMPONENT_CLASS_FINALIZE_METHOD(dmesg, dmesg_finalize); BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD(dmesg, @@ -46,6 +50,8 @@ BT_PLUGIN_SOURCE_COMPONENT_CLASS_MESSAGE_ITERATOR_CLASS_SEEK_BEGINNING_METHODS(d /* details sink */ BT_PLUGIN_SINK_COMPONENT_CLASS(details, details_consume); +BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(details, + details_supported_mip_versions); BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(details, details_init); BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(details, details_finalize); BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(details, diff --git a/src/plugins/text/pretty/pretty.c b/src/plugins/text/pretty/pretty.c index 5b665764..4550f159 100644 --- a/src/plugins/text/pretty/pretty.c +++ b/src/plugins/text/pretty/pretty.c @@ -25,6 +25,17 @@ static const char * const in_port_name = "in"; +bt_component_class_get_supported_mip_versions_method_status +pretty_supported_mip_versions( + bt_self_component_class_sink *self_component_class __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *initialize_method_data __attribute__((unused)), + bt_logging_level logging_level __attribute__((unused)), + bt_integer_range_set_unsigned *supported_versions) +{ + return (int) bt_integer_range_set_unsigned_add_range(supported_versions, 0, 1); +} + static void destroy_pretty_data(struct pretty_component *pretty) { diff --git a/src/plugins/text/pretty/pretty.h b/src/plugins/text/pretty/pretty.h index f19b18c1..5438f9ff 100644 --- a/src/plugins/text/pretty/pretty.h +++ b/src/plugins/text/pretty/pretty.h @@ -95,6 +95,12 @@ struct pretty_component { bt_self_component *self_comp; }; +bt_component_class_get_supported_mip_versions_method_status +pretty_supported_mip_versions(bt_self_component_class_sink *self_component_class, + const bt_value *params, void *initialize_method_data, + bt_logging_level logging_level, + bt_integer_range_set_unsigned *supported_versions); + bt_component_class_initialize_method_status pretty_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, diff --git a/src/plugins/utils/counter/counter.c b/src/plugins/utils/counter/counter.c index 0ef6b820..9add177a 100644 --- a/src/plugins/utils/counter/counter.c +++ b/src/plugins/utils/counter/counter.c @@ -33,6 +33,16 @@ static const char * const in_port_name = "in"; +bt_component_class_get_supported_mip_versions_method_status +counter_supported_mip_versions( + bt_self_component_class_sink *self_component_class __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *initialize_method_data __attribute__((unused)), + bt_logging_level logging_level __attribute__((unused)), + bt_integer_range_set_unsigned *supported_versions) { + return (int) bt_integer_range_set_unsigned_add_range(supported_versions, 0, 1); +} + static uint64_t get_total_count(struct counter *counter) { diff --git a/src/plugins/utils/counter/counter.h b/src/plugins/utils/counter/counter.h index 302d6993..b52cbc46 100644 --- a/src/plugins/utils/counter/counter.h +++ b/src/plugins/utils/counter/counter.h @@ -38,6 +38,12 @@ struct counter { bt_self_component *self_comp; }; +bt_component_class_get_supported_mip_versions_method_status +counter_supported_mip_versions(bt_self_component_class_sink *self_component_class, + const bt_value *params, void *initialize_method_data, + bt_logging_level logging_level, + bt_integer_range_set_unsigned *supported_versions); + bt_component_class_initialize_method_status counter_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, diff --git a/src/plugins/utils/dummy/dummy.c b/src/plugins/utils/dummy/dummy.c index e237bcbd..6847ac2b 100644 --- a/src/plugins/utils/dummy/dummy.c +++ b/src/plugins/utils/dummy/dummy.c @@ -18,6 +18,16 @@ static const char * const in_port_name = "in"; +bt_component_class_get_supported_mip_versions_method_status +dummy_supported_mip_versions( + bt_self_component_class_sink *self_component_class __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *initialize_method_data __attribute__((unused)), + bt_logging_level logging_level __attribute__((unused)), + bt_integer_range_set_unsigned *supported_versions) { + return (int) bt_integer_range_set_unsigned_add_range(supported_versions, 0, 1); +} + static void destroy_private_dummy_data(struct dummy *dummy) { diff --git a/src/plugins/utils/dummy/dummy.h b/src/plugins/utils/dummy/dummy.h index 29e4e7cd..2ba82264 100644 --- a/src/plugins/utils/dummy/dummy.h +++ b/src/plugins/utils/dummy/dummy.h @@ -19,6 +19,12 @@ struct dummy { bt_message_iterator *msg_iter; }; +bt_component_class_get_supported_mip_versions_method_status +dummy_supported_mip_versions(bt_self_component_class_sink *self_component_class, + const bt_value *params, void *initialize_method_data, + bt_logging_level logging_level, + bt_integer_range_set_unsigned *supported_versions); + bt_component_class_initialize_method_status dummy_init( bt_self_component_sink *component, bt_self_component_sink_configuration *config, diff --git a/src/plugins/utils/muxer/comp.cpp b/src/plugins/utils/muxer/comp.cpp index fb2a1119..7cce5edb 100644 --- a/src/plugins/utils/muxer/comp.cpp +++ b/src/plugins/utils/muxer/comp.cpp @@ -34,6 +34,12 @@ Comp::Comp(const bt2::SelfFilterComponent selfComp, const bt2::ConstMapValue par BT_CPPLOGI("Initialized component."); } +void Comp::_getSupportedMipVersions(bt2::SelfComponentClass, bt2::ConstValue, bt2::LoggingLevel, + const bt2::UnsignedIntegerRangeSet ranges) +{ + ranges.addRange(0, 1); +} + void Comp::_inputPortConnected(const bt2::SelfComponentInputPort, const bt2::ConstOutputPort) { this->_addAvailInputPort(); diff --git a/src/plugins/utils/muxer/comp.hpp b/src/plugins/utils/muxer/comp.hpp index 5fe50c23..684c75b9 100644 --- a/src/plugins/utils/muxer/comp.hpp +++ b/src/plugins/utils/muxer/comp.hpp @@ -24,6 +24,10 @@ class Comp final : public bt2::UserFilterComponent public: explicit Comp(bt2::SelfFilterComponent selfComp, bt2::ConstMapValue params, void *); +protected: + static void _getSupportedMipVersions(bt2::SelfComponentClass, bt2::ConstValue, + bt2::LoggingLevel, bt2::UnsignedIntegerRangeSet ranges); + private: void _inputPortConnected(bt2::SelfComponentInputPort selfPort, bt2::ConstOutputPort otherPort); void _addAvailInputPort(); diff --git a/src/plugins/utils/plugin.cpp b/src/plugins/utils/plugin.cpp index 4878ab87..b83dd222 100644 --- a/src/plugins/utils/plugin.cpp +++ b/src/plugins/utils/plugin.cpp @@ -25,6 +25,8 @@ BT_PLUGIN_LICENSE("MIT"); /* sink.utils.dummy */ BT_PLUGIN_SINK_COMPONENT_CLASS(dummy, dummy_consume); +BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(dummy, + dummy_supported_mip_versions); BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(dummy, dummy_init); BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(dummy, dummy_finalize); BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(dummy, dummy_graph_is_configured); @@ -33,6 +35,8 @@ BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(dummy, "See the babeltrace2-sink.utils.dummy /* sink.utils.counter */ BT_PLUGIN_SINK_COMPONENT_CLASS(counter, counter_consume); +BT_PLUGIN_SINK_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(counter, + counter_supported_mip_versions); BT_PLUGIN_SINK_COMPONENT_CLASS_INITIALIZE_METHOD(counter, counter_init); BT_PLUGIN_SINK_COMPONENT_CLASS_FINALIZE_METHOD(counter, counter_finalize); BT_PLUGIN_SINK_COMPONENT_CLASS_GRAPH_IS_CONFIGURED_METHOD(counter, counter_graph_is_configured); @@ -42,6 +46,8 @@ BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(counter, /* flt.utils.trimmer */ BT_PLUGIN_FILTER_COMPONENT_CLASS(trimmer, trimmer_msg_iter_next); +BT_PLUGIN_FILTER_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD(trimmer, + trimmer_supported_mip_versions); BT_PLUGIN_FILTER_COMPONENT_CLASS_DESCRIPTION( trimmer, "Discard messages that occur outside a specific time range."); BT_PLUGIN_FILTER_COMPONENT_CLASS_HELP(trimmer, diff --git a/src/plugins/utils/trimmer/trimmer.c b/src/plugins/utils/trimmer/trimmer.c index d13a9fef..bcc381a4 100644 --- a/src/plugins/utils/trimmer/trimmer.c +++ b/src/plugins/utils/trimmer/trimmer.c @@ -127,6 +127,17 @@ struct trimmer_iterator_stream_state { const bt_packet *cur_packet; }; +bt_component_class_get_supported_mip_versions_method_status +trimmer_supported_mip_versions( + bt_self_component_class_filter *self_component_class __attribute__((unused)), + const bt_value *params __attribute__((unused)), + void *initialize_method_data __attribute__((unused)), + bt_logging_level logging_level __attribute__((unused)), + bt_integer_range_set_unsigned *supported_versions) +{ + return (int) bt_integer_range_set_unsigned_add_range(supported_versions, 0, 1); +} + static void destroy_trimmer_comp(struct trimmer_comp *trimmer_comp) { diff --git a/src/plugins/utils/trimmer/trimmer.h b/src/plugins/utils/trimmer/trimmer.h index d61374f8..d4a477f3 100644 --- a/src/plugins/utils/trimmer/trimmer.h +++ b/src/plugins/utils/trimmer/trimmer.h @@ -16,6 +16,13 @@ extern "C" { #endif +bt_component_class_get_supported_mip_versions_method_status +trimmer_supported_mip_versions( + bt_self_component_class_filter *self_component_class, + const bt_value *params, void *initialize_method_data, + bt_logging_level logging_level, + bt_integer_range_set_unsigned *supported_versions); + void trimmer_finalize(bt_self_component_filter *self_comp); bt_component_class_initialize_method_status trimmer_init(