* all copies or substantial portions of the Software.
*/
-#define BT_LOG_TAG "PLUGIN-CTF-METADATA-META-UPDATE-DEF-CC"
-#include "logging.h"
+#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 "plugins/comp-logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <glib.h>
#include <stdint.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)
+ struct ctf_clock_class **clock_class,
+ struct meta_log_config *log_cfg)
{
int ret = 0;
uint64_t i;
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,
struct_fc, i);
ret = find_mapped_clock_class(named_fc->fc,
- clock_class);
+ clock_class, log_cfg);
if (ret) {
goto end;
}
var_fc, i);
ret = find_mapped_clock_class(named_fc->fc,
- clock_class);
+ clock_class, log_cfg);
if (ret) {
goto end;
}
{
struct ctf_field_class_array_base *array_fc = (void *) fc;
- ret = find_mapped_clock_class(array_fc->elem_fc, clock_class);
+ ret = find_mapped_clock_class(array_fc->elem_fc, clock_class,
+ log_cfg);
if (ret) {
goto end;
}
static inline
int update_stream_class_default_clock_class(
- struct ctf_stream_class *stream_class)
+ struct ctf_stream_class *stream_class,
+ struct meta_log_config *log_cfg)
{
int ret = 0;
struct ctf_clock_class *clock_class =
uint64_t i;
ret = find_mapped_clock_class(stream_class->packet_context_fc,
- &clock_class);
+ &clock_class, log_cfg);
if (ret) {
goto end;
}
ret = find_mapped_clock_class(stream_class->event_header_fc,
- &clock_class);
+ &clock_class, log_cfg);
if (ret) {
goto end;
}
ret = find_mapped_clock_class(stream_class->event_common_context_fc,
- &clock_class);
+ &clock_class, log_cfg);
if (ret) {
goto end;
}
stream_class->event_classes->pdata[i];
ret = find_mapped_clock_class(event_class->spec_context_fc,
- &clock_class);
+ &clock_class, log_cfg);
if (ret) {
goto end;
}
ret = find_mapped_clock_class(event_class->payload_fc,
- &clock_class);
+ &clock_class, log_cfg);
if (ret) {
goto end;
}
}
BT_HIDDEN
-int ctf_trace_class_update_default_clock_classes(struct ctf_trace_class *ctf_tc)
+int ctf_trace_class_update_default_clock_classes(struct ctf_trace_class *ctf_tc,
+ 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);
+ ret = find_mapped_clock_class(ctf_tc->packet_header_fc, &clock_class,
+ log_cfg);
if (ret) {
goto end;
}
ctf_tc->stream_classes->pdata[i];
ret = update_stream_class_default_clock_class(
- ctf_tc->stream_classes->pdata[i]);
+ 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;