Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323820
b: refs/heads/master
c: 4b036d5
h: refs/heads/master
v: v3
  • Loading branch information
Masami Hiramatsu authored and Steven Rostedt committed Sep 14, 2012
1 parent 312cdf4 commit facbe2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a5e37863ab31d78faddff15675c89979792bc0bd
refs/heads/master: 4b036d54bf849a75d0103b33d92a53f89ecb9315
9 changes: 6 additions & 3 deletions trunk/arch/x86/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,21 +1072,24 @@ void __kprobes kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
if (kprobe_running()) {
kprobes_inc_nmissed_count(p);
} else {
regs->ip += sizeof(kprobe_opcode_t);
/* Kprobe handler expects regs->ip = ip + 1 as breakpoint hit */
regs->ip = ip + sizeof(kprobe_opcode_t);

__this_cpu_write(current_kprobe, p);
kcb->kprobe_status = KPROBE_HIT_ACTIVE;
if (p->pre_handler)
p->pre_handler(p, regs);

if (unlikely(p->post_handler)) {
/* Emulate singlestep as if there is a 5byte nop */
/*
* Emulate singlestep (and also recover regs->ip)
* as if there is a 5byte nop
*/
regs->ip = ip + MCOUNT_INSN_SIZE;
kcb->kprobe_status = KPROBE_HIT_SSDONE;
p->post_handler(p, regs, 0);
}
__this_cpu_write(current_kprobe, NULL);
regs->ip = ip; /* Recover for next callback */
}
end:
local_irq_restore(flags);
Expand Down

0 comments on commit facbe2c

Please sign in to comment.