utils.sink.counter: use BT_COMP_LOG*() instead of BT_LOG*()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 17 Jun 2019 17:19:57 +0000 (13:19 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 20 Jun 2019 18:01:16 +0000 (14:01 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ic963197053b374df6b891c8b6af1050255c626d9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1481
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/plugins/utils/counter/counter.c
src/plugins/utils/counter/counter.h

index 2438a4e02a8c3dc028c5e6c3ee106ca9283151f4..f8561e765bc67ae9c450b35453701254b1cf3e3e 100644 (file)
  * SOFTWARE.
  */
 
+#define BT_COMP_LOG_SELF_COMP (counter->self_comp)
 #define BT_LOG_OUTPUT_LEVEL (counter->log_level)
 #define BT_LOG_TAG "PLUGIN/FLT.UTILS.COUNTER"
-#include "logging/log.h"
+#include "plugins/comp-logging.h"
 
 #include <babeltrace2/babeltrace.h>
 #include "common/macros.h"
@@ -151,9 +152,10 @@ bt_self_component_status counter_init(
                goto error;
        }
 
+       counter->self_comp =
+               bt_self_component_sink_as_self_component(component);
        counter->log_level = bt_component_get_logging_level(
-               bt_self_component_as_component(
-                       bt_self_component_sink_as_self_component(component)));
+               bt_self_component_as_component(counter->self_comp));
        ret = bt_self_component_sink_add_input_port(component,
                "in", NULL, NULL);
        if (ret != BT_SELF_COMPONENT_STATUS_OK) {
@@ -165,7 +167,7 @@ bt_self_component_status counter_init(
        step = bt_value_map_borrow_entry_value_const(params, "step");
        if (step) {
                if (!bt_value_is_unsigned_integer(step)) {
-                       BT_LOGE("`step` parameter: expecting an unsigned integer value: "
+                       BT_COMP_LOGE("`step` parameter: expecting an unsigned integer value: "
                                "type=%s", bt_common_value_type_string(
                                        bt_value_get_type(step)));
                        goto error;
@@ -177,7 +179,7 @@ bt_self_component_status counter_init(
        hide_zero = bt_value_map_borrow_entry_value_const(params, "hide-zero");
        if (hide_zero) {
                if (!bt_value_is_bool(hide_zero)) {
-                       BT_LOGE("`hide-zero` parameter: expecting a boolean value: "
+                       BT_COMP_LOGE("`hide-zero` parameter: expecting a boolean value: "
                                "type=%s", bt_common_value_type_string(
                                        bt_value_get_type(hide_zero)));
                        goto error;
index 81329090c8cf6f0c116d808c5c19032f3c7564bd..48135ef3ebfab0e940928a99694b1f4fc4f32fa2 100644 (file)
@@ -49,6 +49,7 @@ struct counter {
        uint64_t step;
        bool hide_zero;
        bt_logging_level log_level;
+       bt_self_component *self_comp;
 };
 
 BT_HIDDEN
This page took 0.026218 seconds and 4 git commands to generate.