tracing/filters: a better event parser
[linux-2.6] / kernel / trace / trace_event_profile.c
1 /*
2  * trace event based perf counter profiling
3  *
4  * Copyright (C) 2009 Red Hat Inc, Peter Zijlstra <pzijlstr@redhat.com>
5  *
6  */
7
8 #include "trace.h"
9
10 int ftrace_profile_enable(int event_id)
11 {
12         struct ftrace_event_call *event;
13
14         list_for_each_entry(event, &ftrace_events, list) {
15                 if (event->id == event_id)
16                         return event->profile_enable(event);
17         }
18
19         return -EINVAL;
20 }
21
22 void ftrace_profile_disable(int event_id)
23 {
24         struct ftrace_event_call *event;
25
26         list_for_each_entry(event, &ftrace_events, list) {
27                 if (event->id == event_id)
28                         return event->profile_disable(event);
29         }
30 }