ftrace: Fix perf-tracepoint OOPS
[deliverable/linux.git] / 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 int ret = -EINVAL;
14
15 mutex_lock(&event_mutex);
16 list_for_each_entry(event, &ftrace_events, list) {
17 if (event->id == event_id && event->profile_enable) {
18 ret = event->profile_enable(event);
19 break;
20 }
21 }
22 mutex_unlock(&event_mutex);
23
24 return ret;
25 }
26
27 void ftrace_profile_disable(int event_id)
28 {
29 struct ftrace_event_call *event;
30
31 mutex_lock(&event_mutex);
32 list_for_each_entry(event, &ftrace_events, list) {
33 if (event->id == event_id) {
34 event->profile_disable(event);
35 break;
36 }
37 }
38 mutex_unlock(&event_mutex);
39 }
This page took 0.033803 seconds and 5 git commands to generate.