close_port, kpacket_gen kmalloc oom, formard.c wake_sender/skb receive oom handling...
[cor_2_6_31.git] / kernel / trace / trace_event_profile.c
blob5b5895afecfe425f5c917af29b13d29ff4acf918
1 /*
2 * trace event based perf counter profiling
4 * Copyright (C) 2009 Red Hat Inc, Peter Zijlstra <pzijlstr@redhat.com>
6 */
8 #include "trace.h"
10 int ftrace_profile_enable(int event_id)
12 struct ftrace_event_call *event;
13 int ret = -EINVAL;
15 mutex_lock(&event_mutex);
16 list_for_each_entry(event, &ftrace_events, list) {
17 if (event->id == event_id) {
18 ret = event->profile_enable(event);
19 break;
22 mutex_unlock(&event_mutex);
24 return ret;
27 void ftrace_profile_disable(int event_id)
29 struct ftrace_event_call *event;
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;
38 mutex_unlock(&event_mutex);