X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.cpp;h=ef4383ff25a67262c2f6d5157422a916d94a9147;hb=dd7ef1243236f524e57b25baa038973e793d5d72;hp=203ffb14652880478fd0843e91aa0a75d22c3de5;hpb=28f23191dcbf047429d51950a337a57d7a3f866a;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.cpp b/src/bin/lttng-sessiond/cmd.cpp index 203ffb146..ef4383ff2 100644 --- a/src/bin/lttng-sessiond/cmd.cpp +++ b/src/bin/lttng-sessiond/cmd.cpp @@ -484,18 +484,28 @@ static enum lttng_error_code list_lttng_ust_global_events(char *channel_name, tmp_event->exclusion = 1; } + std::vector 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, - uevent->exclusion ? uevent->exclusion->count : 0, - uevent->exclusion ? (char **) uevent->exclusion->names : - nullptr, - uevent->filter_expression, - 0, - nullptr, - reply_payload); + ret = lttng_event_serialize( + tmp_event, + exclusion_names.size(), + exclusion_names.size() ? + exclusion_names.data() : + nullptr, + uevent->filter_expression, + 0, + nullptr, + reply_payload); lttng_event_destroy(tmp_event); if (ret) { ret_code = LTTNG_ERR_FATAL; @@ -3435,7 +3445,7 @@ int cmd_destroy_session(struct ltt_session *session, int *sock_fd) try { the_rotation_thread_handle->unsubscribe_session_consumed_size_rotation( *session); - } catch (std::exception& e) { + } 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()); @@ -4468,6 +4478,8 @@ synchronize_tracer_notifier_register(struct notification_thread_handle *notifica (int) trigger_owner, ret_code); } + + goto end_unlock_session_list; } break; } @@ -5896,7 +5908,7 @@ int cmd_rotation_set_schedule(struct ltt_session *session, try { the_rotation_thread_handle->subscribe_session_consumed_size_rotation( *session, new_value); - } catch (std::exception& e) { + } catch (const std::exception& e) { ERR("Failed to enable consumed-size notification in ROTATION_SET_SCHEDULE command: %s", e.what()); ret = LTTNG_ERR_UNK; @@ -5906,7 +5918,7 @@ int cmd_rotation_set_schedule(struct ltt_session *session, try { the_rotation_thread_handle ->unsubscribe_session_consumed_size_rotation(*session); - } catch (std::exception& e) { + } catch (const std::exception& e) { ERR("Failed to disable consumed-size notification in ROTATION_SET_SCHEDULE command: %s", e.what()); ret = LTTNG_ERR_UNK;