ctf: bt_ctf_notif_iter_get_next_notification(): require CC prio. map
[babeltrace.git] / plugins / ctf / common / notif-iter / notif-iter.c
index f6fe230c6b84a9b3090589d3fa74a0320532f571..bb629b18940bcdc87997ad4af8269b9d16b30db8 100644 (file)
@@ -162,9 +162,6 @@ struct bt_ctf_notif_iter {
                struct bt_ctf_event_class *event_class;
        } meta;
 
-       /* Clock class priority map (owned by this) */
-       struct bt_clock_class_priority_map *cc_prio_map;
-
        /* Current packet (NULL if not created yet) */
        struct bt_ctf_packet *packet;
 
@@ -2193,6 +2190,7 @@ void notify_end_of_packet(struct bt_ctf_notif_iter *notit,
 
 static
 void notify_event(struct bt_ctf_notif_iter *notit,
+               struct bt_clock_class_priority_map *cc_prio_map,
                struct bt_notification **notification)
 {
        struct bt_ctf_event *event;
@@ -2204,7 +2202,7 @@ void notify_event(struct bt_ctf_notif_iter *notit,
                goto end;
        }
 
-       ret = bt_notification_event_create(event, notit->cc_prio_map);
+       ret = bt_notification_event_create(event, cc_prio_map);
        if (!ret) {
                goto end;
        }
@@ -2312,7 +2310,6 @@ end:
 
 BT_HIDDEN
 struct bt_ctf_notif_iter *bt_ctf_notif_iter_create(struct bt_ctf_trace *trace,
-               struct bt_clock_class_priority_map *cc_prio_map,
                size_t max_request_sz,
                struct bt_ctf_notif_iter_medium_ops medops,
                void *data, FILE *err_stream)
@@ -2337,7 +2334,6 @@ struct bt_ctf_notif_iter *bt_ctf_notif_iter_create(struct bt_ctf_trace *trace,
        };
 
        assert(trace);
-       assert(cc_prio_map);
        assert(medops.request_bytes);
        assert(medops.get_stream);
        notit = g_new0(struct bt_ctf_notif_iter, 1);
@@ -2356,7 +2352,6 @@ struct bt_ctf_notif_iter *bt_ctf_notif_iter_create(struct bt_ctf_trace *trace,
                PERR("Failed to initialize stream clock states\n");
                goto error;
        }
-       notit->cc_prio_map = bt_get(cc_prio_map);
        notit->meta.trace = bt_get(trace);
        notit->medium.medops = medops;
        notit->medium.max_request_sz = max_request_sz;
@@ -2400,7 +2395,6 @@ error:
 
 void bt_ctf_notif_iter_destroy(struct bt_ctf_notif_iter *notit)
 {
-       BT_PUT(notit->cc_prio_map);
        BT_PUT(notit->meta.trace);
        BT_PUT(notit->meta.stream_class);
        BT_PUT(notit->meta.event_class);
@@ -2432,6 +2426,7 @@ void bt_ctf_notif_iter_destroy(struct bt_ctf_notif_iter *notit)
 
 enum bt_ctf_notif_iter_status bt_ctf_notif_iter_get_next_notification(
                struct bt_ctf_notif_iter *notit,
+               struct bt_clock_class_priority_map *cc_prio_map,
                struct bt_notification **notification)
 {
        enum bt_ctf_notif_iter_status status = BT_CTF_NOTIF_ITER_STATUS_OK;
@@ -2461,7 +2456,7 @@ enum bt_ctf_notif_iter_status bt_ctf_notif_iter_get_next_notification(
                        goto end;
                case STATE_EMIT_NOTIF_EVENT:
                        PDBG("Emitting event notification\n");
-                       notify_event(notit, notification);
+                       notify_event(notit, cc_prio_map, notification);
                        if (!*notification) {
                                status = BT_CTF_NOTIF_ITER_STATUS_ERROR;
                        }
This page took 0.025555 seconds and 4 git commands to generate.