X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-internal.hpp;h=864593cefa28f204123b7fe84fb2d605fcef07c2;hb=ca400a290a3e98e9f2578d4cbaede87019f2ee94;hp=497484ba04534586263072b4f629c62bb2b124b8;hpb=c9e313bc594f40a86eed237dce222c0fc99c957f;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/notification-thread-internal.hpp b/src/bin/lttng-sessiond/notification-thread-internal.hpp index 497484ba0..864593cef 100644 --- a/src/bin/lttng-sessiond/notification-thread-internal.hpp +++ b/src/bin/lttng-sessiond/notification-thread-internal.hpp @@ -8,17 +8,20 @@ #ifndef NOTIFICATION_THREAD_INTERNAL_H #define NOTIFICATION_THREAD_INTERNAL_H +#include "notification-thread.hpp" + #include #include #include + #include #include + #include #include +#include #include #include -#include -#include "notification-thread.hpp" struct lttng_evaluation; struct notification_thread_handle; @@ -28,8 +31,21 @@ struct channel_key { enum lttng_domain_type domain; }; +struct session_state_sample { + uint64_t consumed_data_size; + struct { + /* Whether a rotation is ongoing for this session. */ + bool ongoing; + /* Identifier of the currently ongoing rotation. */ + uint64_t id; + /* Location of last completed rotation. */ + struct lttng_trace_archive_location *location; + } rotation; +}; + struct session_info { struct lttng_ref ref; + uint64_t id; char *name; uid_t uid; gid_t gid; @@ -47,13 +63,8 @@ struct session_info { * destruction. */ struct cds_lfht *sessions_ht; - uint64_t consumed_data_size; - struct { - /* Whether a rotation is ongoing for this session. */ - bool ongoing; - /* Identifier of the currently ongoing rotation. */ - uint64_t id; - } rotation; + /* Session's state as of the latest update. */ + struct session_state_sample last_state_sample; /* call_rcu delayed reclaim. */ struct rcu_head rcu_node; }; @@ -165,6 +176,7 @@ struct notification_client { * clean-up. */ bool active; + int current_poll_events; struct { /* * During the reception of a message, the reception @@ -230,34 +242,29 @@ bool notification_client_list_get(struct notification_client_list *list); void notification_client_list_put(struct notification_client_list *list); /* Only returns a non-zero value if a fatal error occurred. */ -typedef int (*report_client_transmission_result_cb)( - struct notification_client *client, - enum client_transmission_status status, - void *user_data); +using report_client_transmission_result_cb = int (*)(struct notification_client *, + enum client_transmission_status, + void *); -int notification_client_list_send_evaluation( - struct notification_client_list *list, - const struct lttng_trigger *trigger, - const struct lttng_evaluation *evaluation, - const struct lttng_credentials *source_object_creds, - report_client_transmission_result_cb client_report, - void *user_data); +int notification_client_list_send_evaluation(struct notification_client_list *list, + const struct lttng_trigger *trigger, + const struct lttng_evaluation *evaluation, + const struct lttng_credentials *source_object_creds, + report_client_transmission_result_cb client_report, + void *user_data); int notification_thread_client_communication_update( - struct notification_thread_handle *handle, - notification_client_id id, - enum client_transmission_status transmission_status); + struct notification_thread_handle *handle, + notification_client_id id, + enum client_transmission_status transmission_status); /* * Takes ownership of the payload if present. */ struct lttng_event_notifier_notification *lttng_event_notifier_notification_create( - uint64_t tracer_token, - enum lttng_domain_type domain, - char *payload, - size_t payload_size); + uint64_t tracer_token, enum lttng_domain_type domain, char *payload, size_t payload_size); void lttng_event_notifier_notification_destroy( - struct lttng_event_notifier_notification *event_notifier_notification); + struct lttng_event_notifier_notification *event_notifier_notification); #endif /* NOTIFICATION_THREAD_INTERNAL_H */