+int ctf_convert_index_timestamp(struct trace_descriptor *tdp)
+{
+ int i, j, k;
+ struct ctf_trace *td = container_of(tdp, struct ctf_trace, parent);
+
+ /* for each stream_class */
+ for (i = 0; i < td->streams->len; i++) {
+ struct ctf_stream_declaration *stream_class;
+
+ stream_class = g_ptr_array_index(td->streams, i);
+ if (!stream_class)
+ continue;
+ /* for each file_stream */
+ for (j = 0; j < stream_class->streams->len; j++) {
+ struct ctf_stream_definition *stream;
+ struct ctf_stream_pos *stream_pos;
+ struct ctf_file_stream *cfs;
+
+ stream = g_ptr_array_index(stream_class->streams, j);
+ if (!stream)
+ continue;
+ cfs = container_of(stream, struct ctf_file_stream,
+ parent);
+ stream_pos = &cfs->pos;
+ if (!stream_pos->packet_cycles_index)
+ continue;
+
+ for (k = 0; k < stream_pos->packet_cycles_index->len; k++) {
+ struct packet_index *index;
+ struct packet_index new_index;
+
+ index = &g_array_index(stream_pos->packet_cycles_index,
+ struct packet_index, k);
+ memcpy(&new_index, index,
+ sizeof(struct packet_index));
+ new_index.timestamp_begin =
+ ctf_get_real_timestamp(stream,
+ index->timestamp_begin);
+ new_index.timestamp_end =
+ ctf_get_real_timestamp(stream,
+ index->timestamp_end);
+ g_array_append_val(stream_pos->packet_real_index,
+ new_index);
+ }
+ }
+ }
+ return 0;
+}
+
+static
+int ctf_close_file_stream(struct ctf_file_stream *file_stream)