Clean-up: sessiond: make some accesses to conditions const
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 24 Mar 2021 16:17:59 +0000 (12:17 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 24 Mar 2021 18:20:46 +0000 (14:20 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I88edd184c06d2f2912331da8e83b624f8ae8bcc2

src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/trace-kernel.c
src/bin/lttng-sessiond/trace-kernel.h

index 507937ca1259415915a0aa71849ea4645fcfa0ec..e8fd3110e21c2cacb8fe8bd07c2cac5c26f6a9ee 100644 (file)
@@ -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;
index 11548884d143174241afa67adfebe359f2c89e19..a453fd8b705537ba8908e729517c20b408ef2951 100644 (file)
@@ -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);
index 89a4ab19f03364222dfd4f356b7db109ca372746..b89162b7de43c9ad81650f3aba64c73fb6e7ad38 100644 (file)
@@ -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,
This page took 0.029022 seconds and 4 git commands to generate.