plugins: make text and utils component classes report support for MIP 1
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 28 Nov 2023 05:18:52 +0000 (00:18 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
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 <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7551
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7575

16 files changed:
src/plugins/text/details/details.c
src/plugins/text/details/details.h
src/plugins/text/dmesg/dmesg.c
src/plugins/text/dmesg/dmesg.h
src/plugins/text/plugin.c
src/plugins/text/pretty/pretty.c
src/plugins/text/pretty/pretty.h
src/plugins/utils/counter/counter.c
src/plugins/utils/counter/counter.h
src/plugins/utils/dummy/dummy.c
src/plugins/utils/dummy/dummy.h
src/plugins/utils/muxer/comp.cpp
src/plugins/utils/muxer/comp.hpp
src/plugins/utils/plugin.cpp
src/plugins/utils/trimmer/trimmer.c
src/plugins/utils/trimmer/trimmer.h

index c484e0559f41f0375297c4021c91a415757b3648..65ad9b7b1350a002c85045431554991df09ab633 100644 (file)
 #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)
 {
index 6adda8a6ed84b8d5beabb4722f2e1efacc78eb87..853ed6b3106ab2c622a5ef2b6607e33052328697 100644 (file)
@@ -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,
index 790b58d4b15a8901d7c66f3309be2d7e82dfa4fe..86c8c0e9cfeae1446a809ad64c731cf8b5de0c8e 100644 (file)
@@ -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)
index e3759318a5a42f2ae0448d60dbb3684db423dbde..71dced16967974e04c786e2173878c94661d814d 100644 (file)
 #include "common/macros.h"
 #include <babeltrace2/babeltrace.h>
 
+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,
index 21624b1490da2c6946313fc13a42649171defc77..37fb03eca256d4878b93dcca51a631ecc04c14a4 100644 (file)
@@ -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,
index 5b66576475e62f9040a6fe5da94672a44a5d3835..4550f159f2d9c4c07a62aad757362871c320935a 100644 (file)
 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)
 {
index f19b18c1093fd72f751b28672ffaef8588a78bd8..5438f9ffea4376acb8987a27887b743433bdbbc2 100644 (file)
@@ -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,
index 0ef6b8200483a43ea56261b7252835562e022588..9add177a0b69505da5155095c6a93408a1969ae7 100644 (file)
 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)
 {
index 302d699329ef9e25fdc0571152992228c9e8bc56..b52cbc4698129670b224c5e1c803980399931041 100644 (file)
@@ -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,
index e237bcbd257919f389137c214a6127b41f286e0e..6847ac2b9e090a87a6e74f3f6d5e02f39ba78362 100644 (file)
 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)
 {
index 29e4e7cd4eafbee33a65c223fa750e4d29a825d6..2ba82264015c64313f1f1513cc0b61e793aba355 100644 (file)
@@ -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,
index fb2a111936a1213594de541447862cdbb4de85e0..7cce5edbff9e3f7f965f19a7984ce250b5d5c7e1 100644 (file)
@@ -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();
index 5fe50c235e2bb2721c71760eddff9d65162a6a46..684c75b9856f3b744f3ad7fefc42d1216dd1ddfb 100644 (file)
@@ -24,6 +24,10 @@ class Comp final : public bt2::UserFilterComponent<Comp, MsgIter>
 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();
index 4878ab87da825ade42df332a220ab0cd126e2217..b83dd2229a4bb6fdc373993b8a79080eae3a2711 100644 (file)
@@ -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,
index d13a9fef3d4227f3abc7b741c2f2796e7c096501..bcc381a4f1f6187cc20938cc70d3a6b71b98b00e 100644 (file)
@@ -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)
 {
index d61374f87dcbd708fc63f2fa8080d53fc07ff3d5..d4a477f359d920faeebca9cbb71f5d31062d0092 100644 (file)
 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(
This page took 0.031215 seconds and 4 git commands to generate.