static void filter_free_subsystem_preds(struct event_subsystem *system)
{
- struct event_filter *filter = system->filter;
struct ftrace_event_call *call;
- int i;
-
- if (filter->n_preds) {
- for (i = 0; i < filter->n_preds; i++)
- filter_free_pred(filter->preds[i]);
- kfree(filter->preds);
- filter->preds = NULL;
- filter->n_preds = 0;
- }
list_for_each_entry(call, &ftrace_events, list) {
if (!call->define_fields)
struct filter_pred *pred,
char *filter_string)
{
- struct event_filter *filter = system->filter;
struct ftrace_event_call *call;
int err = 0;
- if (!filter->preds) {
- filter->preds = kzalloc(MAX_FILTER_PRED * sizeof(pred),
- GFP_KERNEL);
-
- if (!filter->preds)
- return -ENOMEM;
- }
-
- if (filter->n_preds == MAX_FILTER_PRED) {
- parse_error(ps, FILT_ERR_TOO_MANY_PREDS, 0);
- return -ENOSPC;
- }
-
- filter->preds[filter->n_preds] = pred;
- filter->n_preds++;
-
list_for_each_entry(call, &ftrace_events, list) {
if (!call->define_fields)
if (elt->op == OP_AND || elt->op == OP_OR) {
pred = create_logical_pred(elt->op);
- if (call) {
+ if (call)
err = filter_add_pred(ps, call, pred);
- filter_free_pred(pred);
- } else
+ else
err = filter_add_subsystem_pred(ps, system,
pred, filter_string);
+ filter_free_pred(pred);
if (err)
return err;
}
pred = create_pred(elt->op, operand1, operand2);
- if (call) {
+ if (call)
err = filter_add_pred(ps, call, pred);
- filter_free_pred(pred);
- } else
+ else
err = filter_add_subsystem_pred(ps, system, pred,
filter_string);
+ filter_free_pred(pred);
if (err)
return err;