#include <lttng/rotate-internal.hpp>
#include <lttng/location-internal.hpp>
#include <lttng/condition/condition-internal.hpp>
+#include <lttng/notification/notification-internal.hpp>
#include "rotation-thread.hpp"
#include "lttng-sessiond.hpp"
struct lttng_poll_event events;
};
-struct rotation_thread_job {
- enum rotation_thread_job_type type;
- struct ltt_session *session;
- /* List member in struct rotation_thread_timer_queue. */
- struct cds_list_head head;
-};
-
/*
* The timer thread enqueues jobs and wakes up the rotation thread.
* When the rotation thread wakes up, it empties the queue.
struct lttng_pipe *quit_pipe;
};
+namespace {
+struct rotation_thread_job {
+ enum rotation_thread_job_type type;
+ struct ltt_session *session;
+ /* List member in struct rotation_thread_timer_queue. */
+ struct cds_list_head head;
+};
+} /* namespace */
+
static
const char *get_job_type_str(enum rotation_thread_job_type job_type)
{
}
static
-int handle_condition(const struct lttng_condition *condition,
- const struct lttng_evaluation *evaluation,
+int handle_condition(const struct lttng_notification *notification,
struct notification_thread_handle *notification_thread_handle)
{
int ret = 0;
enum lttng_evaluation_status evaluation_status;
uint64_t consumed;
struct ltt_session *session;
+ const struct lttng_condition *condition =
+ lttng_notification_get_const_condition(notification);
+ const struct lttng_evaluation *evaluation =
+ lttng_notification_get_const_evaluation(notification);
condition_type = lttng_condition_get_type(condition);
}
session_lock(session);
+ if (!lttng_trigger_is_equal(session->rotate_trigger,
+ lttng_notification_get_const_trigger(notification))) {
+ /* Notification does not originate from our rotation trigger. */
+ ret = 0;
+ goto end_unlock;
+ }
+
ret = unsubscribe_session_consumed_size_rotation(session,
notification_thread_handle);
if (ret) {
bool notification_pending;
struct lttng_notification *notification = NULL;
enum lttng_notification_channel_status status;
- const struct lttng_evaluation *notification_evaluation;
- const struct lttng_condition *notification_condition;
status = lttng_notification_channel_has_pending_notification(
rotate_notification_channel, ¬ification_pending);
goto end;
}
- notification_condition = lttng_notification_get_condition(notification);
- notification_evaluation = lttng_notification_get_evaluation(notification);
-
- ret = handle_condition(notification_condition, notification_evaluation,
+ ret = handle_condition(notification,
handle->notification_thread_handle);
end: