#include <babeltrace/assert-pre-internal.h>
#include <babeltrace/assert-internal.h>
-#include <babeltrace/object.h>
-#include <babeltrace/trace-ir/field-classes-internal.h>
+#include <babeltrace/trace-ir/field-class-internal.h>
#include <babeltrace/trace-ir/field-path-internal.h>
-#include <babeltrace/trace-ir/field-path.h>
+#include <babeltrace/trace-ir/field-path-const.h>
#include <babeltrace/trace-ir/resolve-field-path-internal.h>
#include <limits.h>
#include <stdint.h>
struct bt_field_path *field_path = NULL;
int ret;
- ret = find_field_class(ctx->packet_header, BT_SCOPE_PACKET_HEADER,
- fc, &field_path);
- if (ret || field_path) {
- goto end;
- }
-
ret = find_field_class(ctx->packet_context, BT_SCOPE_PACKET_CONTEXT,
fc, &field_path);
if (ret || field_path) {
goto end;
}
- ret = find_field_class(ctx->event_header, BT_SCOPE_EVENT_HEADER,
- fc, &field_path);
- if (ret || field_path) {
- goto end;
- }
-
ret = find_field_class(ctx->event_common_context,
BT_SCOPE_EVENT_COMMON_CONTEXT, fc, &field_path);
if (ret || field_path) {
struct bt_resolve_field_path_context *ctx, enum bt_scope scope)
{
switch (scope) {
- case BT_SCOPE_PACKET_HEADER:
- return ctx->packet_header;
case BT_SCOPE_PACKET_CONTEXT:
return ctx->packet_context;
- case BT_SCOPE_EVENT_HEADER:
- return ctx->event_header;
case BT_SCOPE_EVENT_COMMON_CONTEXT:
return ctx->event_common_context;
case BT_SCOPE_EVENT_SPECIFIC_CONTEXT:
if (!prev_fc) {
/*
* This is correct: the LCA is the root
- * scope field classe, which must be a
- * structure field classe.
+ * scope field class, which must be a
+ * structure field class.
*/
break;
}
tgt_fc, ctx);
if (!src_field_path) {
- BT_ASSERT_PRE_MSG("Cannot find requesting field classe in "
+ BT_ASSERT_PRE_MSG("Cannot find requesting field class in "
"resolving context: %!+F", src_fc);
is_valid = false;
goto end;
}
if (!tgt_field_path) {
- BT_ASSERT_PRE_MSG("Cannot find target field classe in "
+ BT_ASSERT_PRE_MSG("Cannot find target field class in "
"resolving context: %!+F", tgt_fc);
is_valid = false;
goto end;
/* Target must be before source */
if (!target_is_before_source(src_field_path, tgt_field_path)) {
- BT_ASSERT_PRE_MSG("Target field classe is located after "
- "requesting field classe: %![req-fc-]+F, %![tgt-fc-]+F",
+ BT_ASSERT_PRE_MSG("Target field class is located after "
+ "requesting field class: %![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
is_valid = false;
goto end;
*/
if (!target_field_path_in_different_scope_has_struct_fc_only(
src_field_path, tgt_field_path, ctx)) {
- BT_ASSERT_PRE_MSG("Target field classe is located in a "
- "different scope than requesting field classe, "
- "but within an array or a variant field classe: "
+ BT_ASSERT_PRE_MSG("Target field class is located in a "
+ "different scope than requesting field class, "
+ "but within an array or a variant field class: "
"%![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
is_valid = false;
goto end;
}
- /* Same scope: LCA must be a structure field classe */
+ /* Same scope: LCA must be a structure field class */
if (!lca_is_structure_field_class(src_field_path, tgt_field_path, ctx)) {
BT_ASSERT_PRE_MSG("Lowest common ancestor of target and "
- "requesting field classes is not a structure field classe: "
+ "requesting field classes is not a structure field class: "
"%![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
is_valid = false;
if (!lca_to_target_has_struct_fc_only(src_field_path, tgt_field_path,
ctx)) {
BT_ASSERT_PRE_MSG("Path from lowest common ancestor of target "
- "and requesting field classes to target field classe "
- "contains an array or a variant field classe: "
+ "and requesting field classes to target field class "
+ "contains an array or a variant field class: "
"%![req-fc-]+F, %![tgt-fc-]+F", src_fc, tgt_fc);
is_valid = false;
goto end;
struct bt_resolve_field_path_context *ctx)
{
BT_ASSERT_PRE(field_path_is_valid(src_fc, tgt_fc, ctx),
- "Invalid target field classe: %![req-fc-]+F, %![tgt-fc-]+F",
+ "Invalid target field class: %![req-fc-]+F, %![tgt-fc-]+F",
src_fc, tgt_fc);
return find_field_class_in_ctx(tgt_fc, ctx);
}