#include <babeltrace/list.h>
#include <babeltrace/types.h>
#include <babeltrace/ctf/metadata.h>
-#include <babeltrace/uuid.h>
+#include <babeltrace/compat/uuid.h>
#include <babeltrace/endian.h>
#include <babeltrace/ctf/events-internal.h>
#include "ctf-scanner.h"
static
struct ctf_clock *trace_clock_lookup(struct ctf_trace *trace, GQuark clock_name)
{
- return g_hash_table_lookup(trace->clocks, (gpointer) (unsigned long) clock_name);
+ return g_hash_table_lookup(trace->parent.clocks, (gpointer) (unsigned long) clock_name);
}
static
bt_list_for_each_entry(iter, type_declarators, siblings) {
struct bt_declaration *type_declaration;
int ret;
-
+
type_declaration = ctf_type_declarator_visit(fd, depth,
type_specifier_list,
&identifier, iter,
if (name) {
if (bt_lookup_struct_declaration(g_quark_from_string(name),
declaration_scope)) {
-
fprintf(fd, "[error] %s: struct %s already declared in scope\n", __func__, name);
return NULL;
}
ret = get_unary_unsigned(min_align, &min_align_value);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for structure \"align\" attribute\n", __func__);
- ret = -EINVAL;
goto error;
}
}
if (name) {
if (bt_lookup_variant_declaration(g_quark_from_string(name),
declaration_scope)) {
-
fprintf(fd, "[error] %s: variant %s already declared in scope\n", __func__, name);
return NULL;
}
if (name) {
if (bt_lookup_enum_declaration(g_quark_from_string(name),
declaration_scope)) {
-
fprintf(fd, "[error] %s: enum %s already declared in scope\n", __func__, name);
return NULL;
}
fprintf(fd, "[error] %s: unexpected unary expression type\n",
__func__);
return -EINVAL;
- }
+ }
}
struct ctf_trace *trace)
{
struct ctf_node *expression;
- uint64_t alignment = 1, exp_dig = 0, mant_dig = 0,
- byte_order = trace->byte_order;
- int has_alignment = 0, has_exp_dig = 0, has_mant_dig = 0;
+ uint64_t alignment = 1, exp_dig = 0, mant_dig = 0;
+ int byte_order = trace->byte_order, has_alignment = 0,
+ has_exp_dig = 0, has_mant_dig = 0;
struct declaration_float *float_declaration;
bt_list_for_each_entry(expression, expressions, siblings) {
fprintf(fd, "[error] %s: missing name field in clock declaration\n", __func__);
goto error;
}
- if (g_hash_table_size(trace->clocks) > 0) {
+ if (g_hash_table_size(trace->parent.clocks) > 0) {
fprintf(fd, "[error] Only CTF traces with a single clock description are supported by this babeltrace version.\n");
ret = -EINVAL;
goto error;
}
- trace->single_clock = clock;
- g_hash_table_insert(trace->clocks, (gpointer) (unsigned long) clock->name, clock);
+ trace->parent.single_clock = clock;
+ g_hash_table_insert(trace->parent.clocks, (gpointer) (unsigned long) clock->name, clock);
return 0;
error:
clock->absolute = 0; /* Not an absolute reference across traces */
}
- trace->single_clock = clock;
- g_hash_table_insert(trace->clocks, (gpointer) (unsigned long) clock->name, clock);
+ trace->parent.single_clock = clock;
+ g_hash_table_insert(trace->parent.clocks, (gpointer) (unsigned long) clock->name, clock);
}
static
printf_verbose("CTF visitor: metadata construction...\n");
trace->byte_order = byte_order;
- trace->clocks = g_hash_table_new_full(g_direct_hash, g_direct_equal,
- NULL, clock_free);
+ trace->parent.clocks = g_hash_table_new_full(g_direct_hash,
+ g_direct_equal, NULL, clock_free);
trace->callsites = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, callsite_free);
error:
bt_free_declaration_scope(trace->root_declaration_scope);
g_hash_table_destroy(trace->callsites);
- g_hash_table_destroy(trace->clocks);
+ g_hash_table_destroy(trace->parent.clocks);
return ret;
}
bt_free_declaration_scope(trace->declaration_scope);
g_hash_table_destroy(trace->callsites);
- g_hash_table_destroy(trace->clocks);
+ g_hash_table_destroy(trace->parent.clocks);
metadata_stream = container_of(trace->metadata, struct ctf_file_stream, parent);
g_free(metadata_stream);