cmd.type = NOTIFICATION_COMMAND_TYPE_REGISTER_TRIGGER;
lttng_trigger_get(trigger);
- cmd.parameters.trigger = trigger;
+ cmd.parameters.register_trigger.trigger = trigger;
ret = run_command_wait(handle, &cmd);
if (ret) {
enum lttng_error_code notification_thread_command_unregister_trigger(
struct notification_thread_handle *handle,
- struct lttng_trigger *trigger)
+ const struct lttng_trigger *trigger)
{
int ret;
enum lttng_error_code ret_code;
init_notification_thread_command(&cmd);
cmd.type = NOTIFICATION_COMMAND_TYPE_UNREGISTER_TRIGGER;
- cmd.parameters.trigger = trigger;
+ cmd.parameters.unregister_trigger.trigger = trigger;
ret = run_command_wait(handle, &cmd);
if (ret) {
enum notification_thread_command_type type;
union {
- /* Register/Unregister trigger. */
- struct lttng_trigger *trigger;
+ /* Register trigger. */
+ struct {
+ struct lttng_trigger *trigger;
+ } register_trigger;
+ /* Unregister trigger. */
+ struct {
+ const struct lttng_trigger *trigger;
+ } unregister_trigger;
/* Add channel. */
struct {
struct {
enum lttng_error_code notification_thread_command_unregister_trigger(
struct notification_thread_handle *handle,
- struct lttng_trigger *trigger);
+ const struct lttng_trigger *trigger);
enum lttng_error_code notification_thread_command_add_channel(
struct notification_thread_handle *handle,
static
int handle_notification_thread_command_unregister_trigger(
struct notification_thread_state *state,
- struct lttng_trigger *trigger,
+ const struct lttng_trigger *trigger,
enum lttng_error_code *_cmd_reply)
{
struct cds_lfht_iter iter;
struct lttng_channel_trigger_list *trigger_list;
struct notification_client_list *client_list;
struct lttng_trigger_ht_element *trigger_ht_element = NULL;
- struct lttng_condition *condition = lttng_trigger_get_condition(
+ const struct lttng_condition *condition = lttng_trigger_get_const_condition(
trigger);
enum lttng_error_code cmd_reply;
switch (cmd->type) {
case NOTIFICATION_COMMAND_TYPE_REGISTER_TRIGGER:
DBG("[notification-thread] Received register trigger command");
- ret = handle_notification_thread_command_register_trigger(
- state, cmd->parameters.trigger,
+ ret = handle_notification_thread_command_register_trigger(state,
+ cmd->parameters.register_trigger.trigger,
&cmd->reply_code);
break;
case NOTIFICATION_COMMAND_TYPE_UNREGISTER_TRIGGER:
DBG("[notification-thread] Received unregister trigger command");
ret = handle_notification_thread_command_unregister_trigger(
- state, cmd->parameters.trigger,
+ state,
+ cmd->parameters.unregister_trigger.trigger,
&cmd->reply_code);
break;
case NOTIFICATION_COMMAND_TYPE_ADD_CHANNEL: