From 59225a3e0e13a9c674234755e55055d9ff68d635 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 17 Sep 2019 12:44:36 -0400 Subject: [PATCH] lib: pass config objects to component init methods This patch introduces configuration objects that are passed to init methods of components. The goal is to make it possible to have parameters that can be set during the component's init phase, and not after. At the moment, they are not used for anything, they are only there for future use. For that reason, we currently just pass the value NULL as the config objects to the components. This should be fine, since the components should not do anything with the config objects for now. Similarly, we have configuration Python objects passed to __init__ methods of _UserMessageIterator objects. These configuration objects are empty, but we can connect them with the corresponding SWIG pointer once we actually add a method in them. I added tests to verify that the config objects the components receive have the right types. Change-Id: If7568160e225c1eb8343eb212f8b4961f5472836 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/2063 Reviewed-by: Philippe Proulx Reviewed-by: Francis Deslauriers --- .../graph/component-class-filter.h | 1 + .../babeltrace2/graph/component-class-sink.h | 1 + .../graph/component-class-source.h | 1 + include/babeltrace2/types.h | 3 + src/bindings/python/bt2/bt2/component.py | 33 ++++++- .../bt2/bt2/native_bt_component_class.i.h | 3 + .../bt2/trace_collection_message_iterator.py | 2 +- src/lib/graph/component-class-sink-simple.c | 3 +- src/lib/graph/graph.c | 8 +- src/plugins/ctf/fs-sink/fs-sink.c | 4 +- src/plugins/ctf/fs-sink/fs-sink.h | 1 + src/plugins/ctf/fs-src/fs.c | 1 + src/plugins/ctf/fs-src/fs.h | 1 + src/plugins/ctf/lttng-live/lttng-live.c | 4 +- src/plugins/ctf/lttng-live/lttng-live.h | 1 + .../lttng-utils/debug-info/debug-info.c | 1 + .../lttng-utils/debug-info/debug-info.h | 1 + src/plugins/text/details/details.c | 4 +- src/plugins/text/details/details.h | 1 + src/plugins/text/dmesg/dmesg.c | 1 + src/plugins/text/dmesg/dmesg.h | 1 + src/plugins/text/pretty/pretty.c | 4 +- src/plugins/text/pretty/pretty.h | 4 +- src/plugins/utils/counter/counter.c | 1 + src/plugins/utils/counter/counter.h | 1 + src/plugins/utils/dummy/dummy.c | 1 + src/plugins/utils/dummy/dummy.h | 1 + src/plugins/utils/muxer/muxer.c | 1 + src/plugins/utils/muxer/muxer.h | 1 + src/plugins/utils/trimmer/trimmer.c | 1 + src/plugins/utils/trimmer/trimmer.h | 4 +- tests/bindings/python/bt2/test_clock_class.py | 2 +- tests/bindings/python/bt2/test_component.py | 48 ++++++++-- tests/bindings/python/bt2/test_connection.py | 12 +-- tests/bindings/python/bt2/test_error.py | 8 +- tests/bindings/python/bt2/test_event.py | 2 +- tests/bindings/python/bt2/test_event_class.py | 2 +- tests/bindings/python/bt2/test_field.py | 2 +- tests/bindings/python/bt2/test_field_class.py | 2 +- tests/bindings/python/bt2/test_graph.py | 58 ++++++------ tests/bindings/python/bt2/test_message.py | 2 +- .../python/bt2/test_message_iterator.py | 58 ++++++------ tests/bindings/python/bt2/test_port.py | 90 +++++++++---------- tests/bindings/python/bt2/utils.py | 6 +- .../grouping/bt_plugin_test.py | 6 +- .../params-log-level/bt_plugin_test.py | 4 +- tests/data/cli/params/bt_plugin_params.py | 2 +- .../flt.utils.muxer/bt_plugin_muxer_test.py | 2 +- .../bt_plugin_trimmer_test.py | 2 +- tests/lib/test_graph_topo.c | 2 + tests/lib/test_simple_sink.c | 1 + tests/lib/test_trace_ir_ref.c | 1 + 52 files changed, 260 insertions(+), 147 deletions(-) diff --git a/include/babeltrace2/graph/component-class-filter.h b/include/babeltrace2/graph/component-class-filter.h index c4c5d1de..b95e18fc 100644 --- a/include/babeltrace2/graph/component-class-filter.h +++ b/include/babeltrace2/graph/component-class-filter.h @@ -47,6 +47,7 @@ typedef bt_component_class_get_supported_mip_versions_method_status typedef bt_component_class_init_method_status (*bt_component_class_filter_init_method)( bt_self_component_filter *self_component, + bt_self_component_filter_configuration *config, const bt_value *params, void *init_method_data); typedef void (*bt_component_class_filter_finalize_method)( diff --git a/include/babeltrace2/graph/component-class-sink.h b/include/babeltrace2/graph/component-class-sink.h index d2ebe549..3f6b1f2e 100644 --- a/include/babeltrace2/graph/component-class-sink.h +++ b/include/babeltrace2/graph/component-class-sink.h @@ -47,6 +47,7 @@ typedef bt_component_class_get_supported_mip_versions_method_status typedef bt_component_class_init_method_status (*bt_component_class_sink_init_method)( bt_self_component_sink *self_component, + bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); typedef void (*bt_component_class_sink_finalize_method)( diff --git a/include/babeltrace2/graph/component-class-source.h b/include/babeltrace2/graph/component-class-source.h index 7856cea4..e5234403 100644 --- a/include/babeltrace2/graph/component-class-source.h +++ b/include/babeltrace2/graph/component-class-source.h @@ -47,6 +47,7 @@ typedef bt_component_class_get_supported_mip_versions_method_status typedef bt_component_class_init_method_status (*bt_component_class_source_init_method)( bt_self_component_source *self_component, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); typedef void (*bt_component_class_source_finalize_method)( diff --git a/include/babeltrace2/types.h b/include/babeltrace2/types.h index 3e61f325..d9b883ac 100644 --- a/include/babeltrace2/types.h +++ b/include/babeltrace2/types.h @@ -138,12 +138,15 @@ typedef struct bt_self_component_class_filter bt_self_component_class_filter; typedef struct bt_self_component_class_sink bt_self_component_class_sink; typedef struct bt_self_component_class_source bt_self_component_class_source; typedef struct bt_self_component_filter bt_self_component_filter; +typedef struct bt_self_component_filter_configuration bt_self_component_filter_configuration; typedef struct bt_self_component_port bt_self_component_port; typedef struct bt_self_component_port_input bt_self_component_port_input; typedef struct bt_self_component_port_input_message_iterator bt_self_component_port_input_message_iterator; typedef struct bt_self_component_port_output bt_self_component_port_output; typedef struct bt_self_component_sink bt_self_component_sink; +typedef struct bt_self_component_sink_configuration bt_self_component_sink_configuration; typedef struct bt_self_component_source bt_self_component_source; +typedef struct bt_self_component_source_configuration bt_self_component_source_configuration; typedef struct bt_self_message_iterator bt_self_message_iterator; typedef struct bt_self_plugin bt_self_plugin; typedef struct bt_stream bt_stream; diff --git a/src/bindings/python/bt2/bt2/component.py b/src/bindings/python/bt2/bt2/component.py index a14b78e7..c4be7368 100644 --- a/src/bindings/python/bt2/bt2/component.py +++ b/src/bindings/python/bt2/bt2/component.py @@ -510,6 +510,9 @@ class _UserComponentType(type): # create instance, not user-initialized yet self = cls.__new__(cls) + # config object + config = cls._config_pycls() + # pointer to native self component object (weak/borrowed) self._bt_ptr = comp_ptr @@ -519,7 +522,7 @@ class _UserComponentType(type): else: params = None - self.__init__(params, obj) + self.__init__(config, params, obj) return self def __call__(cls, *args, **kwargs): @@ -638,6 +641,29 @@ class _UserComponentType(type): native_bt.bt2_unregister_cc_ptr_to_py_cls(cc_ptr) +# Configuration objects for components. +# +# These are passed in __init__ to allow components to change some configuration +# parameters during initialization and not after. As you can see, they are not +# used at the moment, but are there in case we want to add such parameters. + + +class _UserComponentConfiguration: + pass + + +class _UserSourceComponentConfiguration(_UserComponentConfiguration): + pass + + +class _UserFilterComponentConfiguration(_UserComponentConfiguration): + pass + + +class _UserSinkComponentConfiguration(_UserComponentConfiguration): + pass + + # Subclasses must provide these methods or property: # # - _bt_as_not_self_specific_component_ptr: static method, must return the passed @@ -682,7 +708,7 @@ class _UserComponent(metaclass=_UserComponentType): ptr = self._bt_as_self_component_ptr(self._bt_ptr) return native_bt.self_component_get_graph_mip_version(ptr) - def __init__(self, params=None, obj=None): + def __init__(self, config, params, obj): pass def _user_finalize(self): @@ -775,6 +801,7 @@ class _UserSourceComponent(_UserComponent, _SourceComponentConst): _bt_as_self_component_ptr = staticmethod( native_bt.self_component_source_as_self_component ) + _config_pycls = _UserSourceComponentConfiguration @property def _output_ports(self): @@ -808,6 +835,7 @@ class _UserFilterComponent(_UserComponent, _FilterComponentConst): _bt_as_self_component_ptr = staticmethod( native_bt.self_component_filter_as_self_component ) + _config_pycls = _UserFilterComponentConfiguration @property def _output_ports(self): @@ -865,6 +893,7 @@ class _UserSinkComponent(_UserComponent, _SinkComponentConst): _bt_as_self_component_ptr = staticmethod( native_bt.self_component_sink_as_self_component ) + _config_pycls = _UserSinkComponentConfiguration def _bt_graph_is_configured_from_native(self): self._user_graph_is_configured() diff --git a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h index 26d6c217..b97193d3 100644 --- a/src/bindings/python/bt2/bt2/native_bt_component_class.i.h +++ b/src/bindings/python/bt2/bt2/native_bt_component_class.i.h @@ -451,6 +451,7 @@ component_class_sink_get_supported_mip_versions( static bt_component_class_init_method_status component_class_source_init( bt_self_component_source *self_component_source, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) { bt_self_component *self_component = bt_self_component_source_as_self_component(self_component_source); @@ -464,6 +465,7 @@ bt_component_class_init_method_status component_class_source_init( static bt_component_class_init_method_status component_class_filter_init( bt_self_component_filter *self_component_filter, + bt_self_component_filter_configuration *config, const bt_value *params, void *init_method_data) { bt_self_component *self_component = bt_self_component_filter_as_self_component(self_component_filter); @@ -477,6 +479,7 @@ bt_component_class_init_method_status component_class_filter_init( static bt_component_class_init_method_status component_class_sink_init( bt_self_component_sink *self_component_sink, + bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data) { bt_self_component *self_component = bt_self_component_sink_as_self_component(self_component_sink); diff --git a/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py b/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py index 097e1c8b..6c1991f9 100644 --- a/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py +++ b/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py @@ -259,7 +259,7 @@ def _get_ns(obj): class _TraceCollectionMessageIteratorProxySink(bt2_component._UserSinkComponent): - def __init__(self, params, msg_list): + def __init__(self, config, params, msg_list): assert type(msg_list) is list self._msg_list = msg_list self._add_input_port('in') diff --git a/src/lib/graph/component-class-sink-simple.c b/src/lib/graph/component-class-sink-simple.c index cbf67811..6a9d2e53 100644 --- a/src/lib/graph/component-class-sink-simple.c +++ b/src/lib/graph/component-class-sink-simple.c @@ -52,7 +52,8 @@ struct simple_sink_data { static enum bt_component_class_init_method_status simple_sink_init( - struct bt_self_component_sink *self_comp, + bt_self_component_sink *self_comp, + bt_self_component_sink_configuration *config, const struct bt_value *params, void *init_method_data) { int status = BT_FUNC_STATUS_OK; diff --git a/src/lib/graph/graph.c b/src/lib/graph/graph.c index 70c42c6a..b3e41d32 100644 --- a/src/lib/graph/graph.c +++ b/src/lib/graph/graph.c @@ -59,7 +59,7 @@ typedef enum bt_graph_listener_func_status const void *, void *); typedef enum bt_component_class_init_method_status -(*comp_init_method_t)(const void *, const void *, void *); +(*comp_init_method_t)(const void *, void *, const void *, void *); struct bt_graph_listener { bt_graph_listener_removed_func removed; @@ -1330,8 +1330,12 @@ int add_component_with_init_method_data( bt_value_freeze(params); if (init_method) { + /* + * There is no use for config objects right now, so just pass + * NULL. + */ BT_LOGD_STR("Calling user's initialization method."); - init_status = init_method(component, params, init_method_data); + init_status = init_method(component, NULL, params, init_method_data); BT_LOGD("User method returned: status=%s", bt_common_func_status_string(init_status)); if (init_status != BT_FUNC_STATUS_OK) { diff --git a/src/plugins/ctf/fs-sink/fs-sink.c b/src/plugins/ctf/fs-sink/fs-sink.c index 977cc143..88396bcf 100644 --- a/src/plugins/ctf/fs-sink/fs-sink.c +++ b/src/plugins/ctf/fs-sink/fs-sink.c @@ -169,7 +169,9 @@ end: BT_HIDDEN bt_component_class_init_method_status ctf_fs_sink_init( - bt_self_component_sink *self_comp_sink, const bt_value *params, + bt_self_component_sink *self_comp_sink, + bt_self_component_sink_configuration *config, + const bt_value *params, void *init_method_data) { bt_component_class_init_method_status status = diff --git a/src/plugins/ctf/fs-sink/fs-sink.h b/src/plugins/ctf/fs-sink/fs-sink.h index d1c95c78..9f39c296 100644 --- a/src/plugins/ctf/fs-sink/fs-sink.h +++ b/src/plugins/ctf/fs-sink/fs-sink.h @@ -68,6 +68,7 @@ struct fs_sink_comp { BT_HIDDEN bt_component_class_init_method_status ctf_fs_sink_init( bt_self_component_sink *component, + bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); diff --git a/src/plugins/ctf/fs-src/fs.c b/src/plugins/ctf/fs-src/fs.c index cf3cc714..83df6dbe 100644 --- a/src/plugins/ctf/fs-src/fs.c +++ b/src/plugins/ctf/fs-src/fs.c @@ -2391,6 +2391,7 @@ end: BT_HIDDEN bt_component_class_init_method_status ctf_fs_init( bt_self_component_source *self_comp_src, + bt_self_component_source_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { struct ctf_fs_component *ctf_fs; diff --git a/src/plugins/ctf/fs-src/fs.h b/src/plugins/ctf/fs-src/fs.h index 10a17ba8..e48c1469 100644 --- a/src/plugins/ctf/fs-src/fs.h +++ b/src/plugins/ctf/fs-src/fs.h @@ -199,6 +199,7 @@ struct ctf_fs_msg_iter_data { BT_HIDDEN bt_component_class_init_method_status ctf_fs_init( bt_self_component_source *source, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); BT_HIDDEN diff --git a/src/plugins/ctf/lttng-live/lttng-live.c b/src/plugins/ctf/lttng-live/lttng-live.c index b804fbd5..a79d02b1 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.c +++ b/src/plugins/ctf/lttng-live/lttng-live.c @@ -1841,7 +1841,9 @@ end: BT_HIDDEN bt_component_class_init_method_status lttng_live_component_init( bt_self_component_source *self_comp_src, - const bt_value *params, __attribute__((unused)) void *init_method_data) + bt_self_component_source_configuration *config, + const bt_value *params, + __attribute__((unused)) void *init_method_data) { struct lttng_live_component *lttng_live; bt_component_class_init_method_status ret = diff --git a/src/plugins/ctf/lttng-live/lttng-live.h b/src/plugins/ctf/lttng-live/lttng-live.h index 967344dc..57de598b 100644 --- a/src/plugins/ctf/lttng-live/lttng-live.h +++ b/src/plugins/ctf/lttng-live/lttng-live.h @@ -262,6 +262,7 @@ enum lttng_live_iterator_status { bt_component_class_init_method_status lttng_live_component_init( bt_self_component_source *self_comp, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); bt_component_class_query_method_status lttng_live_query( diff --git a/src/plugins/lttng-utils/debug-info/debug-info.c b/src/plugins/lttng-utils/debug-info/debug-info.c index 58809eb2..c481f8bf 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.c +++ b/src/plugins/lttng-utils/debug-info/debug-info.c @@ -1748,6 +1748,7 @@ int init_from_params(struct debug_info_component *debug_info_component, BT_HIDDEN bt_component_class_init_method_status debug_info_comp_init( bt_self_component_filter *self_comp_flt, + bt_self_component_filter_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { int ret; diff --git a/src/plugins/lttng-utils/debug-info/debug-info.h b/src/plugins/lttng-utils/debug-info/debug-info.h index 6319545b..1c2d106b 100644 --- a/src/plugins/lttng-utils/debug-info/debug-info.h +++ b/src/plugins/lttng-utils/debug-info/debug-info.h @@ -37,6 +37,7 @@ BT_HIDDEN bt_component_class_init_method_status debug_info_comp_init( bt_self_component_filter *self_comp, + bt_self_component_filter_configuration *config, const bt_value *params, void *init_method_data); BT_HIDDEN diff --git a/src/plugins/text/details/details.c b/src/plugins/text/details/details.c index 9c45e39e..5093aca4 100644 --- a/src/plugins/text/details/details.c +++ b/src/plugins/text/details/details.c @@ -388,7 +388,9 @@ void log_configuration(bt_self_component_sink *comp, } BT_HIDDEN -bt_component_class_init_method_status details_init(bt_self_component_sink *comp, +bt_component_class_init_method_status details_init( + bt_self_component_sink *comp, + bt_self_component_sink_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { diff --git a/src/plugins/text/details/details.h b/src/plugins/text/details/details.h index dd52098c..45b09868 100644 --- a/src/plugins/text/details/details.h +++ b/src/plugins/text/details/details.h @@ -163,6 +163,7 @@ struct details_comp { BT_HIDDEN bt_component_class_init_method_status details_init( bt_self_component_sink *component, + bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); BT_HIDDEN diff --git a/src/plugins/text/dmesg/dmesg.c b/src/plugins/text/dmesg/dmesg.c index 4a131ea3..9f22ac86 100644 --- a/src/plugins/text/dmesg/dmesg.c +++ b/src/plugins/text/dmesg/dmesg.c @@ -383,6 +383,7 @@ bt_component_class_init_method_status create_port( BT_HIDDEN bt_component_class_init_method_status dmesg_init( bt_self_component_source *self_comp_src, + bt_self_component_source_configuration *config, bt_value *params, void *init_method_data) { int ret = 0; diff --git a/src/plugins/text/dmesg/dmesg.h b/src/plugins/text/dmesg/dmesg.h index b72f4794..f74b3b26 100644 --- a/src/plugins/text/dmesg/dmesg.h +++ b/src/plugins/text/dmesg/dmesg.h @@ -30,6 +30,7 @@ BT_HIDDEN bt_component_class_init_method_status dmesg_init( bt_self_component_source *self_comp, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data); BT_HIDDEN diff --git a/src/plugins/text/pretty/pretty.c b/src/plugins/text/pretty/pretty.c index 2bf9f7b7..1e2000ee 100644 --- a/src/plugins/text/pretty/pretty.c +++ b/src/plugins/text/pretty/pretty.c @@ -614,7 +614,9 @@ void set_use_colors(struct pretty_component *pretty) BT_HIDDEN bt_component_class_init_method_status pretty_init( - bt_self_component_sink *comp, const bt_value *params, + bt_self_component_sink *comp, + bt_self_component_sink_configuration *config, + const bt_value *params, __attribute__((unused)) void *init_method_data) { bt_component_class_init_method_status ret = diff --git a/src/plugins/text/pretty/pretty.h b/src/plugins/text/pretty/pretty.h index cffe7ca7..02991259 100644 --- a/src/plugins/text/pretty/pretty.h +++ b/src/plugins/text/pretty/pretty.h @@ -94,7 +94,9 @@ struct pretty_component { BT_HIDDEN bt_component_class_init_method_status pretty_init( - bt_self_component_sink *component, const bt_value *params, + bt_self_component_sink *component, + bt_self_component_sink_configuration *config, + const bt_value *params, void *init_method_data); BT_HIDDEN diff --git a/src/plugins/utils/counter/counter.c b/src/plugins/utils/counter/counter.c index bf0e4a57..f2cdd1a9 100644 --- a/src/plugins/utils/counter/counter.c +++ b/src/plugins/utils/counter/counter.c @@ -138,6 +138,7 @@ void counter_finalize(bt_self_component_sink *comp) BT_HIDDEN bt_component_class_init_method_status counter_init( bt_self_component_sink *component, + bt_self_component_sink_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { diff --git a/src/plugins/utils/counter/counter.h b/src/plugins/utils/counter/counter.h index f47eb3b1..3e2fd4e6 100644 --- a/src/plugins/utils/counter/counter.h +++ b/src/plugins/utils/counter/counter.h @@ -53,6 +53,7 @@ struct counter { BT_HIDDEN bt_component_class_init_method_status counter_init( bt_self_component_sink *component, + bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); BT_HIDDEN diff --git a/src/plugins/utils/dummy/dummy.c b/src/plugins/utils/dummy/dummy.c index d41551de..20dab799 100644 --- a/src/plugins/utils/dummy/dummy.c +++ b/src/plugins/utils/dummy/dummy.c @@ -50,6 +50,7 @@ void dummy_finalize(bt_self_component_sink *comp) BT_HIDDEN bt_component_class_init_method_status dummy_init( bt_self_component_sink *component, + bt_self_component_sink_configuration *config, const bt_value *params, __attribute__((unused)) void *init_method_data) { diff --git a/src/plugins/utils/dummy/dummy.h b/src/plugins/utils/dummy/dummy.h index c5ab55ae..7801294f 100644 --- a/src/plugins/utils/dummy/dummy.h +++ b/src/plugins/utils/dummy/dummy.h @@ -35,6 +35,7 @@ struct dummy { BT_HIDDEN bt_component_class_init_method_status dummy_init( bt_self_component_sink *component, + bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data); BT_HIDDEN diff --git a/src/plugins/utils/muxer/muxer.c b/src/plugins/utils/muxer/muxer.c index 12485df8..7404e1e4 100644 --- a/src/plugins/utils/muxer/muxer.c +++ b/src/plugins/utils/muxer/muxer.c @@ -249,6 +249,7 @@ void destroy_muxer_comp(struct muxer_comp *muxer_comp) BT_HIDDEN bt_component_class_init_method_status muxer_init( bt_self_component_filter *self_comp_flt, + bt_self_component_filter_configuration *config, const bt_value *params, void *init_data) { bt_component_class_init_method_status status = diff --git a/src/plugins/utils/muxer/muxer.h b/src/plugins/utils/muxer/muxer.h index 72e8b762..8c3f7f48 100644 --- a/src/plugins/utils/muxer/muxer.h +++ b/src/plugins/utils/muxer/muxer.h @@ -31,6 +31,7 @@ BT_HIDDEN bt_component_class_init_method_status muxer_init( bt_self_component_filter *self_comp, + bt_self_component_filter_configuration *config, const bt_value *params, void *init_data); BT_HIDDEN diff --git a/src/plugins/utils/trimmer/trimmer.c b/src/plugins/utils/trimmer/trimmer.c index 4d39fba2..92fad09b 100644 --- a/src/plugins/utils/trimmer/trimmer.c +++ b/src/plugins/utils/trimmer/trimmer.c @@ -563,6 +563,7 @@ end: bt_component_class_init_method_status trimmer_init( bt_self_component_filter *self_comp_flt, + bt_self_component_filter_configuration *config, const bt_value *params, void *init_data) { int ret; diff --git a/src/plugins/utils/trimmer/trimmer.h b/src/plugins/utils/trimmer/trimmer.h index c29a89f4..34d45efa 100644 --- a/src/plugins/utils/trimmer/trimmer.h +++ b/src/plugins/utils/trimmer/trimmer.h @@ -35,7 +35,9 @@ BT_HIDDEN void trimmer_finalize(bt_self_component_filter *self_comp); BT_HIDDEN -bt_component_class_init_method_status trimmer_init(bt_self_component_filter *self_comp, +bt_component_class_init_method_status trimmer_init( + bt_self_component_filter *self_comp, + bt_self_component_filter_configuration *config, const bt_value *params, void *init_data); BT_HIDDEN diff --git a/tests/bindings/python/bt2/test_clock_class.py b/tests/bindings/python/bt2/test_clock_class.py index b9d25e54..26571bd4 100644 --- a/tests/bindings/python/bt2/test_clock_class.py +++ b/tests/bindings/python/bt2/test_clock_class.py @@ -266,7 +266,7 @@ class ClockSnapshotTestCase(unittest.TestCase): return notif class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') self._graph = bt2.Graph() diff --git a/tests/bindings/python/bt2/test_component.py b/tests/bindings/python/bt2/test_component.py index 2a3856b9..c215c44d 100644 --- a/tests/bindings/python/bt2/test_component.py +++ b/tests/bindings/python/bt2/test_component.py @@ -18,6 +18,7 @@ import unittest import bt2 +from bt2 import component as bt2_component class UserComponentTestCase(unittest.TestCase): @@ -32,7 +33,7 @@ class UserComponentTestCase(unittest.TestCase): def test_name(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): self.assertEqual(comp_self.name, 'yaes') def _user_consume(self): @@ -42,7 +43,7 @@ class UserComponentTestCase(unittest.TestCase): def test_logging_level(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): self.assertEqual(comp_self.logging_level, bt2.LoggingLevel.INFO) def _user_consume(self): @@ -52,7 +53,7 @@ class UserComponentTestCase(unittest.TestCase): def test_graph_mip_version(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): self.assertEqual(comp_self._graph_mip_version, 0) def _user_consume(self): @@ -62,7 +63,7 @@ class UserComponentTestCase(unittest.TestCase): def test_class(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): self.assertEqual(comp_self.cls, MySink) def _user_consume(self): @@ -72,7 +73,7 @@ class UserComponentTestCase(unittest.TestCase): def test_addr(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): self.assertIsInstance(comp_self.addr, int) self.assertNotEqual(comp_self.addr, 0) @@ -99,6 +100,43 @@ class UserComponentTestCase(unittest.TestCase): del comp self.assertTrue(finalized) + def test_source_component_config(self): + class MySource( + bt2._UserSourceComponent, message_iterator_class=bt2._UserMessageIterator + ): + def __init__(comp_self, config, params, obj): + nonlocal cfg_type + cfg_type = type(config) + + cfg_type = None + self._create_comp(MySource) + self.assertIs(cfg_type, bt2_component._UserSourceComponentConfiguration) + + def test_filter_component_config(self): + class MyFilter( + bt2._UserFilterComponent, message_iterator_class=bt2._UserMessageIterator + ): + def __init__(comp_self, config, params, obj): + nonlocal cfg_type + cfg_type = type(config) + + cfg_type = None + self._create_comp(MyFilter) + self.assertIs(cfg_type, bt2_component._UserFilterComponentConfiguration) + + def test_sink_component_config(self): + class MySink(bt2._UserSinkComponent): + def __init__(comp_self, config, params, obj): + nonlocal cfg_type + cfg_type = type(config) + + def _user_consume(self): + pass + + cfg_type = None + self._create_comp(MySink) + self.assertIs(cfg_type, bt2_component._UserSinkComponentConfiguration) + class GenericComponentTestCase(unittest.TestCase): @staticmethod diff --git a/tests/bindings/python/bt2/test_connection.py b/tests/bindings/python/bt2/test_connection.py index 33b18951..539f7bcb 100644 --- a/tests/bindings/python/bt2/test_connection.py +++ b/tests/bindings/python/bt2/test_connection.py @@ -29,11 +29,11 @@ class ConnectionTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -51,11 +51,11 @@ class ConnectionTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -75,11 +75,11 @@ class ConnectionTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): diff --git a/tests/bindings/python/bt2/test_error.py b/tests/bindings/python/bt2/test_error.py index 0bdd6ce3..6ec5fd89 100644 --- a/tests/bindings/python/bt2/test_error.py +++ b/tests/bindings/python/bt2/test_error.py @@ -29,19 +29,19 @@ class FailingIter(bt2._UserMessageIterator): class SourceWithFailingIter( bt2._UserSourceComponent, message_iterator_class=FailingIter ): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class SourceWithFailingInit( bt2._UserSourceComponent, message_iterator_class=FailingIter ): - def __init__(self, params, obj): + def __init__(self, config, params, obj): raise ValueError('Source is failing') class WorkingSink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._in = self._add_input_port('in') def _user_graph_is_configured(self): @@ -52,7 +52,7 @@ class WorkingSink(bt2._UserSinkComponent): class SinkWithExceptionChaining(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._in = self._add_input_port('in') def _user_graph_is_configured(self): diff --git a/tests/bindings/python/bt2/test_event.py b/tests/bindings/python/bt2/test_event.py index 9c71c020..b6b17ade 100644 --- a/tests/bindings/python/bt2/test_event.py +++ b/tests/bindings/python/bt2/test_event.py @@ -81,7 +81,7 @@ class EventTestCase(unittest.TestCase): return msg class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') tc = self._create_trace_class() diff --git a/tests/bindings/python/bt2/test_event_class.py b/tests/bindings/python/bt2/test_event_class.py index f2cf52cb..6a6eb4cb 100644 --- a/tests/bindings/python/bt2/test_event_class.py +++ b/tests/bindings/python/bt2/test_event_class.py @@ -50,7 +50,7 @@ def _create_const_event_class(tc, stream_class): return self._msgs.pop(0) class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out', params) graph = bt2.Graph() diff --git a/tests/bindings/python/bt2/test_field.py b/tests/bindings/python/bt2/test_field.py index ecf0194c..6271b770 100644 --- a/tests/bindings/python/bt2/test_field.py +++ b/tests/bindings/python/bt2/test_field.py @@ -93,7 +93,7 @@ def _create_const_field(tc, field_class, field_value_setter_fn): return self._msgs.pop(0) class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out', params) graph = bt2.Graph() diff --git a/tests/bindings/python/bt2/test_field_class.py b/tests/bindings/python/bt2/test_field_class.py index 1d883eea..3a383fdd 100644 --- a/tests/bindings/python/bt2/test_field_class.py +++ b/tests/bindings/python/bt2/test_field_class.py @@ -61,7 +61,7 @@ def _create_const_field_class(tc, field_class, value_setter_fn): return self._msgs.pop(0) class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out', params) graph = bt2.Graph() diff --git a/tests/bindings/python/bt2/test_graph.py b/tests/bindings/python/bt2/test_graph.py index d304169e..347f8803 100644 --- a/tests/bindings/python/bt2/test_graph.py +++ b/tests/bindings/python/bt2/test_graph.py @@ -87,7 +87,7 @@ class GraphTestCase(unittest.TestCase): comp_params = None class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): nonlocal comp_params comp_params = params @@ -103,7 +103,7 @@ class GraphTestCase(unittest.TestCase): comp_obj = None class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): nonlocal comp_obj comp_obj = obj @@ -119,7 +119,7 @@ class GraphTestCase(unittest.TestCase): comp_obj = None class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): nonlocal comp_obj comp_obj = obj @@ -175,11 +175,11 @@ class GraphTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -202,11 +202,11 @@ class GraphTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -224,11 +224,11 @@ class GraphTestCase(unittest.TestCase): raise TypeError class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -269,11 +269,11 @@ class GraphTestCase(unittest.TestCase): return self._create_stream_beginning_message(self._stream) class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -316,11 +316,11 @@ class GraphTestCase(unittest.TestCase): return msg class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._input_port = self._add_input_port('in') self._at = 0 @@ -356,11 +356,11 @@ class GraphTestCase(unittest.TestCase): pass class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._input_port = self._add_input_port('in') def _user_consume(comp_self): @@ -383,11 +383,11 @@ class GraphTestCase(unittest.TestCase): pass class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._input_port = self._add_input_port('in') def _user_consume(comp_self): @@ -417,11 +417,11 @@ class GraphTestCase(unittest.TestCase): return msg class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._input_port = self._add_input_port('in') self._at = 0 @@ -473,11 +473,11 @@ class GraphTestCase(unittest.TestCase): return msg class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._input_port = self._add_input_port('in') self._at = 0 @@ -514,12 +514,12 @@ class GraphTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') self._add_output_port('zero') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -583,12 +583,12 @@ class GraphTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') self._add_output_port('zero') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -604,7 +604,7 @@ class GraphTestCase(unittest.TestCase): def test_raise_in_component_init(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): raise ValueError('oops!') def _user_consume(self): @@ -617,7 +617,7 @@ class GraphTestCase(unittest.TestCase): def test_raise_in_port_added_listener(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -638,11 +638,11 @@ class GraphTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): diff --git a/tests/bindings/python/bt2/test_message.py b/tests/bindings/python/bt2/test_message.py index 6000a0fa..e58e5245 100644 --- a/tests/bindings/python/bt2/test_message.py +++ b/tests/bindings/python/bt2/test_message.py @@ -119,7 +119,7 @@ class AllMessagesTestCase(unittest.TestCase): return msg class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out', params) with_cc = bool(params['with_cc']) diff --git a/tests/bindings/python/bt2/test_message_iterator.py b/tests/bindings/python/bt2/test_message_iterator.py index 195eb771..39d80888 100644 --- a/tests/bindings/python/bt2/test_message_iterator.py +++ b/tests/bindings/python/bt2/test_message_iterator.py @@ -27,7 +27,7 @@ class SimpleSink(bt2._UserSinkComponent): # Straightforward sink that creates one input port (`in`) and consumes from # it. - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_consume(self): @@ -68,7 +68,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): the_output_port_from_iter = self_port_output class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): nonlocal the_output_port_from_source the_output_port_from_source = self._add_output_port('out', 'user data') @@ -88,7 +88,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): src_iter_initialized = True class MySource(bt2._UserSourceComponent, message_iterator_class=MySourceIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MyFilterIter(bt2._UserMessageIterator): @@ -103,7 +103,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): return next(self._up_iter) class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') self._add_output_port('out') @@ -124,7 +124,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): raise ValueError('Very bad error') class MySource(bt2._UserSourceComponent, message_iterator_class=MySourceIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MyFilterIter(bt2._UserMessageIterator): @@ -136,7 +136,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): ) class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') self._add_output_port('out') @@ -160,7 +160,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): finalized = True class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') finalized = False @@ -176,7 +176,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): salut = self._component._salut class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') self._salut = 23 @@ -196,7 +196,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): self.assertEqual(self_port_output.addr, port.addr) class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') called = False @@ -211,7 +211,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): addr = self.addr class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') addr = None @@ -244,7 +244,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): return self._msgs.pop(0) class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): tc = self._create_trace_class() sc = tc.create_stream_class(supports_packets=True) ec = sc.create_event_class() @@ -276,7 +276,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): raise bt2.TryAgain class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_output_port('out') class MyFilterIter(bt2._UserMessageIterator): @@ -296,7 +296,7 @@ class UserMessageIteratorTestCase(unittest.TestCase): return self._upstream_iter.can_seek_beginning() class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): input_port = self._add_input_port('in') self._add_output_port('out', input_port) @@ -359,7 +359,7 @@ def _setup_seek_test( MySourceIter._user_can_seek_ns_from_origin = user_can_seek_ns_from_origin class MySource(bt2._UserSourceComponent, message_iterator_class=MySourceIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): tc = self._create_trace_class() sc = tc.create_stream_class(supports_packets=True) ec = sc.create_event_class() @@ -388,7 +388,7 @@ def _setup_seek_test( self._upstream_iter.seek_ns_from_origin(ns_from_origin) class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyFilterIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') self._add_output_port('out') @@ -398,7 +398,7 @@ def _setup_seek_test( class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase): def test_can_seek_beginning(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -432,7 +432,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase): # Test an iterator without a _user_can_seek_beginning method, but with # a _user_seek_beginning method. class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -456,7 +456,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase): # Test an iterator without a _user_can_seek_beginning method, without # a _user_seek_beginning method. class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -475,7 +475,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase): def test_can_seek_beginning_user_error(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -502,7 +502,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase): def test_can_seek_beginning_wrong_return_value(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -529,7 +529,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase): def test_seek_beginning(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -573,7 +573,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase): def test_seek_beginning_user_error(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -596,7 +596,7 @@ class UserMessageIteratorSeekBeginningTestCase(unittest.TestCase): class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): def test_can_seek_ns_from_origin(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -637,7 +637,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): # Test an iterator without a _user_can_seek_ns_from_origin method, but # with a _user_seek_ns_from_origin method. class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -667,7 +667,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): # Test an iterator without a _user_can_seek_ns_from_origin method, but # with a _user_seek_beginning method. class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -695,7 +695,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): # Test an iterator without a _user_can_seek_ns_from_origin method # and no other related method. class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -718,7 +718,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): def test_can_seek_ns_from_origin_user_error(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -745,7 +745,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): def test_can_seek_ns_from_origin_wrong_return_value(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): @@ -772,7 +772,7 @@ class UserMessageIteratorSeekNsFromOriginTestCase(unittest.TestCase): def test_seek_ns_from_origin(self): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') def _user_graph_is_configured(self): diff --git a/tests/bindings/python/bt2/test_port.py b/tests/bindings/python/bt2/test_port.py index dab6c536..53fdf9c7 100644 --- a/tests/bindings/python/bt2/test_port.py +++ b/tests/bindings/python/bt2/test_port.py @@ -37,7 +37,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port = comp_self._add_output_port('out') self.assertEqual(port.name, 'out') @@ -51,7 +51,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port = comp_self._add_output_port('out') self.assertEqual(port.name, 'out') @@ -64,7 +64,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port = comp_self._add_input_port('in') self.assertEqual(port.name, 'in') @@ -74,7 +74,7 @@ class PortTestCase(unittest.TestCase): def test_sink_add_input_port(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port = comp_self._add_input_port('in') self.assertEqual(port.name, 'in') @@ -90,7 +90,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port1 = comp_self._add_output_port('clear') port2 = comp_self._add_output_port('print') port3 = comp_self._add_output_port('insert') @@ -106,7 +106,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port1 = comp_self._add_output_port('clear') port2 = comp_self._add_output_port('print') port3 = comp_self._add_output_port('insert') @@ -122,7 +122,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port1 = comp_self._add_input_port('clear') port2 = comp_self._add_input_port('print') port3 = comp_self._add_input_port('insert') @@ -134,7 +134,7 @@ class PortTestCase(unittest.TestCase): def test_user_sink_input_ports_getitem(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port1 = comp_self._add_input_port('clear') port2 = comp_self._add_input_port('print') port3 = comp_self._add_input_port('insert') @@ -153,7 +153,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_output_port('clear') comp_self._add_output_port('print') comp_self._add_output_port('insert') @@ -169,7 +169,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_output_port('clear') comp_self._add_output_port('print') comp_self._add_output_port('insert') @@ -185,7 +185,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') comp_self._add_input_port('print') comp_self._add_input_port('insert') @@ -197,7 +197,7 @@ class PortTestCase(unittest.TestCase): def test_user_sink_input_ports_getitem_invalid_key(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') comp_self._add_input_port('print') comp_self._add_input_port('insert') @@ -216,7 +216,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_output_port('clear') comp_self._add_output_port('print') comp_self._add_output_port('insert') @@ -230,7 +230,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_output_port('clear') comp_self._add_output_port('print') comp_self._add_output_port('insert') @@ -244,7 +244,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') comp_self._add_input_port('print') comp_self._add_input_port('insert') @@ -254,7 +254,7 @@ class PortTestCase(unittest.TestCase): def test_user_sink_input_ports_len(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') comp_self._add_input_port('print') comp_self._add_input_port('insert') @@ -271,7 +271,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port1 = comp_self._add_output_port('clear') port2 = comp_self._add_output_port('print') port3 = comp_self._add_output_port('insert') @@ -295,7 +295,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port1 = comp_self._add_output_port('clear') port2 = comp_self._add_output_port('print') port3 = comp_self._add_output_port('insert') @@ -319,7 +319,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port1 = comp_self._add_input_port('clear') port2 = comp_self._add_input_port('print') port3 = comp_self._add_input_port('insert') @@ -339,7 +339,7 @@ class PortTestCase(unittest.TestCase): def test_user_sink_input_ports_iter(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port1 = comp_self._add_input_port('clear') port2 = comp_self._add_input_port('print') port3 = comp_self._add_input_port('insert') @@ -370,7 +370,7 @@ class PortTestCase(unittest.TestCase): port3 = None class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal port1, port2, port3 port1 = comp_self._add_output_port('clear') port2 = comp_self._add_output_port('print') @@ -394,7 +394,7 @@ class PortTestCase(unittest.TestCase): port3 = None class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal port1, port2, port3 port1 = comp_self._add_output_port('clear') port2 = comp_self._add_output_port('print') @@ -418,7 +418,7 @@ class PortTestCase(unittest.TestCase): port3 = None class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal port1, port2, port3 port1 = comp_self._add_input_port('clear') port2 = comp_self._add_input_port('print') @@ -438,7 +438,7 @@ class PortTestCase(unittest.TestCase): port3 = None class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal port1, port2, port3 port1 = comp_self._add_input_port('clear') port2 = comp_self._add_input_port('print') @@ -461,7 +461,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_output_port('clear') comp_self._add_output_port('print') comp_self._add_output_port('insert') @@ -477,7 +477,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_output_port('clear') comp_self._add_output_port('print') comp_self._add_output_port('insert') @@ -493,7 +493,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') comp_self._add_input_port('print') comp_self._add_input_port('insert') @@ -505,7 +505,7 @@ class PortTestCase(unittest.TestCase): def test_gen_sink_input_ports_getitem_invalid_key(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') comp_self._add_input_port('print') comp_self._add_input_port('insert') @@ -527,7 +527,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_output_port('clear') comp_self._add_output_port('print') comp_self._add_output_port('insert') @@ -541,7 +541,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_output_port('clear') comp_self._add_output_port('print') comp_self._add_output_port('insert') @@ -555,7 +555,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') comp_self._add_input_port('print') comp_self._add_input_port('insert') @@ -565,7 +565,7 @@ class PortTestCase(unittest.TestCase): def test_gen_sink_input_ports_len(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') comp_self._add_input_port('print') comp_self._add_input_port('insert') @@ -586,7 +586,7 @@ class PortTestCase(unittest.TestCase): port3 = None class MySource(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal port1, port2, port3 port1 = comp_self._add_output_port('clear') port2 = comp_self._add_output_port('print') @@ -618,7 +618,7 @@ class PortTestCase(unittest.TestCase): port3 = None class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal port1, port2, port3 port1 = comp_self._add_output_port('clear') port2 = comp_self._add_output_port('print') @@ -650,7 +650,7 @@ class PortTestCase(unittest.TestCase): port3 = None class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal port1, port2, port3 port1 = comp_self._add_input_port('clear') port2 = comp_self._add_input_port('print') @@ -678,7 +678,7 @@ class PortTestCase(unittest.TestCase): port3 = None class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal port1, port2, port3 port1 = comp_self._add_input_port('clear') port2 = comp_self._add_input_port('print') @@ -705,7 +705,7 @@ class PortTestCase(unittest.TestCase): def test_name(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') def _user_consume(self): @@ -716,7 +716,7 @@ class PortTestCase(unittest.TestCase): def test_connection_none(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') def _user_consume(self): @@ -727,7 +727,7 @@ class PortTestCase(unittest.TestCase): def test_is_connected_false(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): comp_self._add_input_port('clear') def _user_consume(self): @@ -738,7 +738,7 @@ class PortTestCase(unittest.TestCase): def test_self_name(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port = comp_self._add_input_port('clear') self.assertEqual(port.name, 'clear') @@ -749,7 +749,7 @@ class PortTestCase(unittest.TestCase): def test_self_connection_none(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port = comp_self._add_input_port('clear') self.assertIsNone(port.connection) @@ -760,7 +760,7 @@ class PortTestCase(unittest.TestCase): def test_self_is_connected_false(self): class MySink(bt2._UserSinkComponent): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): port = comp_self._add_input_port('clear') self.assertFalse(port.is_connected) @@ -775,7 +775,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MySource(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal user_datas p = comp_self._add_output_port('port1') @@ -794,7 +794,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MyFilter(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal user_datas p = comp_self._add_output_port('port1') @@ -820,7 +820,7 @@ class PortTestCase(unittest.TestCase): raise bt2.Stop class MySink(bt2._UserFilterComponent, message_iterator_class=MyIter): - def __init__(comp_self, params, obj): + def __init__(comp_self, config, params, obj): nonlocal user_datas p = comp_self._add_input_port('port1') diff --git a/tests/bindings/python/bt2/utils.py b/tests/bindings/python/bt2/utils.py index 8dfdfd6a..f0ddbff4 100644 --- a/tests/bindings/python/bt2/utils.py +++ b/tests/bindings/python/bt2/utils.py @@ -26,7 +26,7 @@ import collections.abc # The value returned by the callable is returned by run_in_component_init. def run_in_component_init(func): class MySink(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): nonlocal res_bound res_bound = func(self) @@ -125,7 +125,7 @@ def _get_all_message_types(with_packet=True): return msg class MySrc(bt2._UserSourceComponent, message_iterator_class=MyIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): tc = self._create_trace_class() clock_class = self._create_clock_class(frequency=1000) @@ -251,7 +251,7 @@ def get_const_event_message(): # from this port, it puts the returned message in the initialization # list as the first item. class TestProxySink(bt2._UserSinkComponent): - def __init__(self, params, msg_list): + def __init__(self, config, params, msg_list): assert msg_list is not None self._msg_list = msg_list self._add_input_port('in') diff --git a/tests/data/auto-source-discovery/grouping/bt_plugin_test.py b/tests/data/auto-source-discovery/grouping/bt_plugin_test.py index 15b7d602..dd4d5a4b 100644 --- a/tests/data/auto-source-discovery/grouping/bt_plugin_test.py +++ b/tests/data/auto-source-discovery/grouping/bt_plugin_test.py @@ -52,7 +52,7 @@ class TestSourceExt(Base, bt2._UserSourceComponent, message_iterator_class=TestI files are not grouped. """ - def __init__(self, params, obj): + def __init__(self, config, params, obj): super().__init__(params) @staticmethod @@ -85,7 +85,7 @@ class TestSourceSomeDir( directory "some-dir" won't be found by TestSourceExt, because we won't recurse in "some-dir".""" - def __init__(self, params, obj): + def __init__(self, config, params, obj): super().__init__(params) @staticmethod @@ -104,7 +104,7 @@ class TestSourceSomeDir( class TestSourceABCDE(Base, bt2._UserSourceComponent, message_iterator_class=TestIter): """A source that recognizes the arbitrary string input "ABCDE".""" - def __init__(self, params, obj): + def __init__(self, config, params, obj): super().__init__(params) @staticmethod diff --git a/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py b/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py index 336f49c2..c39db50f 100644 --- a/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py +++ b/tests/data/auto-source-discovery/params-log-level/bt_plugin_test.py @@ -57,7 +57,7 @@ class Base: @bt2.plugin_component_class class TestSourceA(Base, bt2._UserSourceComponent, message_iterator_class=TestIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): super().__init__(params, obj) @staticmethod @@ -80,7 +80,7 @@ class TestSourceA(Base, bt2._UserSourceComponent, message_iterator_class=TestIte @bt2.plugin_component_class class TestSourceB(Base, bt2._UserSourceComponent, message_iterator_class=TestIter): - def __init__(self, params, obj): + def __init__(self, config, params, obj): super().__init__(params, obj) @staticmethod diff --git a/tests/data/cli/params/bt_plugin_params.py b/tests/data/cli/params/bt_plugin_params.py index 4d750137..6b608896 100644 --- a/tests/data/cli/params/bt_plugin_params.py +++ b/tests/data/cli/params/bt_plugin_params.py @@ -40,7 +40,7 @@ def to_string(p): @bt2.plugin_component_class class SinkThatPrintsParams(bt2._UserSinkComponent): - def __init__(self, params, obj): + def __init__(self, config, params, obj): self._add_input_port('in') print(to_string(params)) diff --git a/tests/data/plugins/flt.utils.muxer/bt_plugin_muxer_test.py b/tests/data/plugins/flt.utils.muxer/bt_plugin_muxer_test.py index 29aa065a..b81c26db 100644 --- a/tests/data/plugins/flt.utils.muxer/bt_plugin_muxer_test.py +++ b/tests/data/plugins/flt.utils.muxer/bt_plugin_muxer_test.py @@ -19,7 +19,7 @@ class TheIteratorOfConfusion(bt2._UserMessageIterator): class TheSourceOfConfusion( bt2._UserSourceComponent, message_iterator_class=TheIteratorOfConfusion ): - def __init__(self, params, obj): + def __init__(self, config, params, obj): test_name = str(params['test-name']) TEST_CASES[test_name].source_setup(self, test_name) diff --git a/tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py b/tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py index c7d5985d..3a37b329 100644 --- a/tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py +++ b/tests/data/plugins/flt.utils.trimmer/bt_plugin_trimmer_test.py @@ -49,7 +49,7 @@ class TheIteratorOfAllEvil(bt2._UserMessageIterator): class TheSourceOfAllEvil( bt2._UserSourceComponent, message_iterator_class=TheIteratorOfAllEvil ): - def __init__(self, params, obj): + def __init__(self, config, params, obj): tc = self._create_trace_class() # Use a clock class with an offset, so we can test with --begin or --end diff --git a/tests/lib/test_graph_topo.c b/tests/lib/test_graph_topo.c index ae2da5aa..3689a75b 100644 --- a/tests/lib/test_graph_topo.c +++ b/tests/lib/test_graph_topo.c @@ -295,6 +295,7 @@ bt_component_class_port_connected_method_status sink_input_port_connected( static bt_component_class_init_method_status src_init( bt_self_component_source *self_comp, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) { int ret; @@ -308,6 +309,7 @@ bt_component_class_init_method_status src_init( static bt_component_class_init_method_status sink_init( bt_self_component_sink *self_comp, + bt_self_component_sink_configuration *config, const bt_value *params, void *init_method_data) { int ret; diff --git a/tests/lib/test_simple_sink.c b/tests/lib/test_simple_sink.c index 31e2b6f7..2ea92a84 100644 --- a/tests/lib/test_simple_sink.c +++ b/tests/lib/test_simple_sink.c @@ -60,6 +60,7 @@ void simple_fini_func(void *data) static bt_component_class_init_method_status src_init( bt_self_component_source *self_comp, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) { bt_self_component_add_port_status status; diff --git a/tests/lib/test_trace_ir_ref.c b/tests/lib/test_trace_ir_ref.c index 33591800..1d565ebd 100644 --- a/tests/lib/test_trace_ir_ref.c +++ b/tests/lib/test_trace_ir_ref.c @@ -411,6 +411,7 @@ static void test_example_scenario(bt_self_component_source *self_comp) static bt_component_class_init_method_status src_init( bt_self_component_source *self_comp, + bt_self_component_source_configuration *config, const bt_value *params, void *init_method_data) { test_example_scenario(self_comp); -- 2.34.1