[PATCH 2/3] tracing/filter: harden the prototype of predicate_parse()

From: Pingfan Liu
Date: Thu Jan 06 2022 - 23:50:14 EST


Since the next patch badly relies on the struct 'trace_event_call' to
pass in 'event_call_class info', making the involved functions' prototype
stricter.

There is no functional change in this patch.

Signed-off-by: Pingfan Liu <kernelfans@xxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
To: linux-kernel@xxxxxxxxxxxxxxx
---
kernel/trace/trace_events_filter.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 264456e1698f..2a05315127f9 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -136,7 +136,8 @@ static void parse_error(struct filter_parse_error *pe, int err, int pos)
pe->lasterr_pos = pos;
}

-typedef int (*parse_pred_fn)(const char *str, void *data, int pos,
+typedef int (*parse_pred_fn)(const char *str, struct trace_event_call *data,
+ int pos,
struct filter_parse_error *pe,
struct filter_pred **pred);

@@ -408,7 +409,7 @@ enum {
*/
static struct prog_entry *
predicate_parse(const char *str, int nr_parens, int nr_preds,
- parse_pred_fn parse_pred, void *data,
+ parse_pred_fn parse_pred, struct trace_event_call *data,
struct filter_parse_error *pe)
{
struct prog_entry *prog_stack;
@@ -1149,7 +1150,7 @@ static filter_pred_fn_t select_comparison_fn(enum filter_op_ids op,
}

/* Called when a predicate is encountered by predicate_parse() */
-static int parse_pred(const char *str, void *data,
+static int parse_pred(const char *str, struct trace_event_call *data,
int pos, struct filter_parse_error *pe,
struct filter_pred **pred_ptr)
{
--
2.31.1