X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=lib%2Fiterator.c;h=398b097bce00bdb7723bcb2ea75c22d399888620;hp=d595e7617a82b4998d3bf82c6cd14eb098711520;hb=20d0dcf9609dcd28aebe87c167d6600ddbe668d1;hpb=d6425aaf6026d168a695268c4aa7539956c0d0ca diff --git a/lib/iterator.c b/lib/iterator.c index d595e761..398b097b 100644 --- a/lib/iterator.c +++ b/lib/iterator.c @@ -115,9 +115,7 @@ static int seek_file_stream_by_timestamp(struct ctf_file_stream *cfs, index->timestamp_end <= timestamp) continue; - stream_pos->cur_index = i; - stream_pos->move_pos_slow(&stream_pos->parent, - index->offset, SEEK_SET); + stream_pos->packet_seek(&stream_pos->parent, i, SEEK_SET); while (cfs->parent.timestamp < timestamp) { ret = stream_read_event(cfs); if (ret < 0) @@ -191,7 +189,6 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos) i++) { struct stream_saved_pos *saved_pos; struct ctf_stream_pos *stream_pos; - struct packet_index *index; struct ctf_stream *stream; saved_pos = &g_array_index( @@ -199,17 +196,13 @@ int bt_iter_set_pos(struct bt_iter *iter, const struct bt_iter_pos *iter_pos) struct stream_saved_pos, i); stream = &saved_pos->file_stream->parent; stream_pos = &saved_pos->file_stream->pos; - index = &g_array_index(stream_pos->packet_index, - struct packet_index, - saved_pos->cur_index); - stream_pos->cur_index = saved_pos->cur_index; - stream_pos->move_pos_slow(&stream_pos->parent, - index->offset, SEEK_SET); + stream_pos->packet_seek(&stream_pos->parent, + saved_pos->cur_index, SEEK_SET); /* * the timestamp needs to be restored after - * move_pos_slow, because this function resets + * packet_seek, because this function resets * the timestamp to the beginning of the packet */ stream->timestamp = saved_pos->current_timestamp; @@ -387,7 +380,7 @@ static int babeltrace_filestream_seek(struct ctf_file_stream *file_stream, */ break; case BT_SEEK_BEGIN: - file_stream->pos.move_pos_slow(&file_stream->pos.parent, + file_stream->pos.packet_seek(&file_stream->pos.parent, 0, SEEK_SET); ret = stream_read_event(file_stream); break;