struct ctf_node, siblings);
type_declaration = ctf_type_declarator_visit(fd, depth,
target->u.typealias_target.type_specifier_list,
struct ctf_node, siblings);
type_declaration = ctf_type_declarator_visit(fd, depth,
target->u.typealias_target.type_specifier_list,
first = _cds_list_first_entry(&type_specifier_list->u.type_specifier_list.head, struct ctf_node, siblings);
assert(first->type == NODE_TYPE_SPECIFIER);
first = _cds_list_first_entry(&type_specifier_list->u.type_specifier_list.head, struct ctf_node, siblings);
assert(first->type == NODE_TYPE_SPECIFIER);
- if (CTF_EVENT_FIELD_IS_SET(event, name))
+ if (CTF_EVENT_FIELD_IS_SET(event, name)) {
+ fprintf(fd, "[error] %s: name already declared in event declaration\n", __func__);
right = concatenate_unary_strings(&node->u.ctf_expression.right);
if (!right) {
fprintf(fd, "[error] %s: unexpected unary expression for event name\n", __func__);
right = concatenate_unary_strings(&node->u.ctf_expression.right);
if (!right) {
fprintf(fd, "[error] %s: unexpected unary expression for event name\n", __func__);
g_free(right);
CTF_EVENT_SET_FIELD(event, name);
} else if (!strcmp(left, "id")) {
g_free(right);
CTF_EVENT_SET_FIELD(event, name);
} else if (!strcmp(left, "id")) {
- if (CTF_EVENT_FIELD_IS_SET(event, id))
+ if (CTF_EVENT_FIELD_IS_SET(event, id)) {
+ fprintf(fd, "[error] %s: id already declared in event declaration\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &event->id);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for event id\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &event->id);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for event id\n", __func__);
}
CTF_EVENT_SET_FIELD(event, id);
} else if (!strcmp(left, "stream_id")) {
}
CTF_EVENT_SET_FIELD(event, id);
} else if (!strcmp(left, "stream_id")) {
- if (CTF_EVENT_FIELD_IS_SET(event, stream_id))
+ if (CTF_EVENT_FIELD_IS_SET(event, stream_id)) {
+ fprintf(fd, "[error] %s: stream_id already declared in event declaration\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &event->stream_id);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for event stream_id\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &event->stream_id);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for event stream_id\n", __func__);
} else if (!strcmp(left, "context")) {
struct declaration *declaration;
} else if (!strcmp(left, "context")) {
struct declaration *declaration;
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
} else if (!strcmp(left, "fields")) {
struct declaration *declaration;
} else if (!strcmp(left, "fields")) {
struct declaration *declaration;
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
- if (!strcmp(left, "stream_id")) {
- if (CTF_STREAM_FIELD_IS_SET(stream, stream_id))
+ if (!strcmp(left, "id")) {
+ if (CTF_STREAM_FIELD_IS_SET(stream, stream_id)) {
+ fprintf(fd, "[error] %s: id already declared in stream declaration\n", __func__);
return -EINVAL;
}
CTF_STREAM_SET_FIELD(stream, stream_id);
} else if (!strcmp(left, "event.header")) {
struct declaration *declaration;
return -EINVAL;
}
CTF_STREAM_SET_FIELD(stream, stream_id);
} else if (!strcmp(left, "event.header")) {
struct declaration *declaration;
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
} else if (!strcmp(left, "event.context")) {
struct declaration *declaration;
} else if (!strcmp(left, "event.context")) {
struct declaration *declaration;
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
} else if (!strcmp(left, "packet.context")) {
struct declaration *declaration;
} else if (!strcmp(left, "packet.context")) {
struct declaration *declaration;
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
declaration = ctf_type_specifier_list_visit(fd, depth,
_cds_list_first_entry(&node->u.ctf_expression.right,
struct ctf_node, siblings),
left = concatenate_unary_strings(&node->u.ctf_expression.left);
if (!strcmp(left, "major")) {
left = concatenate_unary_strings(&node->u.ctf_expression.left);
if (!strcmp(left, "major")) {
- if (CTF_TRACE_FIELD_IS_SET(trace, major))
+ if (CTF_TRACE_FIELD_IS_SET(trace, major)) {
+ fprintf(fd, "[error] %s: major already declared in trace declaration\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &trace->major);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for trace major number\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &trace->major);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for trace major number\n", __func__);
}
CTF_TRACE_SET_FIELD(trace, major);
} else if (!strcmp(left, "minor")) {
}
CTF_TRACE_SET_FIELD(trace, major);
} else if (!strcmp(left, "minor")) {
- if (CTF_TRACE_FIELD_IS_SET(trace, minor))
+ if (CTF_TRACE_FIELD_IS_SET(trace, minor)) {
+ fprintf(fd, "[error] %s: minor already declared in trace declaration\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &trace->minor);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for trace minor number\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &trace->minor);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for trace minor number\n", __func__);
}
CTF_TRACE_SET_FIELD(trace, minor);
} else if (!strcmp(left, "word_size")) {
}
CTF_TRACE_SET_FIELD(trace, minor);
} else if (!strcmp(left, "word_size")) {
- if (CTF_TRACE_FIELD_IS_SET(trace, word_size))
+ if (CTF_TRACE_FIELD_IS_SET(trace, word_size)) {
+ fprintf(fd, "[error] %s: word_size already declared in trace declaration\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &trace->word_size);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for trace word_size\n", __func__);
ret = get_unary_unsigned(&node->u.ctf_expression.right, &trace->word_size);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for trace word_size\n", __func__);
}
CTF_TRACE_SET_FIELD(trace, word_size);
} else if (!strcmp(left, "uuid")) {
}
CTF_TRACE_SET_FIELD(trace, word_size);
} else if (!strcmp(left, "uuid")) {
- if (CTF_TRACE_FIELD_IS_SET(trace, uuid))
+ if (CTF_TRACE_FIELD_IS_SET(trace, uuid)) {
+ fprintf(fd, "[error] %s: uuid already declared in trace declaration\n", __func__);
ret = get_unary_uuid(&node->u.ctf_expression.right, &trace->uuid);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for trace uuid\n", __func__);
ret = get_unary_uuid(&node->u.ctf_expression.right, &trace->uuid);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for trace uuid\n", __func__);
cds_list_for_each_entry(iter, &node->u.root.declaration_list,
siblings) {
ret = ctf_root_declaration_visit(fd, depth + 1, iter, trace);
cds_list_for_each_entry(iter, &node->u.root.declaration_list,
siblings) {
ret = ctf_root_declaration_visit(fd, depth + 1, iter, trace);
}
cds_list_for_each_entry(iter, &node->u.root.trace, siblings) {
ret = ctf_trace_visit(fd, depth + 1, iter, trace);
}
cds_list_for_each_entry(iter, &node->u.root.trace, siblings) {
ret = ctf_trace_visit(fd, depth + 1, iter, trace);
}
cds_list_for_each_entry(iter, &node->u.root.stream, siblings) {
ret = ctf_stream_visit(fd, depth + 1, iter,
trace->root_declaration_scope, trace);
}
cds_list_for_each_entry(iter, &node->u.root.stream, siblings) {
ret = ctf_stream_visit(fd, depth + 1, iter,
trace->root_declaration_scope, trace);
}
cds_list_for_each_entry(iter, &node->u.root.event, siblings) {
ret = ctf_event_visit(fd, depth + 1, iter,
trace->root_declaration_scope, trace);
}
cds_list_for_each_entry(iter, &node->u.root.event, siblings) {
ret = ctf_event_visit(fd, depth + 1, iter,
trace->root_declaration_scope, trace);