#include <babeltrace/babeltrace.h>
#include <babeltrace/babeltrace-internal.h>
+#include "../metadata/ctf-meta.h"
+
/**
* @file ctf-notif-iter.h
*
*/
struct bt_stream * (* borrow_stream)(
struct bt_stream_class *stream_class,
- uint64_t stream_id, void *data);
+ int64_t stream_id, void *data);
};
/** CTF notification iterator. */
struct bt_notif_iter;
-// TODO: Replace by the real thing
-enum bt_notif_iter_notif_type {
- BT_NOTIF_ITER_NOTIF_NEW_PACKET,
- BT_NOTIF_ITER_NOTIF_END_OF_PACKET,
- BT_NOTIF_ITER_NOTIF_EVENT,
-};
-
-struct bt_notif_iter_notif {
- enum bt_notif_iter_notif_type type;
-};
-
-struct bt_notif_iter_notif_new_packet {
- struct bt_notif_iter_notif base;
- struct bt_packet *packet;
-};
-
-struct bt_notif_iter_notif_end_of_packet {
- struct bt_notif_iter_notif base;
- struct bt_packet *packet;
-};
-
-struct bt_notif_iter_notif_event {
- struct bt_notif_iter_notif base;
- struct bt_event *event;
-};
-
/**
* Creates a CTF notification iterator.
*
* success, or \c NULL on error
*/
BT_HIDDEN
-struct bt_notif_iter *bt_notif_iter_create(struct bt_trace *trace,
+struct bt_notif_iter *bt_notif_iter_create(struct ctf_trace_class *tc,
size_t max_request_sz, struct bt_notif_iter_medium_ops medops,
void *medops_data);
* call this function again, until another status is returned.
*
* @param notif_iter CTF notification iterator
- * @param cc_prio_map Clock class priority map to use when
- * creating an event notification
* @param notification Returned notification if the function's
* return value is #BT_NOTIF_ITER_STATUS_OK
* @returns One of #bt_notif_iter_status values
BT_HIDDEN
enum bt_notif_iter_status bt_notif_iter_get_next_notification(
struct bt_notif_iter *notit,
- struct bt_clock_class_priority_map *cc_prio_map,
- struct bt_graph *graph,
+ struct bt_self_notification_iterator *notif_iter,
struct bt_notification **notification);
/**
struct bt_field **packet_header_field,
struct bt_field **packet_context_field);
+struct bt_notif_iter_packet_properties {
+ uint64_t exp_packet_total_size;
+ uint64_t exp_packet_content_size;
+ uint64_t stream_class_id;
+ int64_t data_stream_id;
+
+ struct {
+ uint64_t discarded_events;
+ uint64_t packets;
+ uint64_t beginning_clock;
+ uint64_t end_clock;
+ } snapshots;
+};
+
+BT_HIDDEN
+enum bt_notif_iter_status bt_notif_iter_get_packet_properties(
+ struct bt_notif_iter *notit,
+ struct bt_notif_iter_packet_properties *props);
+
BT_HIDDEN
void bt_notif_iter_set_medops_data(struct bt_notif_iter *notit,
void *medops_data);
BT_HIDDEN
void bt_notif_iter_reset(struct bt_notif_iter *notit);
+/*
+ * Notify the iterator that the trace class changed somehow (new
+ * stream/event classes).
+ */
+BT_HIDDEN
+void bt_notif_trace_class_changed(struct bt_notif_iter *notit);
+
static inline
const char *bt_notif_iter_medium_status_string(
enum bt_notif_iter_medium_status status)