aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2013-05-09 01:44:36 -0400
committerSteven Rostedt <rostedt@goodmis.org>2013-05-09 20:18:44 -0400
commit48182bd2261766b810e4e4269a23236c1ace63fb (patch)
treedabbc38dbf312f99abc1288d8a92d37fea4260e9 /kernel
parentdb02038f4e6a776fd3a0bb71242be37ff378ce86 (diff)
tracing/kprobes: Increment probe hit-count even if it is used by perf
Increment probe hit-count for profiling even if it is used by perf tool. Same thing has already done in trace_uprobe. Link: http://lkml.kernel.org/r/20130509054436.30398.21133.stgit@mhiramat-M0-7522 Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Tom Zanussi <tom.zanussi@intel.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_kprobe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 0b7386a54b1e..6e86fbbae337 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -733,8 +733,6 @@ static __kprobes void kprobe_trace_func(struct kprobe *kp, struct pt_regs *regs)
733 unsigned long irq_flags; 733 unsigned long irq_flags;
734 struct ftrace_event_call *call = &tp->call; 734 struct ftrace_event_call *call = &tp->call;
735 735
736 tp->nhit++;
737
738 local_save_flags(irq_flags); 736 local_save_flags(irq_flags);
739 pc = preempt_count(); 737 pc = preempt_count();
740 738
@@ -767,8 +765,6 @@ static __kprobes void kretprobe_trace_func(struct kretprobe_instance *ri,
767 unsigned long irq_flags; 765 unsigned long irq_flags;
768 struct ftrace_event_call *call = &tp->call; 766 struct ftrace_event_call *call = &tp->call;
769 767
770 tp->nhit++;
771
772 local_save_flags(irq_flags); 768 local_save_flags(irq_flags);
773 pc = preempt_count(); 769 pc = preempt_count();
774 770
@@ -1075,6 +1071,8 @@ int kprobe_dispatcher(struct kprobe *kp, struct pt_regs *regs)
1075{ 1071{
1076 struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp); 1072 struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp);
1077 1073
1074 tp->nhit++;
1075
1078 if (tp->flags & TP_FLAG_TRACE) 1076 if (tp->flags & TP_FLAG_TRACE)
1079 kprobe_trace_func(kp, regs); 1077 kprobe_trace_func(kp, regs);
1080#ifdef CONFIG_PERF_EVENTS 1078#ifdef CONFIG_PERF_EVENTS
@@ -1089,6 +1087,8 @@ int kretprobe_dispatcher(struct kretprobe_instance *ri, struct pt_regs *regs)
1089{ 1087{
1090 struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp); 1088 struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp);
1091 1089
1090 tp->nhit++;
1091
1092 if (tp->flags & TP_FLAG_TRACE) 1092 if (tp->flags & TP_FLAG_TRACE)
1093 kretprobe_trace_func(ri, regs); 1093 kretprobe_trace_func(ri, regs);
1094#ifdef CONFIG_PERF_EVENTS 1094#ifdef CONFIG_PERF_EVENTS