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>
This page took 0.025135 seconds and 5 git commands to generate.