diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-24 15:31:51 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-24 15:40:13 -0400 |
commit | 3f6fe06dbf67b46d36fedec502300e04dffeb67a (patch) | |
tree | 3879fe89257ded94190ad8f1835f0320eb19f610 /kernel/trace/trace.h | |
parent | 1889d20922d14a97b2099fa4d47587217c0ba48b (diff) |
tracing/filters: Unify the regex parsing helpers
The filter code has stolen the regex parsing function from ftrace to
get the regex support.
We have duplicated this code, so factorize it in the filter area and
make it generally available, as the filter code is the most suited to
host this feature.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r-- | kernel/trace/trace.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 8d0db6018fe4..db6b83edd49b 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -709,6 +709,13 @@ typedef int (*filter_pred_fn_t) (struct filter_pred *pred, void *event, | |||
709 | 709 | ||
710 | typedef int (*regex_match_func)(char *str, struct regex *r, int len); | 710 | typedef int (*regex_match_func)(char *str, struct regex *r, int len); |
711 | 711 | ||
712 | enum regex_type { | ||
713 | MATCH_FULL, | ||
714 | MATCH_FRONT_ONLY, | ||
715 | MATCH_MIDDLE_ONLY, | ||
716 | MATCH_END_ONLY, | ||
717 | }; | ||
718 | |||
712 | struct regex { | 719 | struct regex { |
713 | char pattern[MAX_FILTER_STR_VAL]; | 720 | char pattern[MAX_FILTER_STR_VAL]; |
714 | int len; | 721 | int len; |
@@ -727,6 +734,8 @@ struct filter_pred { | |||
727 | int pop_n; | 734 | int pop_n; |
728 | }; | 735 | }; |
729 | 736 | ||
737 | extern enum regex_type | ||
738 | filter_parse_regex(char *buff, int len, char **search, int *not); | ||
730 | extern void print_event_filter(struct ftrace_event_call *call, | 739 | extern void print_event_filter(struct ftrace_event_call *call, |
731 | struct trace_seq *s); | 740 | struct trace_seq *s); |
732 | extern int apply_event_filter(struct ftrace_event_call *call, | 741 | extern int apply_event_filter(struct ftrace_event_call *call, |