Move trace collection pointer to bt_trace_descriptor
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 23 Apr 2013 13:31:55 +0000 (09:31 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 23 Apr 2013 13:31:55 +0000 (09:31 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c
formats/ctf/events-private.h
include/babeltrace/ctf-ir/metadata.h
include/babeltrace/format-internal.h
lib/trace-collection.c

index ddde54521115c2796bd695e9253b07eb45ce5ac0..6bb31e55f4efb31346fcdc8ee14457565734a619 100644 (file)
@@ -781,7 +781,7 @@ void ctf_packet_seek(struct bt_stream_pos *stream_pos, size_t index, int whence)
                         * case, the collection is not there, so we
                         * cannot print the timestamps.
                         */
-                       if ((&file_stream->parent)->stream_class->trace->collection) {
+                       if ((&file_stream->parent)->stream_class->trace->parent.collection) {
                                /*
                                 * When a stream reaches the end of the
                                 * file, we need to show the number of
@@ -1472,7 +1472,7 @@ begin:
 
                        field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
                        packet_index.timestamp_begin = bt_get_unsigned_int(field);
-                       if (file_stream->parent.stream_class->trace->collection) {
+                       if (file_stream->parent.stream_class->trace->parent.collection) {
                                packet_index.timestamp_begin =
                                        ctf_get_real_timestamp(
                                                &file_stream->parent,
@@ -1487,7 +1487,7 @@ begin:
 
                        field = bt_struct_definition_get_field_from_index(file_stream->parent.stream_packet_context, len_index);
                        packet_index.timestamp_end = bt_get_unsigned_int(field);
-                       if (file_stream->parent.stream_class->trace->collection) {
+                       if (file_stream->parent.stream_class->trace->parent.collection) {
                                packet_index.timestamp_end =
                                        ctf_get_real_timestamp(
                                                &file_stream->parent,
index 201b2b3692850dd739188a54c148063d3d5a31d2..770012f405ce39703f7672ad46e94de7f5087dd4 100644 (file)
@@ -40,7 +40,7 @@ uint64_t ctf_get_real_timestamp(struct ctf_stream_definition *stream,
 {
        uint64_t ts_nsec;
        struct ctf_trace *trace = stream->stream_class->trace;
-       struct trace_collection *tc = trace->collection;
+       struct trace_collection *tc = trace->parent.collection;
        uint64_t tc_offset;
 
        if (tc->clock_use_offset_avg)
index 4fa5c0bee03548e9f453787edceff9d4bdbb1dc5..bc47f8bfc9618f110f628100777888d253ce193f 100644 (file)
@@ -191,7 +191,6 @@ struct ctf_trace {
        GHashTable *clocks;
        GHashTable *callsites;
        struct ctf_clock *single_clock;         /* currently supports only one clock */
-       struct trace_collection *collection;    /* Container of this trace */
        GPtrArray *event_declarations;          /* Array of all the struct bt_ctf_event_decl */
 
        struct declaration_struct *packet_header_decl;
index 589b68a3b5c2e5978540aa31905263709f5b0cdb..880a336e9c098e6bb26c6bb71810a27c49ce7ef4 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <limits.h>
 #include <babeltrace/context-internal.h>
+#include <babeltrace/babeltrace-internal.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -41,6 +42,7 @@ struct bt_trace_descriptor {
        char path[PATH_MAX];            /* trace path */
        struct bt_context *ctx;
        struct bt_trace_handle *handle;
+       struct trace_collection *collection;    /* Container of this trace */
 };
 
 #ifdef __cplusplus
index c5c875c975d64d4d76bd83822a12034218e0e528..6743ce6ba7467ef8c21daeea02d81b8073e9b632 100644 (file)
@@ -186,7 +186,7 @@ int bt_trace_collection_add(struct trace_collection *tc,
        }
 
        g_ptr_array_add(tc->array, td);
-       trace->collection = tc;
+       trace->parent.collection = tc;
 
        {
                struct clock_match clock_match = {
This page took 0.027598 seconds and 4 git commands to generate.