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

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

include/lttng/ust-events.h
src/lib/lttng-ust/events.h
src/lib/lttng-ust/lttng-bytecode-interpreter.c

index 2232212fed73f7a55ff71a717b2bcbd0e0a2c5a9..ad739bd76e0c58c5577b2f04d50d3468a5cb8307 100644 (file)
@@ -349,7 +349,7 @@ struct lttng_ust_event_common {
 
        int enabled;
        int eval_filter;                                /* Need to evaluate filters */
-       int (*run_filter)(struct lttng_ust_event_common *event,
+       int (*run_filter)(const struct lttng_ust_event_common *event,
                const char *stack_data,
                void *filter_ctx);
 
index 9e28b4c3f2326b8f18bf2e174d6dd6d7f2496744..9d5fbd1126a90079a567592659848fdfe3590f42 100644 (file)
@@ -300,7 +300,7 @@ struct lttng_ust_channel_buffer *lttng_ust_alloc_channel_buffer(void)
 void lttng_ust_free_channel_common(struct lttng_ust_channel_common *chan)
        __attribute__((visibility("hidden")));
 
-int lttng_ust_interpret_event_filter(struct lttng_ust_event_common *event,
+int lttng_ust_interpret_event_filter(const struct lttng_ust_event_common *event,
                const char *interpreter_stack_data,
                void *filter_ctx)
        __attribute__((visibility("hidden")));
index e28e113a712026b692027647b84ede455d3a9d7b..141e57f4d232e4e1338359e2f472f55fc3d33cef 100644 (file)
@@ -2511,7 +2511,7 @@ end:
 /*
  * Return LTTNG_UST_EVENT_FILTER_ACCEPT or LTTNG_UST_EVENT_FILTER_REJECT.
  */
-int lttng_ust_interpret_event_filter(struct lttng_ust_event_common *event,
+int lttng_ust_interpret_event_filter(const struct lttng_ust_event_common *event,
                const char *interpreter_stack_data,
                void *event_filter_ctx __attribute__((unused)))
 {
This page took 0.026474 seconds and 4 git commands to generate.