/*
* For now, only a single clock per trace is supported.
*/
- file_stream->parent.current_clock = td->single_clock;
+ file_stream->parent.current_clock = td->parent.single_clock;
ret = create_stream_packet_index(td, file_stream);
if (ret)
goto error_index;
/*
* For now, only a single clock per trace is supported.
*/
- file_stream->parent.current_clock = td->single_clock;
+ file_stream->parent.current_clock = td->parent.single_clock;
/* Add stream file to stream class */
g_ptr_array_add(file_stream->parent.stream_class->streams,
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
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);
* convert the index from cycles to real time.
*/
int bt_trace_collection_add(struct trace_collection *tc,
- struct bt_trace_descriptor *td)
+ struct bt_trace_descriptor *trace)
{
- struct ctf_trace *trace;
-
- if (!tc || !td)
+ if (!tc || !trace)
return -EINVAL;
- trace = container_of(td, struct ctf_trace, parent);
-
if (tc->array->len > 1) {
struct clock_match clock_match = {
.clocks = tc->clocks,
}
}
- g_ptr_array_add(tc->array, td);
- trace->parent.collection = tc;
+ g_ptr_array_add(tc->array, trace);
+ trace->collection = tc;
{
struct clock_match clock_match = {