diff options
Diffstat (limited to 'kernel/trace/trace_event_profile.c')
-rw-r--r-- | kernel/trace/trace_event_profile.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/kernel/trace/trace_event_profile.c b/kernel/trace/trace_event_profile.c index 22cba9970776..5b5895afecfe 100644 --- a/kernel/trace/trace_event_profile.c +++ b/kernel/trace/trace_event_profile.c | |||
@@ -10,22 +10,30 @@ | |||
10 | int ftrace_profile_enable(int event_id) | 10 | int ftrace_profile_enable(int event_id) |
11 | { | 11 | { |
12 | struct ftrace_event_call *event; | 12 | struct ftrace_event_call *event; |
13 | int ret = -EINVAL; | ||
13 | 14 | ||
14 | for_each_event(event) { | 15 | mutex_lock(&event_mutex); |
15 | if (event->id == event_id) | 16 | list_for_each_entry(event, &ftrace_events, list) { |
16 | return event->profile_enable(event); | 17 | if (event->id == event_id) { |
18 | ret = event->profile_enable(event); | ||
19 | break; | ||
20 | } | ||
17 | } | 21 | } |
22 | mutex_unlock(&event_mutex); | ||
18 | 23 | ||
19 | return -EINVAL; | 24 | return ret; |
20 | } | 25 | } |
21 | 26 | ||
22 | void ftrace_profile_disable(int event_id) | 27 | void ftrace_profile_disable(int event_id) |
23 | { | 28 | { |
24 | struct ftrace_event_call *event; | 29 | struct ftrace_event_call *event; |
25 | 30 | ||
26 | for_each_event(event) { | 31 | mutex_lock(&event_mutex); |
27 | if (event->id == event_id) | 32 | list_for_each_entry(event, &ftrace_events, list) { |
28 | return event->profile_disable(event); | 33 | if (event->id == event_id) { |
34 | event->profile_disable(event); | ||
35 | break; | ||
36 | } | ||
29 | } | 37 | } |
38 | mutex_unlock(&event_mutex); | ||
30 | } | 39 | } |
31 | |||