Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169512
b: refs/heads/master
c: a66abe7
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Oct 15, 2009
1 parent f5839fd commit 9d9bf60
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c171b552a7d316c7e1c3ad6f70a30178dd53e14c
refs/heads/master: a66abe7fbf7805a1a02f241bd5283265ff6706ec
26 changes: 15 additions & 11 deletions trunk/kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,10 +1230,10 @@ static int replace_system_preds(struct event_subsystem *system,
struct filter_parse_state *ps,
char *filter_string)
{
struct event_filter *filter = system->filter;
struct ftrace_event_call *call;
struct event_filter *filter;
int err;
bool fail = true;
int err;

list_for_each_entry(call, &ftrace_events, list) {

Expand Down Expand Up @@ -1262,7 +1262,7 @@ static int replace_system_preds(struct event_subsystem *system,

if (fail) {
parse_error(ps, FILT_ERR_BAD_SUBSYS_FILTER, 0);
return err;
return -EINVAL;
}
return 0;
}
Expand All @@ -1281,8 +1281,7 @@ int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
if (!strcmp(strstrip(filter_string), "0")) {
filter_disable_preds(call);
remove_filter_string(call->filter);
mutex_unlock(&event_mutex);
return 0;
goto out_unlock;
}

err = -ENOMEM;
Expand Down Expand Up @@ -1330,8 +1329,7 @@ int apply_subsystem_event_filter(struct event_subsystem *system,
if (!strcmp(strstrip(filter_string), "0")) {
filter_free_subsystem_preds(system);
remove_filter_string(system->filter);
mutex_unlock(&event_mutex);
return 0;
goto out_unlock;
}

err = -ENOMEM;
Expand Down Expand Up @@ -1386,15 +1384,20 @@ int ftrace_profile_set_filter(struct perf_event *event, int event_id,
if (call->id == event_id)
break;
}

err = -EINVAL;
if (!call)
return -EINVAL;
goto out_unlock;

err = -EEXIST;
if (event->filter)
return -EEXIST;
goto out_unlock;

filter = __alloc_preds();
if (IS_ERR(filter))
return PTR_ERR(filter);
if (IS_ERR(filter)) {
err = PTR_ERR(filter);
goto out_unlock;
}

err = -ENOMEM;
ps = kzalloc(sizeof(*ps), GFP_KERNEL);
Expand All @@ -1419,6 +1422,7 @@ int ftrace_profile_set_filter(struct perf_event *event, int event_id,
if (err)
__free_preds(filter);

out_unlock:
mutex_unlock(&event_mutex);

return err;
Expand Down

0 comments on commit 9d9bf60

Please sign in to comment.