tracing: Move struct filter_pred into trace_events_filter.c
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 6 Sep 2022 22:53:16 +0000 (18:53 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 26 Sep 2022 17:01:10 +0000 (13:01 -0400)
The structure filter_pred and the typedef of the function used are only
referenced by trace_events_filter.c. There's no reason to have it in an
external header file. Move them into the only file they are used in.

Link: https://lkml.kernel.org/r/20220906225529.598047132@goodmis.org
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.h
kernel/trace/trace_events_filter.c

index 900e75d..54ee571 100644 (file)
@@ -1435,8 +1435,6 @@ event_trigger_unlock_commit(struct trace_event_file *file,
 struct filter_pred;
 struct regex;
 
-typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event);
-
 typedef int (*regex_match_func)(char *str, struct regex *r, int len);
 
 enum regex_type {
@@ -1455,17 +1453,6 @@ struct regex {
        regex_match_func        match;
 };
 
-struct filter_pred {
-       filter_pred_fn_t        fn;
-       u64                     val;
-       struct regex            regex;
-       unsigned short          *ops;
-       struct ftrace_event_field *field;
-       int                     offset;
-       int                     not;
-       int                     op;
-};
-
 static inline bool is_string_field(struct ftrace_event_field *field)
 {
        return field->filter_type == FILTER_DYN_STRING ||
index 4b1057a..c49c689 100644 (file)
@@ -43,6 +43,19 @@ enum filter_op_ids { OPS };
 
 static const char * ops[] = { OPS };
 
+typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event);
+
+struct filter_pred {
+       filter_pred_fn_t        fn;
+       u64                     val;
+       struct regex            regex;
+       unsigned short          *ops;
+       struct ftrace_event_field *field;
+       int                     offset;
+       int                     not;
+       int                     op;
+};
+
 /*
  * pred functions are OP_LE, OP_LT, OP_GE, OP_GT, and OP_BAND
  * pred_funcs_##type below must match the order of them above.