Fix: call bt_stream_class_map_clock_class() in bt_event_create()
[babeltrace.git] / lib / ctf-ir / event.c
index fd4563744e534157131df8d2a727a1dfe0fc2f2e..6438564459c1d80308307d49fc9a0e5a6eeb0f80 100644 (file)
@@ -185,6 +185,19 @@ struct bt_event *bt_event_create(struct bt_event_class *event_class)
                goto error;
        }
 
+       /*
+        * Safe to automatically map selected fields to the stream's
+        * clock's class here because the stream class is about to be
+        * frozen.
+        */
+       if (bt_stream_class_map_clock_class(stream_class,
+                       validation_output.packet_context_type,
+                       validation_output.event_header_type)) {
+               BT_LOGW_STR("Cannot automatically map selected stream class's "
+                       "field types to stream class's clock's class.");
+               goto error;
+       }
+
        /*
         * At this point we know the trace (if associated to the stream
         * class), the stream class, and the event class, with their
This page took 0.024189 seconds and 4 git commands to generate.