From: Jérémie Galarneau Date: Wed, 24 Mar 2021 16:17:59 +0000 (-0400) Subject: Clean-up: sessiond: make some accesses to conditions const X-Git-Tag: v2.13.0-rc1~188 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7c1f6da21f4d46d9c834820a2b26f0634c7365a9;p=lttng-tools.git Clean-up: sessiond: make some accesses to conditions const Signed-off-by: Jérémie Galarneau Change-Id: I88edd184c06d2f2912331da8e83b624f8ae8bcc2 --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 507937ca1..e8fd3110e 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4300,7 +4300,8 @@ enum lttng_error_code synchronize_tracer_notifier_register( struct lttng_trigger *trigger, const struct lttng_credentials *cmd_creds) { enum lttng_error_code ret_code; - struct lttng_condition *condition = lttng_trigger_get_condition(trigger); + const struct lttng_condition *condition = + lttng_trigger_get_const_condition(trigger); const char *trigger_name; uid_t trigger_owner; enum lttng_trigger_status trigger_status; diff --git a/src/bin/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c index 11548884d..a453fd8b7 100644 --- a/src/bin/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -497,7 +497,7 @@ enum lttng_error_code trace_kernel_create_event_notifier_rule( assert(event_notifier_rule); - condition = lttng_trigger_get_condition(trigger); + condition = lttng_trigger_get_const_condition(trigger); assert(condition); condition_type = lttng_condition_get_type(condition); diff --git a/src/bin/lttng-sessiond/trace-kernel.h b/src/bin/lttng-sessiond/trace-kernel.h index 89a4ab19f..b89162b7d 100644 --- a/src/bin/lttng-sessiond/trace-kernel.h +++ b/src/bin/lttng-sessiond/trace-kernel.h @@ -164,6 +164,7 @@ struct ltt_kernel_stream *trace_kernel_create_stream(const char *name, unsigned int count); struct ltt_kernel_context *trace_kernel_create_context( struct lttng_kernel_context *ctx); +/* Trigger is only non-const to acquire a reference. */ enum lttng_error_code trace_kernel_create_event_notifier_rule( struct lttng_trigger *trigger, uint64_t token,