Skip to content

Commit

Permalink
tracing/filter: Simplify tracepoint event lookup
Browse files Browse the repository at this point in the history
We dont need to perform lookup through the ftrace_events list,
instead we can use the 'tp_event' field.

Each perf_event contains tracepoint event field 'tp_event', which
got initialized during the tracepoint event initialization.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1313072754-4620-5-git-send-email-jolsa@redhat.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Jiri Olsa authored and Steven Rostedt committed Aug 19, 2011
1 parent 61aaef5 commit 3f78f93
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1894,17 +1894,14 @@ int ftrace_profile_set_filter(struct perf_event *event, int event_id,
int err;
struct event_filter *filter;
struct filter_parse_state *ps;
struct ftrace_event_call *call = NULL;
struct ftrace_event_call *call;

mutex_lock(&event_mutex);

list_for_each_entry(call, &ftrace_events, list) {
if (call->event.type == event_id)
break;
}
call = event->tp_event;

err = -EINVAL;
if (&call->list == &ftrace_events)
if (!call)
goto out_unlock;

err = -EEXIST;
Expand Down

0 comments on commit 3f78f93

Please sign in to comment.