From: Philippe Proulx Date: Sat, 15 Jun 2019 01:16:07 +0000 (-0400) Subject: lib: set component's initial log level when adding it to the graph X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=e874da19b9fd96ac87f70595e0463f8e03af29af lib: set component's initial log level when adding it to the graph This patch changes the bt_graph_add_*_component*() functions so that they accept a log level parameter. This is now considered the component's initial log level, so that we can achieve per-component log levels. The component initialization method types are not changed: because the log level is part of a component's state, a component initialization method can retrieve its own, current log level with the new bt_component_get_logging_level() function. When you call bt_graph_add_*_component*(), the function creates an initial component object, sets its initial log level, and then calls its initialization method. Eventually, we can add a new, optional "logging level changed" component method to notify it that its log level changed (caused by a call to bt_component_set_logging_level(), for example). The project's components do not honor their initial log level within the scope of this patch: this is postponed to another patch. In other words, they still use shared object constructors and environment variables to set their log level at the component class level. The CLI passes the configured log level (`--log-level`, `-v`, or `-d` options) when it calls the bt_graph_add_*_component() functions. As of this patch, it also still sets the known log level environment variables. Python bindings are adjusted accordingly. Their tests are not changed because the log level parameter is optional (defaults to `bt2.LoggingLevel.NONE`) and it's the last one of bt2.Graph.add_component(). The constructor of `bt2.ComponentSpec` also accepts a new, optional log level parameter to configure the component specifier as such. You can access the log level of a component with the new `logging_level` property. Signed-off-by: Philippe Proulx Change-Id: If258335f46ffabb587dd777b5109fc66d8a59f54 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1454 Tested-by: jenkins Reviewed-by: Francis Deslauriers --- diff --git a/include/babeltrace2/graph/component-const.h b/include/babeltrace2/graph/component-const.h index 00884cdd..f74b58fc 100644 --- a/include/babeltrace2/graph/component-const.h +++ b/include/babeltrace2/graph/component-const.h @@ -33,6 +33,9 @@ */ #include +/* For bt_logging_level */ +#include + #ifdef __cplusplus extern "C" { #endif @@ -45,6 +48,9 @@ extern "C" { */ extern const char *bt_component_get_name(const bt_component *component); +extern bt_logging_level bt_component_get_logging_level( + const bt_component *component); + /** * Get component's class. * diff --git a/include/babeltrace2/graph/graph.h b/include/babeltrace2/graph/graph.h index f5bd52d5..34a74fa4 100644 --- a/include/babeltrace2/graph/graph.h +++ b/include/babeltrace2/graph/graph.h @@ -36,6 +36,9 @@ /* For bt_graph_status */ #include +/* For bt_logging_level */ +#include + #ifdef __cplusplus extern "C" { #endif @@ -102,36 +105,38 @@ extern bt_graph *bt_graph_create(void); extern bt_graph_status bt_graph_add_source_component(bt_graph *graph, const bt_component_class_source *component_class, const char *name, const bt_value *params, - const bt_component_source **component); + bt_logging_level log_level, const bt_component_source **component); extern bt_graph_status bt_graph_add_source_component_with_init_method_data( bt_graph *graph, const bt_component_class_source *component_class, const char *name, const bt_value *params, - void *init_method_data, + void *init_method_data, bt_logging_level log_level, const bt_component_source **component); extern bt_graph_status bt_graph_add_filter_component(bt_graph *graph, const bt_component_class_filter *component_class, const char *name, const bt_value *params, + bt_logging_level log_level, const bt_component_filter **component); extern bt_graph_status bt_graph_add_filter_component_with_init_method_data( bt_graph *graph, const bt_component_class_filter *component_class, const char *name, const bt_value *params, - void *init_method_data, + void *init_method_data, bt_logging_level log_level, const bt_component_filter **component); extern bt_graph_status bt_graph_add_sink_component( bt_graph *graph, const bt_component_class_sink *component_class, const char *name, const bt_value *params, + bt_logging_level log_level, const bt_component_sink **component); extern bt_graph_status bt_graph_add_sink_component_with_init_method_data( bt_graph *graph, const bt_component_class_sink *component_class, const char *name, const bt_value *params, - void *init_method_data, + void *init_method_data, bt_logging_level log_level, const bt_component_sink **component); extern bt_graph_status bt_graph_connect_ports(bt_graph *graph, diff --git a/src/bindings/python/bt2/bt2/component.py b/src/bindings/python/bt2/bt2/component.py index 3480f657..13c51bf8 100644 --- a/src/bindings/python/bt2/bt2/component.py +++ b/src/bindings/python/bt2/bt2/component.py @@ -184,6 +184,11 @@ class _Component: assert name is not None return name + @property + def logging_level(self): + ptr = self._as_component_ptr(self._ptr) + return native_bt.component_get_logging_level(ptr) + @property def cls(self): cc_ptr = self._borrow_component_class_ptr(self._ptr) @@ -575,6 +580,12 @@ class _UserComponent(metaclass=_UserComponentType): assert name is not None return name + @property + def logging_level(self): + ptr = self._as_not_self_specific_component_ptr(self._ptr) + ptr = self._as_component_ptr(ptr) + return native_bt.component_get_logging_level(ptr) + @property def cls(self): comp_ptr = self._as_not_self_specific_component_ptr(self._ptr) diff --git a/src/bindings/python/bt2/bt2/graph.py b/src/bindings/python/bt2/bt2/graph.py index 998d310b..849b208a 100644 --- a/src/bindings/python/bt2/bt2/graph.py +++ b/src/bindings/python/bt2/bt2/graph.py @@ -25,6 +25,7 @@ import bt2.connection import bt2.component import functools import bt2.port +import bt2.logging import bt2 @@ -76,7 +77,8 @@ class Graph(object._SharedObject): elif status < 0: raise bt2.Error(gen_error_msg) - def add_component(self, component_class, name, params=None): + def add_component(self, component_class, name, params=None, + logging_level=bt2.logging.LoggingLevel.NONE): if isinstance(component_class, bt2.component._GenericSourceComponentClass): cc_ptr = component_class._ptr add_fn = native_bt.graph_add_source_component @@ -106,11 +108,13 @@ class Graph(object._SharedObject): component_class.__class__.__name__)) utils._check_str(name) + utils._check_log_level(logging_level) params = bt2.create_value(params) params_ptr = params._ptr if params is not None else None - status, comp_ptr = add_fn(self._ptr, cc_ptr, name, params_ptr) + status, comp_ptr = add_fn(self._ptr, cc_ptr, name, + params_ptr, logging_level) self._handle_status(status, 'cannot add component to graph') assert comp_ptr return bt2.component._create_component_from_ptr(comp_ptr, cc_type) diff --git a/src/bindings/python/bt2/bt2/native_bt_component.i b/src/bindings/python/bt2/bt2/native_bt_component.i index f484263e..9eb946e8 100644 --- a/src/bindings/python/bt2/bt2/native_bt_component.i +++ b/src/bindings/python/bt2/bt2/native_bt_component.i @@ -86,6 +86,9 @@ extern const char *bt_component_get_name(const bt_component *component); +extern bt_logging_level bt_component_get_logging_level( + const bt_component *component); + extern const bt_component_class *bt_component_borrow_class_const( const bt_component *component); diff --git a/src/bindings/python/bt2/bt2/native_bt_graph.i b/src/bindings/python/bt2/bt2/native_bt_graph.i index bb7a5d13..0fcb70ee 100644 --- a/src/bindings/python/bt2/bt2/native_bt_graph.i +++ b/src/bindings/python/bt2/bt2/native_bt_graph.i @@ -184,36 +184,38 @@ extern bt_graph *bt_graph_create(void); extern bt_graph_status bt_graph_add_source_component(bt_graph *graph, const bt_component_class_source *component_class, const char *name, const bt_value *params, - const bt_component_source **OUT); + bt_logging_level log_level, const bt_component_source **OUT); extern bt_graph_status bt_graph_add_source_component_with_init_method_data( bt_graph *graph, const bt_component_class_source *component_class, const char *name, const bt_value *params, - void *init_method_data, + void *init_method_data, bt_logging_level log_level, const bt_component_source **OUT); extern bt_graph_status bt_graph_add_filter_component(bt_graph *graph, const bt_component_class_filter *component_class, const char *name, const bt_value *params, + bt_logging_level log_level, const bt_component_filter **OUT); extern bt_graph_status bt_graph_add_filter_component_with_init_method_data( bt_graph *graph, const bt_component_class_filter *component_class, const char *name, const bt_value *params, - void *init_method_data, + void *init_method_data, bt_logging_level log_level, const bt_component_filter **OUT); extern bt_graph_status bt_graph_add_sink_component( bt_graph *graph, const bt_component_class_sink *component_class, const char *name, const bt_value *params, + bt_logging_level log_level, const bt_component_sink **OUT); extern bt_graph_status bt_graph_add_sink_component_with_init_method_data( bt_graph *graph, const bt_component_class_sink *component_class, const char *name, const bt_value *params, - void *init_method_data, + void *init_method_data, bt_logging_level log_level, const bt_component_sink **OUT); extern bt_graph_status bt_graph_connect_ports(bt_graph *graph, @@ -326,7 +328,7 @@ port_added_listener( status = BT_GRAPH_LISTENER_STATUS_ERROR; goto end; } - + BT_ASSERT(py_res == Py_None); status = BT_GRAPH_LISTENER_STATUS_OK; @@ -512,7 +514,7 @@ ports_connected_listener( status = BT_GRAPH_LISTENER_STATUS_NOMEM; goto end; } - + py_downstream_component_ptr = SWIG_NewPointerObj(SWIG_as_voidptr(downstream_component), downstream_component_swig_type, 0); if (!py_downstream_component_ptr) { @@ -540,7 +542,7 @@ ports_connected_listener( status = BT_GRAPH_LISTENER_STATUS_ERROR; goto end; } - + BT_ASSERT(py_res == Py_None); status = BT_GRAPH_LISTENER_STATUS_OK; 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 10b555f1..25778fcc 100644 --- a/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py +++ b/src/bindings/python/bt2/bt2/trace_collection_message_iterator.py @@ -34,11 +34,14 @@ _ComponentAndSpec = namedtuple('_ComponentAndSpec', ['comp', 'spec']) class ComponentSpec: - def __init__(self, plugin_name, class_name, params=None): + def __init__(self, plugin_name, class_name, params=None, + logging_level=bt2.logging.LoggingLevel.NONE): utils._check_str(plugin_name) utils._check_str(class_name) + utils._check_log_level(logging_level) self._plugin_name = plugin_name self._class_name = class_name + self._logging_level = logging_level if type(params) is str: self._params = bt2.create_value({'paths': [params]}) @@ -53,6 +56,10 @@ class ComponentSpec: def class_name(self): return self._class_name + @property + def logging_level(self): + return self._logging_level + @property def params(self): return self._params @@ -226,7 +233,8 @@ class TraceCollectionMessageIterator(bt2.message_iterator._MessageIterator): comp_cls = comp_classes[comp_spec.class_name] name = self._get_unique_comp_name(comp_spec) - comp = self._graph.add_component(comp_cls, name, comp_spec.params) + comp = self._graph.add_component(comp_cls, name, comp_spec.params, + comp_spec.logging_level) return comp def _get_free_muxer_input_port(self): diff --git a/src/bindings/python/bt2/bt2/utils.py b/src/bindings/python/bt2/bt2/utils.py index b564fcad..4329d93f 100644 --- a/src/bindings/python/bt2/bt2/utils.py +++ b/src/bindings/python/bt2/bt2/utils.py @@ -21,6 +21,7 @@ # THE SOFTWARE. import bt2 +import bt2.logging def _check_bool(o): @@ -125,3 +126,20 @@ def _handle_ret(ret, msg=None): def _handle_ptr(ptr, msg=None): if ptr is None: _raise_bt2_error(msg) + + +def _check_log_level(log_level): + _check_int(log_level) + + log_levels = ( + bt2.logging.LoggingLevel.VERBOSE, + bt2.logging.LoggingLevel.DEBUG, + bt2.logging.LoggingLevel.INFO, + bt2.logging.LoggingLevel.WARN, + bt2.logging.LoggingLevel.ERROR, + bt2.logging.LoggingLevel.FATAL, + bt2.logging.LoggingLevel.NONE, + ) + + if log_level not in log_levels: + raise ValueError("'{}' is not a valid logging level".format(log_level)) diff --git a/src/cli/babeltrace2.c b/src/cli/babeltrace2.c index 346938a9..7da50712 100644 --- a/src/cli/babeltrace2.c +++ b/src/cli/babeltrace2.c @@ -1782,7 +1782,8 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component( ctx->connect_ports = false; graph_status = bt_graph_add_filter_component( ctx->graph, trimmer_class, trimmer_name, - trimmer_params, &trimmer); + trimmer_params, ctx->cfg->log_level, + &trimmer); free(trimmer_name); if (graph_status != BT_GRAPH_STATUS_OK) { goto error; @@ -2394,19 +2395,19 @@ int cmd_run_ctx_create_components_from_config_components( case BT_COMPONENT_CLASS_TYPE_SOURCE: ret = bt_graph_add_source_component(ctx->graph, comp_cls, cfg_comp->instance_name->str, - cfg_comp->params, + cfg_comp->params, ctx->cfg->log_level, (void *) &comp); break; case BT_COMPONENT_CLASS_TYPE_FILTER: ret = bt_graph_add_filter_component(ctx->graph, comp_cls, cfg_comp->instance_name->str, - cfg_comp->params, + cfg_comp->params, ctx->cfg->log_level, (void *) &comp); break; case BT_COMPONENT_CLASS_TYPE_SINK: ret = bt_graph_add_sink_component(ctx->graph, comp_cls, cfg_comp->instance_name->str, - cfg_comp->params, + cfg_comp->params, ctx->cfg->log_level, (void *) &comp); break; default: diff --git a/src/lib/graph/component.c b/src/lib/graph/component.c index 3bb901fa..b02d2a8c 100644 --- a/src/lib/graph/component.c +++ b/src/lib/graph/component.c @@ -24,6 +24,7 @@ #define BT_LOG_TAG "LIB/COMPONENT" #include "lib/lib-logging.h" +#include "common/common.h" #include "common/assert.h" #include "lib/assert-pre.h" #include @@ -282,7 +283,8 @@ uint64_t bt_component_get_output_port_count(const struct bt_component *comp) BT_HIDDEN int bt_component_create(struct bt_component_class *component_class, - const char *name, struct bt_component **user_component) + const char *name, bt_logging_level log_level, + struct bt_component **user_component) { int ret = 0; struct bt_component *component = NULL; @@ -293,7 +295,8 @@ int bt_component_create(struct bt_component_class *component_class, BT_ASSERT(name); type = bt_component_class_get_type(component_class); BT_LIB_LOGI("Creating empty component from component class: %![cc-]+C, " - "comp-name=\"%s\"", component_class, name); + "comp-name=\"%s\", log-level=%s", component_class, name, + bt_common_logging_level_string(log_level)); component = component_create_funcs[type](component_class); if (!component) { BT_LOGE_STR("Cannot create specific component object."); @@ -312,6 +315,7 @@ int bt_component_create(struct bt_component_class *component_class, goto end; } + component->log_level = log_level; component->input_ports = g_ptr_array_new_with_free_func( (GDestroyNotify) bt_object_try_spec_release); if (!component->input_ports) { @@ -674,6 +678,13 @@ void bt_component_remove_destroy_listener(struct bt_component *component, } } +bt_logging_level bt_component_get_logging_level( + const struct bt_component *component) +{ + BT_ASSERT_PRE_NON_NULL(component, "Component"); + return component->log_level; +} + void bt_component_get_ref(const struct bt_component *component) { bt_object_get_ref(component); diff --git a/src/lib/graph/component.h b/src/lib/graph/component.h index 285a8e9a..2155d5da 100644 --- a/src/lib/graph/component.h +++ b/src/lib/graph/component.h @@ -28,6 +28,7 @@ #include #include "lib/object.h" #include +#include #include "common/assert.h" #include #include @@ -49,6 +50,7 @@ struct bt_component { struct bt_object base; struct bt_component_class *class; GString *name; + bt_logging_level log_level; /* * Internal destroy function specific to a source, filter, or @@ -78,7 +80,8 @@ struct bt_graph *bt_component_borrow_graph(struct bt_component *comp) BT_HIDDEN int bt_component_create(struct bt_component_class *component_class, - const char *name, struct bt_component **component); + const char *name, bt_logging_level log_level, + struct bt_component **component); BT_HIDDEN enum bt_self_component_status bt_component_accept_port_connection( diff --git a/src/lib/graph/graph.c b/src/lib/graph/graph.c index f738559e..70d958fc 100644 --- a/src/lib/graph/graph.c +++ b/src/lib/graph/graph.c @@ -1269,7 +1269,8 @@ enum bt_graph_status add_component_with_init_method_data( struct bt_component_class *comp_cls, comp_init_method_t init_method, const char *name, const struct bt_value *params, - void *init_method_data, struct bt_component **user_component) + void *init_method_data, bt_logging_level log_level, + struct bt_component **user_component) { enum bt_graph_status graph_status = BT_GRAPH_STATUS_OK; enum bt_self_component_status comp_status; @@ -1292,9 +1293,11 @@ enum bt_graph_status add_component_with_init_method_data( init_can_consume = graph->can_consume; bt_graph_set_can_consume(graph, false); BT_LIB_LOGI("Adding component to graph: " - "%![graph-]+g, %![cc-]+C, name=\"%s\", %![params-]+v, " - "init-method-data-addr=%p", - graph, comp_cls, name, params, init_method_data); + "%![graph-]+g, %![cc-]+C, name=\"%s\", log-level=%s, " + "%![params-]+v, init-method-data-addr=%p", + graph, comp_cls, name, + bt_common_logging_level_string(log_level), params, + init_method_data); if (!params) { new_params = bt_value_map_create(); @@ -1307,7 +1310,7 @@ enum bt_graph_status add_component_with_init_method_data( params = new_params; } - ret = bt_component_create(comp_cls, name, &component); + ret = bt_component_create(comp_cls, name, log_level, &component); if (ret) { BT_LOGE("Cannot create empty component object: ret=%d", ret); @@ -1360,9 +1363,11 @@ enum bt_graph_status add_component_with_init_method_data( BT_LOGD_STR("Freezing component class."); bt_component_class_freeze(comp_cls); BT_LIB_LOGI("Added component to graph: " - "%![graph-]+g, %![cc-]+C, name=\"%s\", %![params-]+v, " - "init-method-data-addr=%p, %![comp-]+c", - graph, comp_cls, name, params, init_method_data, component); + "%![graph-]+g, %![cc-]+C, name=\"%s\", log-level=%s, " + "%![params-]+v, init-method-data-addr=%p, %![comp-]+c", + graph, comp_cls, name, + bt_common_logging_level_string(log_level), params, + init_method_data, component); if (user_component) { /* Move reference to user */ @@ -1387,23 +1392,24 @@ bt_graph_add_source_component_with_init_method_data( struct bt_graph *graph, const struct bt_component_class_source *comp_cls, const char *name, const struct bt_value *params, - void *init_method_data, + void *init_method_data, bt_logging_level log_level, const struct bt_component_source **component) { BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class"); return add_component_with_init_method_data(graph, (void *) comp_cls, (comp_init_method_t) comp_cls->methods.init, - name, params, init_method_data, (void *) component); + name, params, init_method_data, log_level, (void *) component); } enum bt_graph_status bt_graph_add_source_component( struct bt_graph *graph, const struct bt_component_class_source *comp_cls, const char *name, const struct bt_value *params, + bt_logging_level log_level, const struct bt_component_source **component) { return bt_graph_add_source_component_with_init_method_data( - graph, comp_cls, name, params, NULL, component); + graph, comp_cls, name, params, NULL, log_level, component); } enum bt_graph_status @@ -1411,23 +1417,24 @@ bt_graph_add_filter_component_with_init_method_data( struct bt_graph *graph, const struct bt_component_class_filter *comp_cls, const char *name, const struct bt_value *params, - void *init_method_data, + void *init_method_data, bt_logging_level log_level, const struct bt_component_filter **component) { BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class"); return add_component_with_init_method_data(graph, (void *) comp_cls, (comp_init_method_t) comp_cls->methods.init, - name, params, init_method_data, (void *) component); + name, params, init_method_data, log_level, (void *) component); } enum bt_graph_status bt_graph_add_filter_component( struct bt_graph *graph, const struct bt_component_class_filter *comp_cls, const char *name, const struct bt_value *params, + bt_logging_level log_level, const struct bt_component_filter **component) { return bt_graph_add_filter_component_with_init_method_data( - graph, comp_cls, name, params, NULL, component); + graph, comp_cls, name, params, NULL, log_level, component); } enum bt_graph_status @@ -1435,23 +1442,24 @@ bt_graph_add_sink_component_with_init_method_data( struct bt_graph *graph, const struct bt_component_class_sink *comp_cls, const char *name, const struct bt_value *params, - void *init_method_data, + void *init_method_data, bt_logging_level log_level, const struct bt_component_sink **component) { BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class"); return add_component_with_init_method_data(graph, (void *) comp_cls, (comp_init_method_t) comp_cls->methods.init, - name, params, init_method_data, (void *) component); + name, params, init_method_data, log_level, (void *) component); } enum bt_graph_status bt_graph_add_sink_component( struct bt_graph *graph, const struct bt_component_class_sink *comp_cls, const char *name, const struct bt_value *params, + bt_logging_level log_level, const struct bt_component_sink **component) { return bt_graph_add_sink_component_with_init_method_data( - graph, comp_cls, name, params, NULL, component); + graph, comp_cls, name, params, NULL, log_level, component); } BT_HIDDEN diff --git a/src/lib/graph/iterator.c b/src/lib/graph/iterator.c index e2152039..1303003f 100644 --- a/src/lib/graph/iterator.c +++ b/src/lib/graph/iterator.c @@ -745,12 +745,19 @@ bt_port_output_message_iterator_create(struct bt_graph *graph, colander_data.msgs = (void *) iterator->base.msgs->pdata; colander_data.count_addr = &iterator->count; - /* Hope that nobody uses this very unique name */ + /* + * Hope that nobody uses this very unique name. + * + * We pass `BT_LOGGING_LEVEL_NONE` but the colander component + * class module does not use this level anyway since it belongs + * to the library. + */ graph_status = bt_graph_add_sink_component_with_init_method_data( (void *) graph, colander_comp_cls, "colander-36ac3409-b1a8-4d60-ab1f-4fdf341a8fb1", - NULL, &colander_data, (void *) &iterator->colander); + NULL, &colander_data, BT_LOGGING_LEVEL_NONE, + (void *) &iterator->colander); if (graph_status != BT_GRAPH_STATUS_OK) { BT_LIB_LOGW("Cannot add colander sink component to graph: " "%1[graph-]+g, status=%s", graph, diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index e29c2e90..1433489b 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -1055,8 +1055,9 @@ static inline void format_component(char **buf_ch, bool extended, { char tmp_prefix[TMP_PREFIX_LEN]; - BUF_APPEND(", %sname=\"%s\"", - PRFIELD_GSTRING(component->name)); + BUF_APPEND(", %sname=\"%s\", %slog-level=%s", + PRFIELD_GSTRING(component->name), + PRFIELD(bt_common_logging_level_string(component->log_level))); if (component->class) { SET_TMP_PREFIX("class-"); diff --git a/tests/lib/test_graph_topo.c b/tests/lib/test_graph_topo.c index 7a85f511..0a3111cd 100644 --- a/tests/lib/test_graph_topo.c +++ b/tests/lib/test_graph_topo.c @@ -527,7 +527,7 @@ const bt_component_source *create_src(bt_graph *graph) int ret; ret = bt_graph_add_source_component(graph, src_comp_class, - "src-comp", NULL, &comp); + "src-comp", NULL, BT_LOGGING_LEVEL_NONE, &comp); BT_ASSERT(ret == 0); return comp; } @@ -539,7 +539,7 @@ const bt_component_sink *create_sink(bt_graph *graph) int ret; ret = bt_graph_add_sink_component(graph, sink_comp_class, - "sink-comp", NULL, &comp); + "sink-comp", NULL, BT_LOGGING_LEVEL_NONE, &comp); BT_ASSERT(ret == 0); return comp; } diff --git a/tests/lib/test_plugin.c b/tests/lib/test_plugin.c index 39b054e5..bd96bd0b 100644 --- a/tests/lib/test_plugin.c +++ b/tests/lib/test_plugin.c @@ -195,7 +195,7 @@ static void test_sfs(const char *plugin_dir) graph = bt_graph_create(); BT_ASSERT(graph); graph_ret = bt_graph_add_sink_component(graph, sink_comp_class, - "the-sink", NULL, &sink_component); + "the-sink", NULL, BT_LOGGING_LEVEL_NONE, &sink_component); ok(graph_ret == BT_GRAPH_STATUS_OK && sink_component, "bt_graph_add_sink_component() still works after the plugin object is destroyed"); BT_COMPONENT_SINK_PUT_REF_AND_RESET(sink_component); diff --git a/tests/lib/test_trace_ir_ref.c b/tests/lib/test_trace_ir_ref.c index 72bbbd6b..53eaca01 100644 --- a/tests/lib/test_trace_ir_ref.c +++ b/tests/lib/test_trace_ir_ref.c @@ -471,7 +471,7 @@ static void test_example_scenario_in_graph(void) BT_ASSERT(ret == 0); graph = bt_graph_create(); ret = bt_graph_add_source_component(graph, comp_cls, "src-comp", - NULL, NULL); + NULL, BT_LOGGING_LEVEL_NONE, NULL); BT_ASSERT(ret == 0); bt_graph_put_ref(graph); bt_component_class_source_put_ref(comp_cls);