diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-02-15 09:51:50 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2012-02-21 11:08:25 -0500 |
commit | 489c75c3b333dfda4c8d2b7ad1b00e5da024bfa7 (patch) | |
tree | beb0b36b48dfbbe389ea14e36be75b4837ad0cf1 /kernel/trace | |
parent | ceec0b6fc7cd43b38a40c2d40223f9cd0616f0cd (diff) |
ftrace, perf: Add add/del tracepoint perf registration actions
Adding TRACE_REG_PERF_ADD and TRACE_REG_PERF_DEL to handle
perf event schedule in/out actions.
The add action is invoked for when the perf event is scheduled in,
while the del action is invoked when the event is scheduled out.
Link: http://lkml.kernel.org/r/1329317514-8131-4-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')
-rw-r--r-- | kernel/trace/trace_event_perf.c | 4 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace_kprobe.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 4 |
4 files changed, 11 insertions, 1 deletions
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c index 0cfcc37f63de..d72af0b03822 100644 --- a/kernel/trace/trace_event_perf.c +++ b/kernel/trace/trace_event_perf.c | |||
@@ -211,12 +211,14 @@ int perf_trace_add(struct perf_event *p_event, int flags) | |||
211 | list = this_cpu_ptr(pcpu_list); | 211 | list = this_cpu_ptr(pcpu_list); |
212 | hlist_add_head_rcu(&p_event->hlist_entry, list); | 212 | hlist_add_head_rcu(&p_event->hlist_entry, list); |
213 | 213 | ||
214 | return 0; | 214 | return tp_event->class->reg(tp_event, TRACE_REG_PERF_ADD, p_event); |
215 | } | 215 | } |
216 | 216 | ||
217 | void perf_trace_del(struct perf_event *p_event, int flags) | 217 | void perf_trace_del(struct perf_event *p_event, int flags) |
218 | { | 218 | { |
219 | struct ftrace_event_call *tp_event = p_event->tp_event; | ||
219 | hlist_del_rcu(&p_event->hlist_entry); | 220 | hlist_del_rcu(&p_event->hlist_entry); |
221 | tp_event->class->reg(tp_event, TRACE_REG_PERF_DEL, p_event); | ||
220 | } | 222 | } |
221 | 223 | ||
222 | __kprobes void *perf_trace_buf_prepare(int size, unsigned short type, | 224 | __kprobes void *perf_trace_buf_prepare(int size, unsigned short type, |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 5138fea37908..079a93ae8a9d 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -173,6 +173,8 @@ int ftrace_event_reg(struct ftrace_event_call *call, | |||
173 | return 0; | 173 | return 0; |
174 | case TRACE_REG_PERF_OPEN: | 174 | case TRACE_REG_PERF_OPEN: |
175 | case TRACE_REG_PERF_CLOSE: | 175 | case TRACE_REG_PERF_CLOSE: |
176 | case TRACE_REG_PERF_ADD: | ||
177 | case TRACE_REG_PERF_DEL: | ||
176 | return 0; | 178 | return 0; |
177 | #endif | 179 | #endif |
178 | } | 180 | } |
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 5667f8958cc9..580a05ec926b 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -1912,6 +1912,8 @@ int kprobe_register(struct ftrace_event_call *event, | |||
1912 | return 0; | 1912 | return 0; |
1913 | case TRACE_REG_PERF_OPEN: | 1913 | case TRACE_REG_PERF_OPEN: |
1914 | case TRACE_REG_PERF_CLOSE: | 1914 | case TRACE_REG_PERF_CLOSE: |
1915 | case TRACE_REG_PERF_ADD: | ||
1916 | case TRACE_REG_PERF_DEL: | ||
1915 | return 0; | 1917 | return 0; |
1916 | #endif | 1918 | #endif |
1917 | } | 1919 | } |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index e23515f51ed4..96fc73369099 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -666,6 +666,8 @@ static int syscall_enter_register(struct ftrace_event_call *event, | |||
666 | return 0; | 666 | return 0; |
667 | case TRACE_REG_PERF_OPEN: | 667 | case TRACE_REG_PERF_OPEN: |
668 | case TRACE_REG_PERF_CLOSE: | 668 | case TRACE_REG_PERF_CLOSE: |
669 | case TRACE_REG_PERF_ADD: | ||
670 | case TRACE_REG_PERF_DEL: | ||
669 | return 0; | 671 | return 0; |
670 | #endif | 672 | #endif |
671 | } | 673 | } |
@@ -690,6 +692,8 @@ static int syscall_exit_register(struct ftrace_event_call *event, | |||
690 | return 0; | 692 | return 0; |
691 | case TRACE_REG_PERF_OPEN: | 693 | case TRACE_REG_PERF_OPEN: |
692 | case TRACE_REG_PERF_CLOSE: | 694 | case TRACE_REG_PERF_CLOSE: |
695 | case TRACE_REG_PERF_ADD: | ||
696 | case TRACE_REG_PERF_DEL: | ||
693 | return 0; | 697 | return 0; |
694 | #endif | 698 | #endif |
695 | } | 699 | } |