ctf: append error causes when returning errors
[babeltrace.git] / src / plugins / ctf / common / metadata / ctf-meta-resolve.c
index 05b67e93e5310f6e121127a2db9d590224f1d193..a8019da264865529b294bed13a050e80b082d7e2 100644 (file)
@@ -1,28 +1,22 @@
 /*
- * Copyright 2016-2018 - Philippe Proulx <pproulx@efficios.com>
- * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * SPDX-License-Identifier: MIT
  *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * Copyright 2016-2018 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  */
 
 #define BT_COMP_LOG_SELF_COMP (ctx->self_comp)
+#define BT_COMP_LOG_SELF_COMP_CLASS (ctx->self_comp_class)
 #define BT_LOG_OUTPUT_LEVEL (ctx->log_level)
 #define BT_LOG_TAG "PLUGIN/CTF/META/RESOLVE"
-#include "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
 
 #include <babeltrace2/babeltrace.h>
 #include "common/macros.h"
 #include "common/assert.h"
 #include "common/common.h"
 #include <glib.h>
+#include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
 #include <inttypes.h>
@@ -54,7 +48,11 @@ struct field_class_stack_frame {
  */
 struct resolve_context {
        bt_logging_level log_level;
+
+       /* Weak, exactly one of these must be set */
        bt_self_component *self_comp;
+       bt_self_component_class *self_comp_class;
+
        struct ctf_trace_class *tc;
        struct ctf_stream_class *sc;
        struct ctf_event_class *ec;
@@ -136,14 +134,14 @@ int field_class_stack_push(field_class_stack *stack, struct ctf_field_class *fc,
        struct field_class_stack_frame *frame = NULL;
 
        if (!stack || !fc) {
-               BT_COMP_LOGE("Invalid parameter: stack or field class is NULL.");
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Invalid parameter: stack or field class is `NULL`.");
                ret = -1;
                goto end;
        }
 
        frame = g_new0(struct field_class_stack_frame, 1);
        if (!frame) {
-               BT_COMP_LOGE_STR("Failed to allocate one field class stack frame.");
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Failed to allocate one field class stack frame.");
                ret = -1;
                goto end;
        }
@@ -181,15 +179,10 @@ size_t field_class_stack_size(field_class_stack *stack)
 static
 struct field_class_stack_frame *field_class_stack_peek(field_class_stack *stack)
 {
-       struct field_class_stack_frame *entry = NULL;
-
-       if (!stack || field_class_stack_empty(stack)) {
-               goto end;
-       }
+       BT_ASSERT(stack);
+       BT_ASSERT(!field_class_stack_empty(stack));
 
-       entry = g_ptr_array_index(stack, stack->len - 1);
-end:
-       return entry;
+       return g_ptr_array_index(stack, stack->len - 1);
 }
 
 /*
@@ -199,16 +192,10 @@ static
 struct field_class_stack_frame *field_class_stack_at(field_class_stack *stack,
                size_t index)
 {
-       struct field_class_stack_frame *entry = NULL;
-
-       if (!stack || index >= stack->len) {
-               goto end;
-       }
+       BT_ASSERT(stack);
+       BT_ASSERT(index < stack->len);
 
-       entry = g_ptr_array_index(stack, index);
-
-end:
-       return entry;
+       return g_ptr_array_index(stack, index);
 }
 
 /*
@@ -250,7 +237,7 @@ struct ctf_field_class *borrow_class_from_ctx(struct resolve_context *ctx,
        case CTF_SCOPE_EVENT_PAYLOAD:
                return ctx->scopes.event_payload;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return NULL;
@@ -265,14 +252,14 @@ enum ctf_scope get_root_scope_from_absolute_pathstr(const char *pathstr,
                struct resolve_context *ctx)
 {
        enum ctf_scope scope;
-       enum ctf_scope ret = -1;
+       enum ctf_scope ret = CTF_SCOPE_PACKET_UNKNOWN;
        const size_t prefixes_count = sizeof(absolute_path_prefixes) /
                sizeof(*absolute_path_prefixes);
 
        for (scope = CTF_SCOPE_PACKET_HEADER; scope < CTF_SCOPE_PACKET_HEADER +
                        prefixes_count; scope++) {
                /*
-                * Chech if path string starts with a known absolute
+                * Check if path string starts with a known absolute
                 * path prefix.
                 *
                 * Refer to CTF 7.3.2 STATIC AND DYNAMIC SCOPES.
@@ -351,7 +338,7 @@ GList *pathstr_to_ptokens(const char *pathstr, struct resolve_context *ctx)
 
                        if (at == last) {
                                /* Error: empty token */
-                               BT_COMP_LOGE("Empty path token: path=\"%s\", pos=%u",
+                               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Empty path token: path=\"%s\", pos=%u",
                                        pathstr, (unsigned int) (at - pathstr));
                                goto error;
                        }
@@ -379,8 +366,8 @@ error:
 /*
  * Converts a path token list to a field path object. The path token
  * list is relative from `fc`. The index of the source looking for its
- * target within `fc` is indicated by `src_index`. This can be `INT64_MAX`
- * if the source is contained in `fc`.
+ * target within `fc` is indicated by `src_index`. This can be
+ * `INT64_MAX` if the source is contained in `fc`.
  *
  * `field_path` is an output parameter owned by the caller that must be
  * filled here.
@@ -408,7 +395,7 @@ int ptokens_to_field_path(GList *ptokens, struct ctf_field_path *field_path,
                        child_index = -1;
                } else {
                        child_index =
-                               ctf_field_class_compound_get_field_class_index_from_name(
+                               ctf_field_class_compound_get_field_class_index_from_orig_name(
                                        fc, ft_name);
                        if (child_index < 0) {
                                /*
@@ -481,7 +468,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
        switch (field_path->root) {
        case CTF_SCOPE_PACKET_HEADER:
                if (ctx->tc->is_translated) {
-                       BT_COMP_LOGE("Trace class is already translated: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Trace class is already translated: "
                                "root-scope=%s",
                                ctf_scope_string(field_path->root));
                        ret = -1;
@@ -493,7 +480,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
        case CTF_SCOPE_EVENT_HEADER:
        case CTF_SCOPE_EVENT_COMMON_CONTEXT:
                if (!ctx->sc) {
-                       BT_COMP_LOGE("No current stream class: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("No current stream class: "
                                "root-scope=%s",
                                ctf_scope_string(field_path->root));
                        ret = -1;
@@ -501,7 +488,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                }
 
                if (ctx->sc->is_translated) {
-                       BT_COMP_LOGE("Stream class is already translated: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Stream class is already translated: "
                                "root-scope=%s",
                                ctf_scope_string(field_path->root));
                        ret = -1;
@@ -512,7 +499,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
        case CTF_SCOPE_EVENT_SPECIFIC_CONTEXT:
        case CTF_SCOPE_EVENT_PAYLOAD:
                if (!ctx->ec) {
-                       BT_COMP_LOGE("No current event class: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("No current event class: "
                                "root-scope=%s",
                                ctf_scope_string(field_path->root));
                        ret = -1;
@@ -520,7 +507,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                }
 
                if (ctx->ec->is_translated) {
-                       BT_COMP_LOGE("Event class is already translated: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Event class is already translated: "
                                "root-scope=%s",
                                ctf_scope_string(field_path->root));
                        ret = -1;
@@ -530,7 +517,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                break;
 
        default:
-               abort();
+               bt_common_abort();
        }
 
        /* Skip absolute path tokens */
@@ -541,7 +528,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
        fc = borrow_class_from_ctx(ctx, field_path->root);
        if (!fc) {
                /* Error: root class is not available */
-               BT_COMP_LOGE("Root field class is not available: "
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Root field class is not available: "
                        "root-scope=%s",
                        ctf_scope_string(field_path->root));
                ret = -1;
@@ -652,7 +639,7 @@ int pathstr_to_field_path(const char *pathstr,
        /* Convert path string to path tokens */
        ptokens = pathstr_to_ptokens(pathstr, ctx);
        if (!ptokens) {
-               BT_COMP_LOGE("Cannot convert path string to path tokens: "
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot convert path string to path tokens: "
                        "path=\"%s\"", pathstr);
                ret = -1;
                goto end;
@@ -661,14 +648,14 @@ int pathstr_to_field_path(const char *pathstr,
        /* Absolute or relative path? */
        root_scope = get_root_scope_from_absolute_pathstr(pathstr, ctx);
 
-       if (root_scope == -1) {
+       if (root_scope == CTF_SCOPE_PACKET_UNKNOWN) {
                /* Relative path: start with current root scope */
                field_path->root = ctx->root_scope;
                BT_COMP_LOGD("Detected relative path: starting with current root scope: "
                        "scope=%s", ctf_scope_string(field_path->root));
                ret = relative_ptokens_to_field_path(ptokens, field_path, ctx);
                if (ret) {
-                       BT_COMP_LOGE("Cannot get relative field path of path string: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot get relative field path of path string: "
                                "path=\"%s\", start-scope=%s, end-scope=%s",
                                pathstr, ctf_scope_string(ctx->root_scope),
                                ctf_scope_string(field_path->root));
@@ -681,7 +668,7 @@ int pathstr_to_field_path(const char *pathstr,
                        "scope=%s", ctf_scope_string(field_path->root));
                ret = absolute_ptokens_to_field_path(ptokens, field_path, ctx);
                if (ret) {
-                       BT_COMP_LOGE("Cannot get absolute field path of path string: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot get absolute field path of path string: "
                                "path=\"%s\", root-scope=%s",
                                pathstr, ctf_scope_string(root_scope));
                        goto end;
@@ -721,7 +708,7 @@ struct ctf_field_class *field_path_to_field_class(
        fc = borrow_class_from_ctx(ctx, field_path->root);
        if (!fc) {
                /* Error: root class is not available */
-               BT_COMP_LOGE("Root field class is not available: root-scope=%s",
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Root field class is not available: root-scope=%s",
                        ctf_scope_string(field_path->root));
                goto end;
        }
@@ -770,6 +757,7 @@ void get_ctx_stack_field_path(struct resolve_context *ctx,
  * Returns the index of the lowest common ancestor of two field path
  * objects having the same root scope.
  */
+static
 int64_t get_field_paths_lca_index(struct ctf_field_path *field_path1,
                struct ctf_field_path *field_path2,
                struct resolve_context *ctx)
@@ -817,7 +805,7 @@ int64_t get_field_paths_lca_index(struct ctf_field_path *field_path1,
                         * This is invalid because the target cannot be
                         * an ancestor of the source.
                         */
-                       BT_COMP_LOGE("Source field class is an ancestor of target field class or vice versa: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Source field class is an ancestor of target field class or vice versa: "
                                "lca-index=%" PRId64 ", "
                                "field-path-1-len=%" PRIu64 ", "
                                "field-path-2-len=%" PRIu64,
@@ -864,7 +852,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
         * Make sure the target is not a root.
         */
        if (target_field_path_len == 0) {
-               BT_COMP_LOGE_STR("Target field path's length is 0 (targeting the root).");
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Target field path's length is 0 (targeting the root).");
                ret = -1;
                goto end;
        }
@@ -874,7 +862,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
         * after the context field path's root.
         */
        if (target_field_path->root > ctx_field_path.root) {
-               BT_COMP_LOGE("Target field class is located after source field class: "
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Target field class is located after source field class: "
                        "target-root=%s, source-root=%s",
                        ctf_scope_string(target_field_path->root),
                        ctf_scope_string(ctx_field_path.root));
@@ -892,7 +880,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
                lca_index = get_field_paths_lca_index(target_field_path,
                        &ctx_field_path, ctx);
                if (lca_index < 0) {
-                       BT_COMP_LOGE_STR("Cannot get least common ancestor.");
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot get least common ancestor.");
                        ret = -1;
                        goto end;
                }
@@ -907,7 +895,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
                        &ctx_field_path, (uint64_t) lca_index);
 
                if (target_index >= ctx_index) {
-                       BT_COMP_LOGE("Target field class's index is greater than or equal to source field class's index in LCA: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Target field class's index is greater than or equal to source field class's index in LCA: "
                                "lca-index=%" PRId64 ", "
                                "target-index=%" PRId64 ", "
                                "source-index=%" PRId64,
@@ -923,7 +911,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
        switch (ctx->cur_fc->type) {
        case CTF_FIELD_CLASS_TYPE_VARIANT:
                if (target_fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
-                       BT_COMP_LOGE("Variant field class's tag field class is not an enumeration field class: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Variant field class's tag field class is not an enumeration field class: "
                                "tag-fc-addr=%p, tag-fc-id=%d",
                                target_fc, target_fc->type);
                        ret = -1;
@@ -936,7 +924,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
 
                if (target_fc->type != CTF_FIELD_CLASS_TYPE_INT &&
                                target_fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
-                       BT_COMP_LOGE("Sequence field class's length field class is not an unsigned integer field class: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Sequence field class's length field class is not an unsigned integer field class: "
                                "length-fc-addr=%p, length-fc-id=%d",
                                target_fc, target_fc->type);
                        ret = -1;
@@ -944,7 +932,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
                }
 
                if (int_fc->is_signed) {
-                       BT_COMP_LOGE("Sequence field class's length field class is not an unsigned integer field class: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Sequence field class's length field class is not an unsigned integer field class: "
                                "length-fc-addr=%p, length-fc-id=%d",
                                target_fc, target_fc->type);
                        ret = -1;
@@ -953,7 +941,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
@@ -992,11 +980,11 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (!pathstr) {
-               BT_COMP_LOGE_STR("Cannot get path string.");
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot get path string.");
                ret = -1;
                goto end;
        }
@@ -1004,7 +992,7 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
        /* Get target field path out of path string */
        ret = pathstr_to_field_path(pathstr, &target_field_path, ctx);
        if (ret) {
-               BT_COMP_LOGE("Cannot get target field path for path string: "
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot get target field path for path string: "
                        "path=\"%s\"", pathstr);
                goto end;
        }
@@ -1017,7 +1005,7 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
        /* Get target field class */
        target_fc = field_path_to_field_class(&target_field_path, ctx);
        if (!target_fc) {
-               BT_COMP_LOGE("Cannot get target field class for path string: "
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot get target field class for path string: "
                        "path=\"%s\", target-field-path=\"%s\"",
                        pathstr, target_field_path_pretty_str);
                ret = -1;
@@ -1027,7 +1015,7 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
        ret = validate_target_field_path(&target_field_path,
                target_fc, ctx);
        if (ret) {
-               BT_COMP_LOGE("Invalid target field path for path string: "
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Invalid target field path for path string: "
                        "path=\"%s\", target-field-path=\"%s\"",
                        pathstr, target_field_path_pretty_str);
                goto end;
@@ -1055,7 +1043,7 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
@@ -1088,7 +1076,7 @@ int resolve_field_class(struct ctf_field_class *fc, struct resolve_context *ctx)
        case CTF_FIELD_CLASS_TYPE_VARIANT:
                ret = resolve_sequence_or_variant_field_class(fc, ctx);
                if (ret) {
-                       BT_COMP_LOGE("Cannot resolve sequence field class's length or variant field class's tag: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot resolve sequence field class's length or variant field class's tag: "
                                "ret=%d, fc-addr=%p", ret, fc);
                        goto end;
                }
@@ -1111,7 +1099,7 @@ int resolve_field_class(struct ctf_field_class *fc, struct resolve_context *ctx)
 
                ret = field_class_stack_push(ctx->field_class_stack, fc, ctx);
                if (ret) {
-                       BT_COMP_LOGE("Cannot push field class on context's stack: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot push field class on context's stack: "
                                "fc-addr=%p", fc);
                        goto end;
                }
@@ -1186,7 +1174,7 @@ int resolve_event_class_field_classes(struct resolve_context *ctx,
        ctx->scopes.event_spec_context = ec->spec_context_fc;
        ret = resolve_root_class(CTF_SCOPE_EVENT_COMMON_CONTEXT, ctx);
        if (ret) {
-               BT_COMP_LOGE("Cannot resolve event specific context field class: "
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot resolve event specific context field class: "
                        "ret=%d", ret);
                goto end;
        }
@@ -1194,7 +1182,7 @@ int resolve_event_class_field_classes(struct resolve_context *ctx,
        ctx->scopes.event_payload = ec->payload_fc;
        ret = resolve_root_class(CTF_SCOPE_EVENT_PAYLOAD, ctx);
        if (ret) {
-               BT_COMP_LOGE("Cannot resolve event payload field class: "
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot resolve event payload field class: "
                        "ret=%d", ret);
                goto end;
        }
@@ -1222,7 +1210,7 @@ int resolve_stream_class_field_classes(struct resolve_context *ctx,
                ctx->scopes.packet_context = sc->packet_context_fc;
                ret = resolve_root_class(CTF_SCOPE_PACKET_CONTEXT, ctx);
                if (ret) {
-                       BT_COMP_LOGE("Cannot resolve packet context field class: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot resolve packet context field class: "
                                "ret=%d", ret);
                        goto end;
                }
@@ -1230,15 +1218,15 @@ int resolve_stream_class_field_classes(struct resolve_context *ctx,
                ctx->scopes.event_header = sc->event_header_fc;
                ret = resolve_root_class(CTF_SCOPE_EVENT_HEADER, ctx);
                if (ret) {
-                       BT_COMP_LOGE("Cannot resolve event header field class: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot resolve event header field class: "
                                "ret=%d", ret);
                        goto end;
                }
 
                ctx->scopes.event_common_context = sc->event_common_context_fc;
-               ret = resolve_root_class(CTF_SCOPE_EVENT_SPECIFIC_CONTEXT, ctx);
+               ret = resolve_root_class(CTF_SCOPE_EVENT_COMMON_CONTEXT, ctx);
                if (ret) {
-                       BT_COMP_LOGE("Cannot resolve event common context field class: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot resolve event common context field class: "
                                "ret=%d", ret);
                        goto end;
                }
@@ -1253,7 +1241,7 @@ int resolve_stream_class_field_classes(struct resolve_context *ctx,
 
                ret = resolve_event_class_field_classes(ctx, ec);
                if (ret) {
-                       BT_COMP_LOGE("Cannot resolve event class's field classes: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot resolve event class's field classes: "
                                "ec-id=%" PRIu64 ", ec-name=\"%s\"",
                                ec->id, ec->name->str);
                        goto end;
@@ -1277,6 +1265,7 @@ int ctf_trace_class_resolve_field_classes(struct ctf_trace_class *tc,
        struct resolve_context local_ctx = {
                .log_level = log_cfg->log_level,
                .self_comp = log_cfg->self_comp,
+               .self_comp_class = log_cfg->self_comp_class,
                .tc = tc,
                .sc = NULL,
                .ec = NULL,
@@ -1296,7 +1285,7 @@ int ctf_trace_class_resolve_field_classes(struct ctf_trace_class *tc,
        /* Initialize class stack */
        ctx->field_class_stack = field_class_stack_create();
        if (!ctx->field_class_stack) {
-               BT_COMP_LOGE_STR("Cannot create field class stack.");
+               _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot create field class stack.");
                ret = -1;
                goto end;
        }
@@ -1305,7 +1294,7 @@ int ctf_trace_class_resolve_field_classes(struct ctf_trace_class *tc,
                ctx->scopes.packet_header = tc->packet_header_fc;
                ret = resolve_root_class(CTF_SCOPE_PACKET_HEADER, ctx);
                if (ret) {
-                       BT_COMP_LOGE("Cannot resolve packet header field class: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot resolve packet header field class: "
                                "ret=%d", ret);
                        goto end;
                }
@@ -1318,7 +1307,7 @@ int ctf_trace_class_resolve_field_classes(struct ctf_trace_class *tc,
 
                ret = resolve_stream_class_field_classes(ctx, sc);
                if (ret) {
-                       BT_COMP_LOGE("Cannot resolve stream class's field classes: "
+                       _BT_COMP_OR_COMP_CLASS_LOGE_APPEND_CAUSE("Cannot resolve stream class's field classes: "
                                "sc-id=%" PRIu64, sc->id);
                        goto end;
                }
This page took 0.033094 seconds and 4 git commands to generate.