#include <limits.h>
#include <stdlib.h>
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/stream-class.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/stream-class.h>
#include <babeltrace2/types.h>
#include "common/macros.h"
goto end;
}
- BT_LOGV("Pushing field type on context's stack: "
+ BT_LOGT("Pushing field type on context's stack: "
"ft-addr=%p, stack-size-before=%u", type, stack->len);
frame->type = bt_ctf_object_get_ref(type);
g_ptr_array_add(stack, frame);
* Checks whether or not `stack` is empty.
*/
static
-bt_bool type_stack_empty(type_stack *stack)
+bt_ctf_bool type_stack_empty(type_stack *stack)
{
return stack->len == 0;
}
* This will call the frame's destructor and free it, as
* well as put its contained field type.
*/
- BT_LOGV("Popping context's stack: stack-size-before=%u",
+ BT_LOGT("Popping context's stack: stack-size-before=%u",
stack->len);
g_ptr_array_set_size(stack, stack->len - 1);
}
if (strncmp(pathstr, absolute_path_prefixes[scope],
strlen(absolute_path_prefixes[scope]))) {
/* Prefix does not match: try the next one */
- BT_LOGV("Prefix does not match: trying the next one: "
+ BT_LOGT("Prefix does not match: trying the next one: "
"path=\"%s\", path-prefix=\"%s\", scope=%s",
pathstr, absolute_path_prefixes[scope],
bt_ctf_scope_string(scope));
/* Found it! */
ret = scope;
- BT_LOGV("Found root scope from absolute path: "
+ BT_LOGT("Found root scope from absolute path: "
"path=\"%s\", scope=%s", pathstr,
bt_ctf_scope_string(scope));
goto end;
{
int ret = 0;
GList *cur_ptoken = ptokens;
- bt_bool first_level_done = BT_FALSE;
+ bt_ctf_bool first_level_done = BT_CTF_FALSE;
/* Get our own reference */
bt_ctf_object_get_ref(type);
enum bt_ctf_field_type_id type_id =
bt_ctf_field_type_common_get_type_id(type);
- BT_LOGV("Current path token: token=\"%s\"", field_name);
+ BT_LOGT("Current path token: token=\"%s\"", field_name);
/* Find to which index corresponds the current path token */
if (type_id == BT_CTF_FIELD_TYPE_ID_ARRAY ||
/* Next path token */
cur_ptoken = g_list_next(cur_ptoken);
- first_level_done = BT_TRUE;
+ first_level_done = BT_CTF_TRUE;
}
/* Create new field path entry */
int cur_index = type_stack_at(ctx->type_stack,
parent_pos_in_stack)->index;
- BT_LOGV("Locating target field type from current parent field type: "
+ BT_LOGT("Locating target field type from current parent field type: "
"parent-pos=%d, parent-ft-addr=%p, cur-index=%d",
parent_pos_in_stack, parent_type, cur_index);
parent_type, cur_index);
if (ret) {
/* Not found... yet */
- BT_LOGV_STR("Not found at this point.");
+ BT_LOGT_STR("Not found at this point.");
bt_ctf_field_path_clear(tail_field_path);
} else {
/* Found: stitch tail field path to head field path */
int tail_field_path_len =
tail_field_path->indexes->len;
- while (BT_TRUE) {
+ while (BT_CTF_TRUE) {
struct bt_ctf_field_type_common *cur_type =
type_stack_at(ctx->type_stack, i)->type;
int index = type_stack_at(
struct bt_ctf_field_type_common *root_type;
bt_ctf_field_path_clear(field_path);
- BT_LOGV("Looking into potential root scope: scope=%s",
+ BT_LOGT("Looking into potential root scope: scope=%s",
bt_ctf_scope_string(field_path->root));
root_type = get_type_from_ctx(ctx, field_path->root);
if (!root_type) {
root_type, INT_MAX);
if (ret) {
/* Not found yet */
- BT_LOGV_STR("Not found in this scope.");
+ BT_LOGT_STR("Not found in this scope.");
field_path->root--;
continue;
}
/* Found */
- BT_LOGV_STR("Found in this scope.");
+ BT_LOGT_STR("Found in this scope.");
break;
}
}
if (root_scope == BT_CTF_SCOPE_UNKNOWN) {
/* Relative path: start with current root scope */
field_path->root = ctx->root_scope;
- BT_LOGV("Detected relative path: starting with current root scope: "
+ BT_LOGT("Detected relative path: starting with current root scope: "
"scope=%s", bt_ctf_scope_string(field_path->root));
ret = relative_ptokens_to_field_path(ptokens, field_path, ctx);
if (ret) {
} else {
/* Absolute path: use found root scope */
field_path->root = root_scope;
- BT_LOGV("Detected absolute path: using root scope: "
+ BT_LOGT("Detected absolute path: using root scope: "
"scope=%s", bt_ctf_scope_string(field_path->root));
ret = absolute_ptokens_to_field_path(ptokens, field_path, ctx);
if (ret) {
const char *field_path_pretty_str =
field_path_pretty ? field_path_pretty->str : NULL;
- BT_LOGV("Found field path: path=\"%s\", field-path=\"%s\"",
+ BT_LOGT("Found field path: path=\"%s\", field-path=\"%s\"",
pathstr, field_path_pretty_str);
if (field_path_pretty) {
int lca_index = 0;
int field_path1_len, field_path2_len;
- if (BT_LOG_ON_VERBOSE) {
+ if (BT_LOG_ON_TRACE) {
GString *field_path1_pretty =
bt_ctf_field_path_string(field_path1);
GString *field_path2_pretty =
const char *field_path2_pretty_str =
field_path2_pretty ? field_path2_pretty->str : NULL;
- BT_LOGV("Finding lowest common ancestor (LCA) between two field paths: "
+ BT_LOGT("Finding lowest common ancestor (LCA) between two field paths: "
"field-path-1=\"%s\", field-path-2=\"%s\"",
field_path1_pretty_str, field_path2_pretty_str);
field_path1_len = field_path1->indexes->len;
field_path2_len = field_path2->indexes->len;
- while (BT_TRUE) {
+ while (BT_CTF_TRUE) {
int target_index, ctx_index;
if (lca_index == field_path2_len ||
lca_index++;
}
- BT_LOGV("Found LCA: lca-index=%d", lca_index);
+ BT_LOGT("Found LCA: lca-index=%d", lca_index);
return lca_index;
}
f_index;
}
- BT_LOGV("Resolving field type's child field type: "
+ BT_LOGT("Resolving field type's child field type: "
"parent-ft-addr=%p, child-ft-addr=%p, "
"index=%" PRId64 ", count=%" PRId64,
type, child_type, f_index, field_count);
.root_scope = BT_CTF_SCOPE_UNKNOWN,
};
- BT_LOGV("Resolving field types: "
+ BT_LOGT("Resolving field types: "
"packet-header-ft-addr=%p, "
"packet-context-ft-addr=%p, "
"event-header-ft-addr=%p, "
}
}
- BT_LOGV_STR("Resolved field types.");
+ BT_LOGT_STR("Resolved field types.");
end:
type_stack_destroy(ctx.type_stack);