API : iterator get and set position
authorJulien Desfossez <julien.desfossez@efficios.com>
Fri, 10 Feb 2012 02:32:52 +0000 (21:32 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 10 Feb 2012 02:32:52 +0000 (21:32 -0500)
commit90fcbacc6eb672f0d5e0c9d6722d397ac9f1a63e
treea4b4032f38fa48aed850fe46774e0fb5e442b7a2
parentd40a9bb4c13a7ab2be5482d9632346f426229149
API : iterator get and set position

This patch implements the save and restore position on a iterator.

Passed successfully these tests :
- test 1:
save the position
read n events (tested with multiple values of n)
restore
compare the outputs

- test 2:
in loop until the end of the trace :
        save the position
        read 5 events
        restore the position
        read 5 events
compare each block of 5 events

- test 3:
save the position before printing the first event
parse the trace entirely
restore to the beginning
parse the trace entirely
compare the 2 outputs

- test 4:
seek in the future (manually tweaked the values to restore to)
compare with a normal trace starting from the restore point

[ edit: use g_new/g_new0/g_free instead of malloc/calloc/free.
  Use g_new0 anytime a structure is not explicitly initialized by
  a helper, so if it grows in the future with new fields, they will be
  zeroed. ]

Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf-text/ctf-text.c
formats/ctf/ctf.c
include/babeltrace/ctf-ir/metadata.h
include/babeltrace/ctf/types.h
include/babeltrace/iterator.h
lib/iterator.c
This page took 0.02501 seconds and 4 git commands to generate.