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: preserve jul/log4j domain loglevels
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.cpp
diff --git
a/src/bin/lttng-sessiond/cmd.cpp
b/src/bin/lttng-sessiond/cmd.cpp
index 3f066a002d8d585d43cf3401556cc8a3eabca9ac..c1588bc3a37dc3dc1dd9b0facf981a33707b4111 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.cpp
+++ b/
src/bin/lttng-sessiond/cmd.cpp
@@
-22,7
+22,6
@@
#include "lttng-syscall.hpp"
#include "notification-thread-commands.hpp"
#include "notification-thread.hpp"
#include "lttng-syscall.hpp"
#include "notification-thread-commands.hpp"
#include "notification-thread.hpp"
-#include "rotate.hpp"
#include "rotation-thread.hpp"
#include "session.hpp"
#include "timer.hpp"
#include "rotation-thread.hpp"
#include "session.hpp"
#include "timer.hpp"
@@
-485,14
+484,22
@@
static enum lttng_error_code list_lttng_ust_global_events(char *channel_name,
tmp_event->exclusion = 1;
}
tmp_event->exclusion = 1;
}
+ std::vector<const char *> exclusion_names;
+ if (uevent->exclusion) {
+ for (int i = 0; i < uevent->exclusion->count; i++) {
+ exclusion_names.emplace_back(
+ LTTNG_EVENT_EXCLUSION_NAME_AT(uevent->exclusion, i));
+ }
+ }
+
/*
* We do not care about the filter bytecode and the fd from the
* userspace_probe_location.
*/
ret = lttng_event_serialize(tmp_event,
/*
* We do not care about the filter bytecode and the fd from the
* userspace_probe_location.
*/
ret = lttng_event_serialize(tmp_event,
-
uevent->exclusion ? uevent->exclusion->count : 0
,
-
uevent->exclusion ? (char **) uevent->exclusion->names
:
- nullptr,
+
exclusion_names.size()
,
+
exclusion_names.size() ? exclusion_names.data()
:
+
nullptr,
uevent->filter_expression,
0,
nullptr,
uevent->filter_expression,
0,
nullptr,
@@
-2088,8
+2095,6
@@
static int _cmd_enable_event(struct ltt_session *session,
}
}
}
}
- DBG("Enable event command for event \'%s\'", event->name);
-
lttng::urcu::read_lock_guard read_lock;
switch (domain->type) {
lttng::urcu::read_lock_guard read_lock;
switch (domain->type) {
@@
-2331,6
+2336,7
@@
static int _cmd_enable_event(struct ltt_session *session,
memset(&uevent, 0, sizeof(uevent));
uevent.type = LTTNG_EVENT_TRACEPOINT;
uevent.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
memset(&uevent, 0, sizeof(uevent));
uevent.type = LTTNG_EVENT_TRACEPOINT;
uevent.loglevel_type = LTTNG_EVENT_LOGLEVEL_ALL;
+ uevent.loglevel = -1;
default_event_name = event_get_default_agent_ust_name(domain->type);
if (!default_event_name) {
ret = LTTNG_ERR_FATAL;
default_event_name = event_get_default_agent_ust_name(domain->type);
if (!default_event_name) {
ret = LTTNG_ERR_FATAL;
@@
-3391,9
+3397,7
@@
error:
*
* Called with session lock held.
*/
*
* Called with session lock held.
*/
-int cmd_destroy_session(struct ltt_session *session,
- struct notification_thread_handle *notification_thread_handle,
- int *sock_fd)
+int cmd_destroy_session(struct ltt_session *session, int *sock_fd)
{
int ret;
enum lttng_error_code destruction_last_error = LTTNG_OK;
{
int ret;
enum lttng_error_code destruction_last_error = LTTNG_OK;
@@
-3435,7
+3439,15
@@
int cmd_destroy_session(struct ltt_session *session,
}
if (session->rotate_size) {
}
if (session->rotate_size) {
- unsubscribe_session_consumed_size_rotation(session, notification_thread_handle);
+ try {
+ the_rotation_thread_handle->unsubscribe_session_consumed_size_rotation(
+ *session);
+ } catch (const std::exception& e) {
+ /* Continue the destruction of the session anyway. */
+ ERR("Failed to unsubscribe rotation thread notification channel from consumed size condition during session destruction: %s",
+ e.what());
+ }
+
session->rotate_size = 0;
}
session->rotate_size = 0;
}
@@
-4463,6
+4475,8
@@
synchronize_tracer_notifier_register(struct notification_thread_handle *notifica
(int) trigger_owner,
ret_code);
}
(int) trigger_owner,
ret_code);
}
+
+ goto end_unlock_session_list;
}
break;
}
}
break;
}
@@
-5619,7
+5633,7
@@
end:
ret = (cmd_ret == LTTNG_OK) ? cmd_ret : -((int) cmd_ret);
return ret;
error:
ret = (cmd_ret == LTTNG_OK) ? cmd_ret : -((int) cmd_ret);
return ret;
error:
- if (session_reset_rotation_state(session, LTTNG_ROTATION_STATE_ERROR)) {
+ if (session_reset_rotation_state(
*
session, LTTNG_ROTATION_STATE_ERROR)) {
ERR("Failed to reset rotation state of session \"%s\"", session->name);
}
goto end;
ERR("Failed to reset rotation state of session \"%s\"", session->name);
}
goto end;
@@
-5786,8
+5800,7
@@
end:
int cmd_rotation_set_schedule(struct ltt_session *session,
bool activate,
enum lttng_rotation_schedule_type schedule_type,
int cmd_rotation_set_schedule(struct ltt_session *session,
bool activate,
enum lttng_rotation_schedule_type schedule_type,
- uint64_t new_value,
- struct notification_thread_handle *notification_thread_handle)
+ uint64_t new_value)
{
int ret;
uint64_t *parameter_value;
{
int ret;
uint64_t *parameter_value;
@@
-5889,18
+5902,22
@@
int cmd_rotation_set_schedule(struct ltt_session *session,
break;
case LTTNG_ROTATION_SCHEDULE_TYPE_SIZE_THRESHOLD:
if (activate) {
break;
case LTTNG_ROTATION_SCHEDULE_TYPE_SIZE_THRESHOLD:
if (activate) {
- ret = subscribe_session_consumed_size_rotation(
- session, new_value, notification_thread_handle);
- if (ret) {
- ERR("Failed to enable consumed-size notification in ROTATION_SET_SCHEDULE command");
+ try {
+ the_rotation_thread_handle->subscribe_session_consumed_size_rotation(
+ *session, new_value);
+ } catch (const std::exception& e) {
+ ERR("Failed to enable consumed-size notification in ROTATION_SET_SCHEDULE command: %s",
+ e.what());
ret = LTTNG_ERR_UNK;
goto end;
}
} else {
ret = LTTNG_ERR_UNK;
goto end;
}
} else {
- ret = unsubscribe_session_consumed_size_rotation(
- session, notification_thread_handle);
- if (ret) {
- ERR("Failed to disable consumed-size notification in ROTATION_SET_SCHEDULE command");
+ try {
+ the_rotation_thread_handle
+ ->unsubscribe_session_consumed_size_rotation(*session);
+ } catch (const std::exception& e) {
+ ERR("Failed to disable consumed-size notification in ROTATION_SET_SCHEDULE command: %s",
+ e.what());
ret = LTTNG_ERR_UNK;
goto end;
}
ret = LTTNG_ERR_UNK;
goto end;
}
This page took
0.05725 seconds
and
4
git commands to generate.