#define BT_COMP_LOG_SELF_COMP (ctx->self_comp)
#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"
static
struct field_class_stack_frame *field_class_stack_peek(field_class_stack *stack)
{
- struct field_class_stack_frame *entry = NULL;
+ BT_ASSERT(stack);
+ BT_ASSERT(!field_class_stack_empty(stack));
- if (!stack || field_class_stack_empty(stack)) {
- goto end;
- }
-
- entry = g_ptr_array_index(stack, stack->len - 1);
-end:
- return entry;
+ return g_ptr_array_index(stack, stack->len - 1);
}
/*
struct field_class_stack_frame *field_class_stack_at(field_class_stack *stack,
size_t index)
{
- struct field_class_stack_frame *entry = NULL;
+ BT_ASSERT(stack);
+ BT_ASSERT(index < stack->len);
- if (!stack || index >= stack->len) {
- goto end;
- }
-
- entry = g_ptr_array_index(stack, index);
-
-end:
- return entry;
+ return g_ptr_array_index(stack, index);
}
/*
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.
/*
* 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.
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) {
/*
/* 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: "