uprobes/perf: Always increment trace_uprobe->nhit
authorOleg Nesterov <oleg@redhat.com>
Thu, 31 Jan 2013 18:55:27 +0000 (19:55 +0100)
committerOleg Nesterov <oleg@redhat.com>
Fri, 8 Feb 2013 17:24:34 +0000 (18:24 +0100)
Move tu->nhit++ from uprobe_trace_func() to uprobe_dispatcher().

->nhit counts how many time we hit the breakpoint inserted by this
uprobe, we do not want to loose this info if uprobe was enabled by
sys_perf_event_open().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
kernel/trace/trace_uprobe.c

index 9c8babbfd11bed96845071ed9b3cc4b649dc57de..c4e29e19fdd7d155f5c20090fff7d2e8704b2e58 100644 (file)
@@ -476,8 +476,6 @@ static void uprobe_trace_func(struct trace_uprobe *tu, struct pt_regs *regs)
        unsigned long irq_flags;
        struct ftrace_event_call *call = &tu->call;
 
-       tu->nhit++;
-
        local_save_flags(irq_flags);
        pc = preempt_count();
 
@@ -701,6 +699,7 @@ static int uprobe_dispatcher(struct uprobe_consumer *con, struct pt_regs *regs)
        struct trace_uprobe *tu;
 
        tu = container_of(con, struct trace_uprobe, consumer);
+       tu->nhit++;
 
        if (tu->flags & TP_FLAG_TRACE)
                uprobe_trace_func(tu, regs);
This page took 0.02616 seconds and 5 git commands to generate.