X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread.h;h=8b4c7af2b0326dec1126ea2767cc1ffcf0e9761c;hp=bfce4cd3fbb8c8bca208f7b0d753f7e4446a73db;hb=246611b0dffa58fbc0e2329ddf6f9dc9d9eff7ce;hpb=d02d7404fac685cd836b53e121afc64af71af140 diff --git a/src/bin/lttng-sessiond/notification-thread.h b/src/bin/lttng-sessiond/notification-thread.h index bfce4cd3f..8b4c7af2b 100644 --- a/src/bin/lttng-sessiond/notification-thread.h +++ b/src/bin/lttng-sessiond/notification-thread.h @@ -47,6 +47,15 @@ struct notification_event_tracer_event_source_element { struct cds_list_head node; }; +struct notification_trigger_tokens_ht_element { + uint64_t token; + /* Weak reference to the trigger. */ + struct lttng_trigger *trigger; + struct cds_lfht_node node; + /* call_rcu delayed reclaim. */ + struct rcu_head rcu_node; +}; + struct notification_thread_handle { /* * Queue of struct notification command. @@ -258,6 +267,7 @@ struct notification_thread_state { struct cds_lfht *sessions_ht; struct cds_lfht *triggers_ht; struct cds_lfht *triggers_by_name_uid_ht; + struct cds_lfht *trigger_tokens_ht; struct { uint64_t next_tracer_token; uint64_t name_offset; @@ -275,6 +285,31 @@ struct notification_thread_state { struct cds_list_head tracer_event_sources_list; notification_client_id next_notification_client_id; struct action_executor *executor; + + /* + * Indicates the thread to break for the poll event processing loop and + * call _poll_wait() again. + * + * This is necessary because some events on one fd might trigger the + * consumption of another fd. + * For example, a single _poll_wait() call can return notification + * thread commands and events from the tracer event source (event + * notifier). + * Picture a scenario where we receive two events: + * the first one is a _REMOVE_TRACER_EVENT_SOURCE command, and + * the second is an POLLIN on the tracer event source fd. + * + * The _REMOVE_TRACER_EVENT_SOURCE will read all the data of the + * removed tracer event source. + * + * The second event is now invalid has we consumed all the data for + * which we received the POLLIN. + * + * For this reason, we need to break for the event processing loop and + * call _poll_wait() again to get a clean view of the activity on the + * fds. + */ + bool restart_poll; }; /* notification_thread_data takes ownership of the channel monitor pipes. */