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,
- 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;
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());
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;
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;