#include <babeltrace/ctf/events-internal.h>
#include <babeltrace/ctf/iterator.h>
#include <babeltrace/ctf-text/types.h>
#include <babeltrace/ctf/events-internal.h>
#include <babeltrace/ctf/iterator.h>
#include <babeltrace/ctf-text/types.h>
{ "clock-gmt", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_GMT, NULL, NULL },
{ "clock-force-correlate", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_FORCE_CORRELATE, NULL, NULL },
{ "stream-intersection", 0, POPT_ARG_NONE, NULL, OPT_STREAM_INTERSECTION, NULL, NULL },
{ "clock-gmt", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_GMT, NULL, NULL },
{ "clock-force-correlate", 0, POPT_ARG_NONE, NULL, OPT_CLOCK_FORCE_CORRELATE, NULL, NULL },
{ "stream-intersection", 0, POPT_ARG_NONE, NULL, OPT_STREAM_INTERSECTION, NULL, NULL },
{ NULL, 0, 0, NULL, 0, NULL, NULL },
};
{ NULL, 0, 0, NULL, 0, NULL, NULL },
};
fprintf(fp, " --clock-force-correlate Assume that clocks are inherently correlated\n");
fprintf(fp, " across traces.\n");
fprintf(fp, " --stream-intersection Only print events when all streams are active.\n");
fprintf(fp, " --clock-force-correlate Assume that clocks are inherently correlated\n");
fprintf(fp, " across traces.\n");
fprintf(fp, " --stream-intersection Only print events when all streams are active.\n");
- struct bt_iter_pos *inter_begin_pos,
- struct bt_iter_pos *inter_end_pos)
+ struct bt_iter_pos **inter_begin_pos,
+ struct bt_iter_pos **inter_end_pos)
- inter_begin_pos = bt_iter_create_time_pos(NULL, begin);
- if (!inter_begin_pos) {
+ *inter_begin_pos = bt_iter_create_time_pos(NULL, begin);
+ if (!(*inter_begin_pos)) {
- return bt_ctf_iter_create(ctx, inter_begin_pos,
- inter_end_pos);
+ /*
+ * bt_ctf_iter does not take ownership of begin and end positions,
+ * so we return them to the caller who must still assume their ownership
+ * until the iterator is destroyed.
+ */
+ return bt_ctf_iter_create(ctx, *inter_begin_pos,
+ *inter_end_pos);
- begin_pos.type = BT_SEEK_BEGIN;
- iter = bt_ctf_iter_create(ctx, &begin_pos, NULL);
+ begin_pos = bt_iter_create_time_pos(NULL, 0);
+ begin_pos->type = BT_SEEK_BEGIN;
+ iter = bt_ctf_iter_create(ctx, begin_pos, NULL);