notification_send callback takes const event_notifier parameter
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Apr 2021 17:31:13 +0000 (13:31 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Apr 2021 17:32:11 +0000 (13:32 -0400)
The event parameter of the notification_send callback should be const,
because it should not be modified, only read.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iff6b7454bb4a87ed4a75d842f67e18e5a11be4dd

include/lttng/ust-events.h
src/lib/lttng-ust/event-notifier-notification.c
src/lib/lttng-ust/lttng-tracer-core.h

index ad739bd76e0c58c5577b2f04d50d3468a5cb8307..95b4698de089bb08440687bbcb226f7ca461bcd2 100644 (file)
@@ -422,7 +422,7 @@ struct lttng_ust_event_notifier {
        struct lttng_ust_event_notifier_private *priv;  /* Private event notifier interface */
 
        int eval_capture;                               /* Need to evaluate capture */
-       void (*notification_send)(struct lttng_ust_event_notifier *event_notifier,
+       void (*notification_send)(const struct lttng_ust_event_notifier *event_notifier,
                const char *stack_data,
                struct lttng_ust_notification_ctx *notif_ctx);
 
index 4cfd1b15ceaa087ffda3bb7727e819a1d1cf62d1..51f10b2ebfec6526289b50baf6bcd66fe29d8cce 100644 (file)
@@ -214,7 +214,7 @@ void capture_sequence(struct lttng_msgpack_writer *writer,
 
 static
 void notification_init(struct lttng_event_notifier_notification *notif,
-               struct lttng_ust_event_notifier *event_notifier)
+               const struct lttng_ust_event_notifier *event_notifier)
 {
        struct lttng_msgpack_writer *writer = &notif->writer;
 
@@ -270,7 +270,7 @@ void notification_append_empty_capture(
        lttng_msgpack_write_nil(&notif->writer);
 }
 
-static void record_error(struct lttng_ust_event_notifier *event_notifier)
+static void record_error(const struct lttng_ust_event_notifier *event_notifier)
 {
        struct lttng_event_notifier_group *event_notifier_group =
                        event_notifier->priv->group;
@@ -300,7 +300,7 @@ static void record_error(struct lttng_ust_event_notifier *event_notifier)
 
 static
 void notification_send(struct lttng_event_notifier_notification *notif,
-               struct lttng_ust_event_notifier *event_notifier)
+               const struct lttng_ust_event_notifier *event_notifier)
 {
        ssize_t ret;
        size_t content_len;
@@ -360,7 +360,7 @@ void notification_send(struct lttng_event_notifier_notification *notif,
 }
 
 void lttng_event_notifier_notification_send(
-               struct lttng_ust_event_notifier *event_notifier,
+               const struct lttng_ust_event_notifier *event_notifier,
                const char *stack_data,
                struct lttng_ust_notification_ctx *notif_ctx)
 {
index 096ed28fae97b3bc28af55370428bf31beec79ff..4c93428a87b95902119614b9777af83ea8f8c457 100644 (file)
@@ -87,7 +87,7 @@ void lttng_ust_dummy_get_value(void *priv, struct lttng_ust_ctx_value *value)
        __attribute__((visibility("hidden")));
 
 void lttng_event_notifier_notification_send(
-               struct lttng_ust_event_notifier *event_notifier,
+               const struct lttng_ust_event_notifier *event_notifier,
                const char *stack_data,
                struct lttng_ust_notification_ctx *notif_ctx)
        __attribute__((visibility("hidden")));
This page took 0.026594 seconds and 4 git commands to generate.