+static
+bool validate_clock_classes(struct bt_notification_event *notif)
+{
+ /*
+ * 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;
+ }
+ }
+
+end:
+ bt_put(trace);
+ bt_put(stream_class);
+ bt_put(event_class);
+ return is_valid;
+}
+
+struct bt_notification *bt_notification_event_create(struct bt_ctf_event *event,
+ struct bt_clock_class_priority_map *cc_prio_map)