projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: sessiond: rotation trigger leak
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
rotation-thread.cpp
diff --git
a/src/bin/lttng-sessiond/rotation-thread.cpp
b/src/bin/lttng-sessiond/rotation-thread.cpp
index ac75f58abab75bf24e0a25b817070c0bfc2aa5ca..c1c6c50debb4953c0f6c757cf9daa2cee51a9419 100644
(file)
--- a/
src/bin/lttng-sessiond/rotation-thread.cpp
+++ b/
src/bin/lttng-sessiond/rotation-thread.cpp
@@
-26,6
+26,7
@@
#include <lttng/rotate-internal.hpp>
#include <lttng/location-internal.hpp>
#include <lttng/condition/condition-internal.hpp>
#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"
#include "rotation-thread.hpp"
#include "lttng-sessiond.hpp"
@@
-626,8
+627,7
@@
end:
}
static
}
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;
struct notification_thread_handle *notification_thread_handle)
{
int ret = 0;
@@
-637,6
+637,10
@@
int handle_condition(const struct lttng_condition *condition,
enum lttng_evaluation_status evaluation_status;
uint64_t consumed;
struct ltt_session *session;
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);
condition_type = lttng_condition_get_type(condition);
@@
-678,6
+682,13
@@
int handle_condition(const struct lttng_condition *condition,
}
session_lock(session);
}
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) {
ret = unsubscribe_session_consumed_size_rotation(session,
notification_thread_handle);
if (ret) {
@@
-720,8
+731,6
@@
int handle_notification_channel(int fd __attribute__((unused)),
bool notification_pending;
struct lttng_notification *notification = NULL;
enum lttng_notification_channel_status status;
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);
status = lttng_notification_channel_has_pending_notification(
rotate_notification_channel, ¬ification_pending);
@@
-759,10
+768,7
@@
int handle_notification_channel(int fd __attribute__((unused)),
goto end;
}
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:
handle->notification_thread_handle);
end:
This page took
0.027268 seconds
and
4
git commands to generate.