- /*
- * For each clock class found in the event's trace, get the
- * event's clock value for this clock class, and if it exists,
- * make sure that this clock class has a priority in the
- * notification's clock class priority map.
- */
- bool is_valid = true;
- int ret;
- int count;
- size_t i;
- struct bt_ctf_event_class *event_class = NULL;
- struct bt_ctf_stream_class *stream_class = NULL;
- struct bt_ctf_trace *trace = NULL;
- uint64_t prio;
-
- event_class = bt_ctf_event_get_class(notif->event);
- assert(event_class);
- stream_class = bt_ctf_event_class_get_stream_class(event_class);
- assert(stream_class);
- trace = bt_ctf_stream_class_get_trace(stream_class);
- assert(trace);
- count = bt_ctf_trace_get_clock_class_count(trace);
- assert(count >= 0);
-
- for (i = 0; i < count; i++) {
- struct bt_ctf_clock_class *clock_class =
- bt_ctf_trace_get_clock_class(trace, i);
-
- assert(clock_class);
- ret = bt_clock_class_priority_map_get_clock_class_priority(
- notif->cc_prio_map, clock_class, &prio);
- bt_put(clock_class);
- if (ret) {
- is_valid = false;
- goto end;
- }
+ struct bt_notification_event *notification = NULL;
+
+ notification = g_new0(struct bt_notification_event, 1);
+ if (!notification) {
+ BT_LOGE_STR("Failed to allocate one event notification.");
+ goto error;