diff options
Diffstat (limited to 'kernel/trace/trace_event_perf.c')
-rw-r--r-- | kernel/trace/trace_event_perf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c index f3bbcd1c90c8..39c059ca670e 100644 --- a/kernel/trace/trace_event_perf.c +++ b/kernel/trace/trace_event_perf.c | |||
@@ -101,7 +101,7 @@ int perf_trace_init(struct perf_event *p_event) | |||
101 | return ret; | 101 | return ret; |
102 | } | 102 | } |
103 | 103 | ||
104 | int perf_trace_enable(struct perf_event *p_event) | 104 | int perf_trace_add(struct perf_event *p_event, int flags) |
105 | { | 105 | { |
106 | struct ftrace_event_call *tp_event = p_event->tp_event; | 106 | struct ftrace_event_call *tp_event = p_event->tp_event; |
107 | struct hlist_head __percpu *pcpu_list; | 107 | struct hlist_head __percpu *pcpu_list; |
@@ -111,13 +111,16 @@ int perf_trace_enable(struct perf_event *p_event) | |||
111 | if (WARN_ON_ONCE(!pcpu_list)) | 111 | if (WARN_ON_ONCE(!pcpu_list)) |
112 | return -EINVAL; | 112 | return -EINVAL; |
113 | 113 | ||
114 | if (!(flags & PERF_EF_START)) | ||
115 | p_event->hw.state = PERF_HES_STOPPED; | ||
116 | |||
114 | list = this_cpu_ptr(pcpu_list); | 117 | list = this_cpu_ptr(pcpu_list); |
115 | hlist_add_head_rcu(&p_event->hlist_entry, list); | 118 | hlist_add_head_rcu(&p_event->hlist_entry, list); |
116 | 119 | ||
117 | return 0; | 120 | return 0; |
118 | } | 121 | } |
119 | 122 | ||
120 | void perf_trace_disable(struct perf_event *p_event) | 123 | void perf_trace_del(struct perf_event *p_event, int flags) |
121 | { | 124 | { |
122 | hlist_del_rcu(&p_event->hlist_entry); | 125 | hlist_del_rcu(&p_event->hlist_entry); |
123 | } | 126 | } |