2 * trace_events_filter - generic event filtering
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 * Copyright (C) 2009 Tom Zanussi <tzanussi@gmail.com>
21 #include <linux/debugfs.h>
22 #include <linux/uaccess.h>
23 #include <linux/module.h>
24 #include <linux/ctype.h>
25 #include <linux/mutex.h>
28 #include "trace_output.h"
50 static struct filter_op filter_ops
[] = {
59 { OP_NONE
, "OP_NONE", 0 },
60 { OP_OPEN_PAREN
, "(", 0 },
66 FILT_ERR_UNBALANCED_PAREN
,
67 FILT_ERR_TOO_MANY_OPERANDS
,
68 FILT_ERR_OPERAND_TOO_LONG
,
69 FILT_ERR_FIELD_NOT_FOUND
,
70 FILT_ERR_ILLEGAL_FIELD_OP
,
71 FILT_ERR_ILLEGAL_INTVAL
,
72 FILT_ERR_BAD_SUBSYS_FILTER
,
73 FILT_ERR_TOO_MANY_PREDS
,
74 FILT_ERR_MISSING_FIELD
,
75 FILT_ERR_INVALID_FILTER
,
78 static char *err_text
[] = {
85 "Illegal operation for field type",
86 "Illegal integer value",
87 "Couldn't find or set field in one of a subsystem's events",
88 "Too many terms in predicate expression",
89 "Missing field name and/or value",
90 "Meaningless filter expression",
95 struct list_head list
;
101 struct list_head list
;
104 struct filter_parse_state
{
105 struct filter_op
*ops
;
106 struct list_head opstack
;
107 struct list_head postfix
;
118 char string
[MAX_FILTER_STR_VAL
];
124 DEFINE_COMPARISON_PRED(s64
);
125 DEFINE_COMPARISON_PRED(u64
);
126 DEFINE_COMPARISON_PRED(s32
);
127 DEFINE_COMPARISON_PRED(u32
);
128 DEFINE_COMPARISON_PRED(s16
);
129 DEFINE_COMPARISON_PRED(u16
);
130 DEFINE_COMPARISON_PRED(s8
);
131 DEFINE_COMPARISON_PRED(u8
);
133 DEFINE_EQUALITY_PRED(64);
134 DEFINE_EQUALITY_PRED(32);
135 DEFINE_EQUALITY_PRED(16);
136 DEFINE_EQUALITY_PRED(8);
138 static int filter_pred_and(struct filter_pred
*pred
__attribute((unused
)),
139 void *event
__attribute((unused
)),
145 static int filter_pred_or(struct filter_pred
*pred
__attribute((unused
)),
146 void *event
__attribute((unused
)),
152 /* Filter predicate for fixed sized arrays of characters */
153 static int filter_pred_string(struct filter_pred
*pred
, void *event
,
156 char *addr
= (char *)(event
+ pred
->offset
);
159 cmp
= strncmp(addr
, pred
->str_val
, pred
->str_len
);
161 match
= (!cmp
) ^ pred
->not;
167 * Filter predicate for dynamic sized arrays of characters.
168 * These are implemented through a list of strings at the end
170 * Also each of these strings have a field in the entry which
171 * contains its offset from the beginning of the entry.
172 * We have then first to get this field, dereference it
173 * and add it to the address of the entry, and at last we have
174 * the address of the string.
176 static int filter_pred_strloc(struct filter_pred
*pred
, void *event
,
179 unsigned short str_loc
= *(unsigned short *)(event
+ pred
->offset
);
180 char *addr
= (char *)(event
+ str_loc
);
183 cmp
= strncmp(addr
, pred
->str_val
, pred
->str_len
);
185 match
= (!cmp
) ^ pred
->not;
190 static int filter_pred_none(struct filter_pred
*pred
, void *event
,
196 /* return 1 if event matches, 0 otherwise (discard) */
197 int filter_match_preds(struct ftrace_event_call
*call
, void *rec
)
199 struct event_filter
*filter
= call
->filter
;
200 int match
, top
= 0, val1
= 0, val2
= 0;
201 int stack
[MAX_FILTER_PRED
];
202 struct filter_pred
*pred
;
205 for (i
= 0; i
< filter
->n_preds
; i
++) {
206 pred
= filter
->preds
[i
];
208 match
= pred
->fn(pred
, rec
, val1
, val2
);
209 stack
[top
++] = match
;
212 if (pred
->pop_n
> top
) {
218 match
= pred
->fn(pred
, rec
, val1
, val2
);
219 stack
[top
++] = match
;
224 EXPORT_SYMBOL_GPL(filter_match_preds
);
226 static void parse_error(struct filter_parse_state
*ps
, int err
, int pos
)
229 ps
->lasterr_pos
= pos
;
232 static void remove_filter_string(struct event_filter
*filter
)
234 kfree(filter
->filter_string
);
235 filter
->filter_string
= NULL
;
238 static int replace_filter_string(struct event_filter
*filter
,
241 kfree(filter
->filter_string
);
242 filter
->filter_string
= kstrdup(filter_string
, GFP_KERNEL
);
243 if (!filter
->filter_string
)
249 static int append_filter_string(struct event_filter
*filter
,
253 char *new_filter_string
;
255 BUG_ON(!filter
->filter_string
);
256 newlen
= strlen(filter
->filter_string
) + strlen(string
) + 1;
257 new_filter_string
= kmalloc(newlen
, GFP_KERNEL
);
258 if (!new_filter_string
)
261 strcpy(new_filter_string
, filter
->filter_string
);
262 strcat(new_filter_string
, string
);
263 kfree(filter
->filter_string
);
264 filter
->filter_string
= new_filter_string
;
269 static void append_filter_err(struct filter_parse_state
*ps
,
270 struct event_filter
*filter
)
272 int pos
= ps
->lasterr_pos
;
275 buf
= (char *)__get_free_page(GFP_TEMPORARY
);
279 append_filter_string(filter
, "\n");
280 memset(buf
, ' ', PAGE_SIZE
);
281 if (pos
> PAGE_SIZE
- 128)
284 pbuf
= &buf
[pos
] + 1;
286 sprintf(pbuf
, "\nparse_error: %s\n", err_text
[ps
->lasterr
]);
287 append_filter_string(filter
, buf
);
288 free_page((unsigned long) buf
);
291 void print_event_filter(struct ftrace_event_call
*call
, struct trace_seq
*s
)
293 struct event_filter
*filter
= call
->filter
;
295 mutex_lock(&event_mutex
);
296 if (filter
->filter_string
)
297 trace_seq_printf(s
, "%s\n", filter
->filter_string
);
299 trace_seq_printf(s
, "none\n");
300 mutex_unlock(&event_mutex
);
303 void print_subsystem_event_filter(struct event_subsystem
*system
,
306 struct event_filter
*filter
= system
->filter
;
308 mutex_lock(&event_mutex
);
309 if (filter
->filter_string
)
310 trace_seq_printf(s
, "%s\n", filter
->filter_string
);
312 trace_seq_printf(s
, "none\n");
313 mutex_unlock(&event_mutex
);
316 static struct ftrace_event_field
*
317 find_event_field(struct ftrace_event_call
*call
, char *name
)
319 struct ftrace_event_field
*field
;
321 list_for_each_entry(field
, &call
->fields
, link
) {
322 if (!strcmp(field
->name
, name
))
329 static void filter_free_pred(struct filter_pred
*pred
)
334 kfree(pred
->field_name
);
338 static void filter_clear_pred(struct filter_pred
*pred
)
340 kfree(pred
->field_name
);
341 pred
->field_name
= NULL
;
345 static int filter_set_pred(struct filter_pred
*dest
,
346 struct filter_pred
*src
,
350 if (src
->field_name
) {
351 dest
->field_name
= kstrdup(src
->field_name
, GFP_KERNEL
);
352 if (!dest
->field_name
)
360 static void filter_disable_preds(struct ftrace_event_call
*call
)
362 struct event_filter
*filter
= call
->filter
;
365 call
->filter_active
= 0;
368 for (i
= 0; i
< MAX_FILTER_PRED
; i
++)
369 filter
->preds
[i
]->fn
= filter_pred_none
;
372 void destroy_preds(struct ftrace_event_call
*call
)
374 struct event_filter
*filter
= call
->filter
;
377 for (i
= 0; i
< MAX_FILTER_PRED
; i
++) {
378 if (filter
->preds
[i
])
379 filter_free_pred(filter
->preds
[i
]);
381 kfree(filter
->preds
);
382 kfree(filter
->filter_string
);
387 int init_preds(struct ftrace_event_call
*call
)
389 struct event_filter
*filter
;
390 struct filter_pred
*pred
;
393 filter
= call
->filter
= kzalloc(sizeof(*filter
), GFP_KERNEL
);
397 call
->filter_active
= 0;
400 filter
->preds
= kzalloc(MAX_FILTER_PRED
* sizeof(pred
), GFP_KERNEL
);
404 for (i
= 0; i
< MAX_FILTER_PRED
; i
++) {
405 pred
= kzalloc(sizeof(*pred
), GFP_KERNEL
);
408 pred
->fn
= filter_pred_none
;
409 filter
->preds
[i
] = pred
;
419 EXPORT_SYMBOL_GPL(init_preds
);
421 static void filter_free_subsystem_preds(struct event_subsystem
*system
)
423 struct ftrace_event_call
*call
;
425 list_for_each_entry(call
, &ftrace_events
, list
) {
426 if (!call
->define_fields
)
429 if (!strcmp(call
->system
, system
->name
)) {
430 filter_disable_preds(call
);
431 remove_filter_string(call
->filter
);
436 static int filter_add_pred_fn(struct filter_parse_state
*ps
,
437 struct ftrace_event_call
*call
,
438 struct filter_pred
*pred
,
441 struct event_filter
*filter
= call
->filter
;
444 if (filter
->n_preds
== MAX_FILTER_PRED
) {
445 parse_error(ps
, FILT_ERR_TOO_MANY_PREDS
, 0);
449 idx
= filter
->n_preds
;
450 filter_clear_pred(filter
->preds
[idx
]);
451 err
= filter_set_pred(filter
->preds
[idx
], pred
, fn
);
456 call
->filter_active
= 1;
462 FILTER_STATIC_STRING
= 1,
466 static int is_string_field(const char *type
)
468 if (strstr(type
, "__data_loc") && strstr(type
, "char"))
469 return FILTER_DYN_STRING
;
471 if (strchr(type
, '[') && strstr(type
, "char"))
472 return FILTER_STATIC_STRING
;
477 static int is_legal_op(struct ftrace_event_field
*field
, int op
)
479 if (is_string_field(field
->type
) && (op
!= OP_EQ
&& op
!= OP_NE
))
485 static filter_pred_fn_t
select_comparison_fn(int op
, int field_size
,
488 filter_pred_fn_t fn
= NULL
;
490 switch (field_size
) {
492 if (op
== OP_EQ
|| op
== OP_NE
)
494 else if (field_is_signed
)
495 fn
= filter_pred_s64
;
497 fn
= filter_pred_u64
;
500 if (op
== OP_EQ
|| op
== OP_NE
)
502 else if (field_is_signed
)
503 fn
= filter_pred_s32
;
505 fn
= filter_pred_u32
;
508 if (op
== OP_EQ
|| op
== OP_NE
)
510 else if (field_is_signed
)
511 fn
= filter_pred_s16
;
513 fn
= filter_pred_u16
;
516 if (op
== OP_EQ
|| op
== OP_NE
)
518 else if (field_is_signed
)
528 static int filter_add_pred(struct filter_parse_state
*ps
,
529 struct ftrace_event_call
*call
,
530 struct filter_pred
*pred
)
532 struct ftrace_event_field
*field
;
534 unsigned long long val
;
538 pred
->fn
= filter_pred_none
;
540 if (pred
->op
== OP_AND
) {
542 return filter_add_pred_fn(ps
, call
, pred
, filter_pred_and
);
543 } else if (pred
->op
== OP_OR
) {
545 return filter_add_pred_fn(ps
, call
, pred
, filter_pred_or
);
548 field
= find_event_field(call
, pred
->field_name
);
550 parse_error(ps
, FILT_ERR_FIELD_NOT_FOUND
, 0);
554 pred
->offset
= field
->offset
;
556 if (!is_legal_op(field
, pred
->op
)) {
557 parse_error(ps
, FILT_ERR_ILLEGAL_FIELD_OP
, 0);
561 string_type
= is_string_field(field
->type
);
563 if (string_type
== FILTER_STATIC_STRING
)
564 fn
= filter_pred_string
;
566 fn
= filter_pred_strloc
;
567 pred
->str_len
= field
->size
;
568 if (pred
->op
== OP_NE
)
570 return filter_add_pred_fn(ps
, call
, pred
, fn
);
572 if (field
->is_signed
)
573 ret
= strict_strtoll(pred
->str_val
, 0, &val
);
575 ret
= strict_strtoull(pred
->str_val
, 0, &val
);
577 parse_error(ps
, FILT_ERR_ILLEGAL_INTVAL
, 0);
583 fn
= select_comparison_fn(pred
->op
, field
->size
, field
->is_signed
);
585 parse_error(ps
, FILT_ERR_INVALID_OP
, 0);
589 if (pred
->op
== OP_NE
)
592 return filter_add_pred_fn(ps
, call
, pred
, fn
);
595 static int filter_add_subsystem_pred(struct filter_parse_state
*ps
,
596 struct event_subsystem
*system
,
597 struct filter_pred
*pred
,
600 struct ftrace_event_call
*call
;
603 list_for_each_entry(call
, &ftrace_events
, list
) {
605 if (!call
->define_fields
)
608 if (strcmp(call
->system
, system
->name
))
611 err
= filter_add_pred(ps
, call
, pred
);
613 filter_free_subsystem_preds(system
);
614 parse_error(ps
, FILT_ERR_BAD_SUBSYS_FILTER
, 0);
617 replace_filter_string(call
->filter
, filter_string
);
623 static void parse_init(struct filter_parse_state
*ps
,
624 struct filter_op
*ops
,
627 memset(ps
, '\0', sizeof(*ps
));
629 ps
->infix
.string
= infix_string
;
630 ps
->infix
.cnt
= strlen(infix_string
);
633 INIT_LIST_HEAD(&ps
->opstack
);
634 INIT_LIST_HEAD(&ps
->postfix
);
637 static char infix_next(struct filter_parse_state
*ps
)
641 return ps
->infix
.string
[ps
->infix
.tail
++];
644 static char infix_peek(struct filter_parse_state
*ps
)
646 if (ps
->infix
.tail
== strlen(ps
->infix
.string
))
649 return ps
->infix
.string
[ps
->infix
.tail
];
652 static void infix_advance(struct filter_parse_state
*ps
)
658 static inline int is_precedence_lower(struct filter_parse_state
*ps
,
661 return ps
->ops
[a
].precedence
< ps
->ops
[b
].precedence
;
664 static inline int is_op_char(struct filter_parse_state
*ps
, char c
)
668 for (i
= 0; strcmp(ps
->ops
[i
].string
, "OP_NONE"); i
++) {
669 if (ps
->ops
[i
].string
[0] == c
)
676 static int infix_get_op(struct filter_parse_state
*ps
, char firstc
)
678 char nextc
= infix_peek(ps
);
686 for (i
= 0; strcmp(ps
->ops
[i
].string
, "OP_NONE"); i
++) {
687 if (!strcmp(opstr
, ps
->ops
[i
].string
)) {
689 return ps
->ops
[i
].id
;
695 for (i
= 0; strcmp(ps
->ops
[i
].string
, "OP_NONE"); i
++) {
696 if (!strcmp(opstr
, ps
->ops
[i
].string
))
697 return ps
->ops
[i
].id
;
703 static inline void clear_operand_string(struct filter_parse_state
*ps
)
705 memset(ps
->operand
.string
, '\0', MAX_FILTER_STR_VAL
);
706 ps
->operand
.tail
= 0;
709 static inline int append_operand_char(struct filter_parse_state
*ps
, char c
)
711 if (ps
->operand
.tail
== MAX_FILTER_STR_VAL
- 1)
714 ps
->operand
.string
[ps
->operand
.tail
++] = c
;
719 static int filter_opstack_push(struct filter_parse_state
*ps
, int op
)
721 struct opstack_op
*opstack_op
;
723 opstack_op
= kmalloc(sizeof(*opstack_op
), GFP_KERNEL
);
728 list_add(&opstack_op
->list
, &ps
->opstack
);
733 static int filter_opstack_empty(struct filter_parse_state
*ps
)
735 return list_empty(&ps
->opstack
);
738 static int filter_opstack_top(struct filter_parse_state
*ps
)
740 struct opstack_op
*opstack_op
;
742 if (filter_opstack_empty(ps
))
745 opstack_op
= list_first_entry(&ps
->opstack
, struct opstack_op
, list
);
747 return opstack_op
->op
;
750 static int filter_opstack_pop(struct filter_parse_state
*ps
)
752 struct opstack_op
*opstack_op
;
755 if (filter_opstack_empty(ps
))
758 opstack_op
= list_first_entry(&ps
->opstack
, struct opstack_op
, list
);
760 list_del(&opstack_op
->list
);
767 static void filter_opstack_clear(struct filter_parse_state
*ps
)
769 while (!filter_opstack_empty(ps
))
770 filter_opstack_pop(ps
);
773 static char *curr_operand(struct filter_parse_state
*ps
)
775 return ps
->operand
.string
;
778 static int postfix_append_operand(struct filter_parse_state
*ps
, char *operand
)
780 struct postfix_elt
*elt
;
782 elt
= kmalloc(sizeof(*elt
), GFP_KERNEL
);
787 elt
->operand
= kstrdup(operand
, GFP_KERNEL
);
793 list_add_tail(&elt
->list
, &ps
->postfix
);
798 static int postfix_append_op(struct filter_parse_state
*ps
, int op
)
800 struct postfix_elt
*elt
;
802 elt
= kmalloc(sizeof(*elt
), GFP_KERNEL
);
809 list_add_tail(&elt
->list
, &ps
->postfix
);
814 static void postfix_clear(struct filter_parse_state
*ps
)
816 struct postfix_elt
*elt
;
818 while (!list_empty(&ps
->postfix
)) {
819 elt
= list_first_entry(&ps
->postfix
, struct postfix_elt
, list
);
821 list_del(&elt
->list
);
825 static int filter_parse(struct filter_parse_state
*ps
)
831 while ((ch
= infix_next(ps
))) {
843 if (is_op_char(ps
, ch
)) {
844 op
= infix_get_op(ps
, ch
);
846 parse_error(ps
, FILT_ERR_INVALID_OP
, 0);
850 if (strlen(curr_operand(ps
))) {
851 postfix_append_operand(ps
, curr_operand(ps
));
852 clear_operand_string(ps
);
855 while (!filter_opstack_empty(ps
)) {
856 top_op
= filter_opstack_top(ps
);
857 if (!is_precedence_lower(ps
, top_op
, op
)) {
858 top_op
= filter_opstack_pop(ps
);
859 postfix_append_op(ps
, top_op
);
865 filter_opstack_push(ps
, op
);
870 filter_opstack_push(ps
, OP_OPEN_PAREN
);
875 if (strlen(curr_operand(ps
))) {
876 postfix_append_operand(ps
, curr_operand(ps
));
877 clear_operand_string(ps
);
880 top_op
= filter_opstack_pop(ps
);
881 while (top_op
!= OP_NONE
) {
882 if (top_op
== OP_OPEN_PAREN
)
884 postfix_append_op(ps
, top_op
);
885 top_op
= filter_opstack_pop(ps
);
887 if (top_op
== OP_NONE
) {
888 parse_error(ps
, FILT_ERR_UNBALANCED_PAREN
, 0);
894 if (append_operand_char(ps
, ch
)) {
895 parse_error(ps
, FILT_ERR_OPERAND_TOO_LONG
, 0);
900 if (strlen(curr_operand(ps
)))
901 postfix_append_operand(ps
, curr_operand(ps
));
903 while (!filter_opstack_empty(ps
)) {
904 top_op
= filter_opstack_pop(ps
);
905 if (top_op
== OP_NONE
)
907 if (top_op
== OP_OPEN_PAREN
) {
908 parse_error(ps
, FILT_ERR_UNBALANCED_PAREN
, 0);
911 postfix_append_op(ps
, top_op
);
917 static struct filter_pred
*create_pred(int op
, char *operand1
, char *operand2
)
919 struct filter_pred
*pred
;
921 pred
= kzalloc(sizeof(*pred
), GFP_KERNEL
);
925 pred
->field_name
= kstrdup(operand1
, GFP_KERNEL
);
926 if (!pred
->field_name
) {
931 strcpy(pred
->str_val
, operand2
);
932 pred
->str_len
= strlen(operand2
);
939 static struct filter_pred
*create_logical_pred(int op
)
941 struct filter_pred
*pred
;
943 pred
= kzalloc(sizeof(*pred
), GFP_KERNEL
);
952 static int check_preds(struct filter_parse_state
*ps
)
954 int n_normal_preds
= 0, n_logical_preds
= 0;
955 struct postfix_elt
*elt
;
957 list_for_each_entry(elt
, &ps
->postfix
, list
) {
958 if (elt
->op
== OP_NONE
)
961 if (elt
->op
== OP_AND
|| elt
->op
== OP_OR
) {
968 if (!n_normal_preds
|| n_logical_preds
>= n_normal_preds
) {
969 parse_error(ps
, FILT_ERR_INVALID_FILTER
, 0);
976 static int replace_preds(struct event_subsystem
*system
,
977 struct ftrace_event_call
*call
,
978 struct filter_parse_state
*ps
,
981 char *operand1
= NULL
, *operand2
= NULL
;
982 struct filter_pred
*pred
;
983 struct postfix_elt
*elt
;
986 err
= check_preds(ps
);
990 list_for_each_entry(elt
, &ps
->postfix
, list
) {
991 if (elt
->op
== OP_NONE
) {
993 operand1
= elt
->operand
;
995 operand2
= elt
->operand
;
997 parse_error(ps
, FILT_ERR_TOO_MANY_OPERANDS
, 0);
1003 if (elt
->op
== OP_AND
|| elt
->op
== OP_OR
) {
1004 pred
= create_logical_pred(elt
->op
);
1006 err
= filter_add_pred(ps
, call
, pred
);
1008 err
= filter_add_subsystem_pred(ps
, system
,
1009 pred
, filter_string
);
1010 filter_free_pred(pred
);
1014 operand1
= operand2
= NULL
;
1018 if (!operand1
|| !operand2
) {
1019 parse_error(ps
, FILT_ERR_MISSING_FIELD
, 0);
1023 pred
= create_pred(elt
->op
, operand1
, operand2
);
1025 err
= filter_add_pred(ps
, call
, pred
);
1027 err
= filter_add_subsystem_pred(ps
, system
, pred
,
1029 filter_free_pred(pred
);
1033 operand1
= operand2
= NULL
;
1039 int apply_event_filter(struct ftrace_event_call
*call
, char *filter_string
)
1043 struct filter_parse_state
*ps
;
1045 mutex_lock(&event_mutex
);
1047 if (!strcmp(strstrip(filter_string
), "0")) {
1048 filter_disable_preds(call
);
1049 remove_filter_string(call
->filter
);
1050 mutex_unlock(&event_mutex
);
1055 ps
= kzalloc(sizeof(*ps
), GFP_KERNEL
);
1059 filter_disable_preds(call
);
1060 replace_filter_string(call
->filter
, filter_string
);
1062 parse_init(ps
, filter_ops
, filter_string
);
1063 err
= filter_parse(ps
);
1065 append_filter_err(ps
, call
->filter
);
1069 err
= replace_preds(NULL
, call
, ps
, filter_string
);
1071 append_filter_err(ps
, call
->filter
);
1074 filter_opstack_clear(ps
);
1078 mutex_unlock(&event_mutex
);
1083 int apply_subsystem_event_filter(struct event_subsystem
*system
,
1084 char *filter_string
)
1088 struct filter_parse_state
*ps
;
1090 mutex_lock(&event_mutex
);
1092 if (!strcmp(strstrip(filter_string
), "0")) {
1093 filter_free_subsystem_preds(system
);
1094 remove_filter_string(system
->filter
);
1095 mutex_unlock(&event_mutex
);
1100 ps
= kzalloc(sizeof(*ps
), GFP_KERNEL
);
1104 filter_free_subsystem_preds(system
);
1105 replace_filter_string(system
->filter
, filter_string
);
1107 parse_init(ps
, filter_ops
, filter_string
);
1108 err
= filter_parse(ps
);
1110 append_filter_err(ps
, system
->filter
);
1114 err
= replace_preds(system
, NULL
, ps
, filter_string
);
1116 append_filter_err(ps
, system
->filter
);
1119 filter_opstack_clear(ps
);
1123 mutex_unlock(&event_mutex
);