diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-02-15 09:51:49 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-02-21 11:08:24 -0500 |
commit | ceec0b6fc7cd43b38a40c2d40223f9cd0616f0cd (patch) | |
tree | 31e7deb76a5827883251dc578300bdc35ef62538 /kernel/trace/trace_events.c | |
parent | e248491ac283b516958ca9ab62c8e74b6718bca8 (diff) |
ftrace, perf: Add open/close tracepoint perf registration actions
Adding TRACE_REG_PERF_OPEN and TRACE_REG_PERF_CLOSE to differentiate
register/unregister from open/close actions.
The register/unregister actions are invoked for the first/last
tracepoint user when opening/closing the event.
The open/close actions are invoked for each tracepoint user when
opening/closing the event.
Link: http://lkml.kernel.org/r/1329317514-8131-3-git-send-email-jolsa@redhat.com
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r-- | kernel/trace/trace_events.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index c212a7f934ec..5138fea37908 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -147,7 +147,8 @@ int trace_event_raw_init(struct ftrace_event_call *call) | |||
147 | } | 147 | } |
148 | EXPORT_SYMBOL_GPL(trace_event_raw_init); | 148 | EXPORT_SYMBOL_GPL(trace_event_raw_init); |
149 | 149 | ||
150 | int ftrace_event_reg(struct ftrace_event_call *call, enum trace_reg type) | 150 | int ftrace_event_reg(struct ftrace_event_call *call, |
151 | enum trace_reg type, void *data) | ||
151 | { | 152 | { |
152 | switch (type) { | 153 | switch (type) { |
153 | case TRACE_REG_REGISTER: | 154 | case TRACE_REG_REGISTER: |
@@ -170,6 +171,9 @@ int ftrace_event_reg(struct ftrace_event_call *call, enum trace_reg type) | |||
170 | call->class->perf_probe, | 171 | call->class->perf_probe, |
171 | call); | 172 | call); |
172 | return 0; | 173 | return 0; |
174 | case TRACE_REG_PERF_OPEN: | ||
175 | case TRACE_REG_PERF_CLOSE: | ||
176 | return 0; | ||
173 | #endif | 177 | #endif |
174 | } | 178 | } |
175 | return 0; | 179 | return 0; |
@@ -209,7 +213,7 @@ static int ftrace_event_enable_disable(struct ftrace_event_call *call, | |||
209 | tracing_stop_cmdline_record(); | 213 | tracing_stop_cmdline_record(); |
210 | call->flags &= ~TRACE_EVENT_FL_RECORDED_CMD; | 214 | call->flags &= ~TRACE_EVENT_FL_RECORDED_CMD; |
211 | } | 215 | } |
212 | call->class->reg(call, TRACE_REG_UNREGISTER); | 216 | call->class->reg(call, TRACE_REG_UNREGISTER, NULL); |
213 | } | 217 | } |
214 | break; | 218 | break; |
215 | case 1: | 219 | case 1: |
@@ -218,7 +222,7 @@ static int ftrace_event_enable_disable(struct ftrace_event_call *call, | |||
218 | tracing_start_cmdline_record(); | 222 | tracing_start_cmdline_record(); |
219 | call->flags |= TRACE_EVENT_FL_RECORDED_CMD; | 223 | call->flags |= TRACE_EVENT_FL_RECORDED_CMD; |
220 | } | 224 | } |
221 | ret = call->class->reg(call, TRACE_REG_REGISTER); | 225 | ret = call->class->reg(call, TRACE_REG_REGISTER, NULL); |
222 | if (ret) { | 226 | if (ret) { |
223 | tracing_stop_cmdline_record(); | 227 | tracing_stop_cmdline_record(); |
224 | pr_info("event trace: Could not enable event " | 228 | pr_info("event trace: Could not enable event " |