From: Mathieu Desnoyers Date: Thu, 15 Apr 2021 17:25:51 +0000 (-0400) Subject: run_filter callback takes const event parameter X-Git-Tag: v2.13.0-rc1~106 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9c098f2368d48c28ed02d891ff7f2a9fcc84d5d5;p=lttng-ust.git run_filter callback takes const event parameter The event parameter of the run_filter callback should be const, because it should not be modified, only read. Signed-off-by: Mathieu Desnoyers Change-Id: Ie25a3e228d4e0971b447ab4b25d4b2b5e03efa2e --- diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 2232212f..ad739bd7 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -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); diff --git a/src/lib/lttng-ust/events.h b/src/lib/lttng-ust/events.h index 9e28b4c3..9d5fbd11 100644 --- a/src/lib/lttng-ust/events.h +++ b/src/lib/lttng-ust/events.h @@ -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"))); diff --git a/src/lib/lttng-ust/lttng-bytecode-interpreter.c b/src/lib/lttng-ust/lttng-bytecode-interpreter.c index e28e113a..141e57f4 100644 --- a/src/lib/lttng-ust/lttng-bytecode-interpreter.c +++ b/src/lib/lttng-ust/lttng-bytecode-interpreter.c @@ -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))) {