Skip to content

Commit

Permalink
uprobes/perf: Always increment trace_uprobe->nhit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oleg Nesterov committed Feb 8, 2013
1 parent a932b73 commit 1b47aef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/trace/trace_uprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1b47aef

Please sign in to comment.