Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
int ret = 0;
struct ctf_node *iter;
int ret = 0;
struct ctf_node *iter;
if (trace->declaration_scope)
return -EEXIST;
trace->declaration_scope = new_declaration_scope(trace->root_declaration_scope);
if (trace->declaration_scope)
return -EEXIST;
trace->declaration_scope = new_declaration_scope(trace->root_declaration_scope);
g_ptr_array_free(trace->streams, TRUE);
free_declaration_scope(trace->declaration_scope);
trace->declaration_scope = NULL;
g_ptr_array_free(trace->streams, TRUE);
free_declaration_scope(trace->declaration_scope);
trace->declaration_scope = NULL;
- /* byte order changed while creating types, retry. */
- if (ret == -EINTR) {
- goto restart;
- }
struct ctf_node *iter;
printf_verbose("CTF visitor: metadata construction... ");
struct ctf_node *iter;
printf_verbose("CTF visitor: metadata construction... ");
- trace->root_declaration_scope = new_declaration_scope(NULL);
trace->byte_order = byte_order;
trace->byte_order = byte_order;
+retry:
+ trace->root_declaration_scope = new_declaration_scope(NULL);
+
switch (node->type) {
case NODE_ROOT:
cds_list_for_each_entry(iter, &node->u.root.declaration_list,
switch (node->type) {
case NODE_ROOT:
cds_list_for_each_entry(iter, &node->u.root.declaration_list,
}
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);
+ if (ret == -EINTR) {
+ free_declaration_scope(trace->root_declaration_scope);
+ /*
+ * Need to restart creation of type
+ * definitions, aliases and
+ * trace header declarations.
+ */
+ goto retry;
+ }
if (ret) {
fprintf(fd, "[error] %s: trace declaration error\n", __func__);
goto error;
if (ret) {
fprintf(fd, "[error] %s: trace declaration error\n", __func__);
goto error;