Fix: racy notifier captures update vs traversal
[lttng-modules.git] / src / lttng-events.c
index 2bec72847e36760f93fc5d04400b501b50149c34..a144f544c52540170ea0e9478c263780d05b856d 100644 (file)
@@ -949,6 +949,8 @@ struct lttng_event *_lttng_event_create(struct lttng_channel *chan,
                event_return->enabled = 0;
                event_return->registered = 1;
                event_return->instrumentation = itype;
+               INIT_LIST_HEAD(&event_return->filter_bytecode_runtime_head);
+               INIT_LIST_HEAD(&event_return->enablers_ref_head);
                /*
                 * Populate lttng_event structure before kretprobe registration.
                 */
@@ -2766,6 +2768,8 @@ void lttng_event_notifier_group_sync_enablers(struct lttng_event_notifier_group
                list_for_each_entry(runtime,
                                &event_notifier->capture_bytecode_runtime_head, node)
                        lttng_bytecode_capture_sync_state(runtime);
+
+               WRITE_ONCE(event_notifier->eval_capture, !!event_notifier->num_captures);
        }
 }
 
This page took 0.027621 seconds and 4 git commands to generate.