`ctf` plugin: metadata: use BT_COMP_LOG*() instead of BT_LOG*()
[babeltrace.git] / src / plugins / ctf / common / metadata / ctf-meta-update-default-clock-classes.c
index e9578641959818754a5ce4be47d1b86a9b5ab0f5..85575c0a24f8f7543d958676027aa46701a58c1c 100644 (file)
  * all copies or substantial portions of the Software.
  */
 
-#define BT_LOG_OUTPUT_LEVEL log_level
+#define BT_COMP_LOG_SELF_COMP (log_cfg->self_comp)
+#define BT_LOG_OUTPUT_LEVEL (log_cfg->log_level)
 #define BT_LOG_TAG "PLUGIN/CTF/META/UPDATE-DEF-CC"
-#include "logging/log.h"
+#include "plugins/comp-logging.h"
 
 #include <babeltrace2/babeltrace.h>
 #include "common/macros.h"
 #include <inttypes.h>
 
 #include "ctf-meta-visitors.h"
+#include "logging.h"
 
 static inline
 int find_mapped_clock_class(struct ctf_field_class *fc,
                struct ctf_clock_class **clock_class,
-               bt_logging_level log_level)
+               struct meta_log_config *log_cfg)
 {
        int ret = 0;
        uint64_t i;
@@ -47,7 +49,7 @@ int find_mapped_clock_class(struct ctf_field_class *fc,
                if (int_fc->mapped_clock_class) {
                        if (*clock_class && *clock_class !=
                                        int_fc->mapped_clock_class) {
-                               BT_LOGE("Stream class contains more than one "
+                               BT_COMP_LOGE("Stream class contains more than one "
                                        "clock class: expected-cc-name=\"%s\", "
                                        "other-cc-name=\"%s\"",
                                        (*clock_class)->name->str,
@@ -71,7 +73,7 @@ int find_mapped_clock_class(struct ctf_field_class *fc,
                                        struct_fc, i);
 
                        ret = find_mapped_clock_class(named_fc->fc,
-                               clock_class, log_level);
+                               clock_class, log_cfg);
                        if (ret) {
                                goto end;
                        }
@@ -89,7 +91,7 @@ int find_mapped_clock_class(struct ctf_field_class *fc,
                                        var_fc, i);
 
                        ret = find_mapped_clock_class(named_fc->fc,
-                               clock_class, log_level);
+                               clock_class, log_cfg);
                        if (ret) {
                                goto end;
                        }
@@ -103,7 +105,7 @@ int find_mapped_clock_class(struct ctf_field_class *fc,
                struct ctf_field_class_array_base *array_fc = (void *) fc;
 
                ret = find_mapped_clock_class(array_fc->elem_fc, clock_class,
-                       log_level);
+                       log_cfg);
                if (ret) {
                        goto end;
                }
@@ -121,7 +123,7 @@ end:
 static inline
 int update_stream_class_default_clock_class(
                struct ctf_stream_class *stream_class,
-               bt_logging_level log_level)
+               struct meta_log_config *log_cfg)
 {
        int ret = 0;
        struct ctf_clock_class *clock_class =
@@ -129,19 +131,19 @@ int update_stream_class_default_clock_class(
        uint64_t i;
 
        ret = find_mapped_clock_class(stream_class->packet_context_fc,
-               &clock_class, log_level);
+               &clock_class, log_cfg);
        if (ret) {
                goto end;
        }
 
        ret = find_mapped_clock_class(stream_class->event_header_fc,
-               &clock_class, log_level);
+               &clock_class, log_cfg);
        if (ret) {
                goto end;
        }
 
        ret = find_mapped_clock_class(stream_class->event_common_context_fc,
-               &clock_class, log_level);
+               &clock_class, log_cfg);
        if (ret) {
                goto end;
        }
@@ -151,13 +153,13 @@ int update_stream_class_default_clock_class(
                        stream_class->event_classes->pdata[i];
 
                ret = find_mapped_clock_class(event_class->spec_context_fc,
-                       &clock_class, log_level);
+                       &clock_class, log_cfg);
                if (ret) {
                        goto end;
                }
 
                ret = find_mapped_clock_class(event_class->payload_fc,
-                       &clock_class, log_level);
+                       &clock_class, log_cfg);
                if (ret) {
                        goto end;
                }
@@ -173,14 +175,14 @@ end:
 
 BT_HIDDEN
 int ctf_trace_class_update_default_clock_classes(struct ctf_trace_class *ctf_tc,
-               bt_logging_level log_level)
+               struct meta_log_config *log_cfg)
 {
        uint64_t i;
        int ret = 0;
        struct ctf_clock_class *clock_class = NULL;
 
        ret = find_mapped_clock_class(ctf_tc->packet_header_fc, &clock_class,
-               log_level);
+               log_cfg);
        if (ret) {
                goto end;
        }
@@ -195,9 +197,9 @@ int ctf_trace_class_update_default_clock_classes(struct ctf_trace_class *ctf_tc,
                        ctf_tc->stream_classes->pdata[i];
 
                ret = update_stream_class_default_clock_class(
-                       ctf_tc->stream_classes->pdata[i], log_level);
+                       ctf_tc->stream_classes->pdata[i], log_cfg);
                if (ret) {
-                       BT_LOGE("Stream class contains more than one "
+                       BT_COMP_LOGE("Stream class contains more than one "
                                "clock class: stream-class-id=%" PRIu64,
                                sc->id);
                        goto end;
This page took 0.025878 seconds and 4 git commands to generate.