- struct ltt_event *event;
-
- if (cds_list_empty(&wildcard->filter_bytecode))
- return;
- cds_list_for_each_entry(event, &wildcard->events, wildcard_list) {
+ struct lttng_ust_filter_bytecode_node *bc;
+ struct lttng_bytecode_runtime *runtime;
+
+ /* Can only be called for events with desc attached */
+ assert(event->desc);
+
+ /* Link each bytecode. */
+ cds_list_for_each_entry(bc, &enabler->filter_bytecode_head, node) {
+ int found = 0, ret;
+ struct cds_list_head *insert_loc;
+
+ cds_list_for_each_entry(runtime,
+ &event->bytecode_runtime_head, node) {
+ if (runtime->bc == bc) {
+ found = 1;
+ break;
+ }
+ }
+ /* Skip bytecode already linked */
+ if (found)
+ continue;
+
+ /*
+ * Insert at specified priority (seqnum) in increasing
+ * order.
+ */
+ cds_list_for_each_entry_reverse(runtime,
+ &event->bytecode_runtime_head, node) {
+ if (runtime->bc->bc.seqnum < bc->bc.seqnum) {
+ /* insert here */
+ insert_loc = &runtime->node;
+ goto add_within;
+ }
+ }
+ /* Add to head to list */
+ insert_loc = &event->bytecode_runtime_head;
+ add_within: