|
4 | 4 |
|
5 | 5 | /* Ftrace callback handler for kprobes -- called under preepmt disabed */
|
6 | 6 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
|
7 |
| - struct ftrace_ops *ops, struct ftrace_regs *regs) |
| 7 | + struct ftrace_ops *ops, struct ftrace_regs *fregs) |
8 | 8 | {
|
9 | 9 | struct kprobe *p;
|
| 10 | + struct pt_regs *regs; |
10 | 11 | struct kprobe_ctlblk *kcb;
|
11 | 12 |
|
12 | 13 | p = get_kprobe((kprobe_opcode_t *)ip);
|
13 | 14 | if (unlikely(!p) || kprobe_disabled(p))
|
14 | 15 | return;
|
15 | 16 |
|
| 17 | + regs = ftrace_get_regs(fregs); |
16 | 18 | kcb = get_kprobe_ctlblk();
|
17 | 19 | if (kprobe_running()) {
|
18 | 20 | kprobes_inc_nmissed_count(p);
|
19 | 21 | } else {
|
20 |
| - unsigned long orig_ip = instruction_pointer(&(regs->regs)); |
| 22 | + unsigned long orig_ip = instruction_pointer(regs); |
21 | 23 |
|
22 |
| - instruction_pointer_set(&(regs->regs), ip); |
| 24 | + instruction_pointer_set(regs, ip); |
23 | 25 |
|
24 | 26 | __this_cpu_write(current_kprobe, p);
|
25 | 27 | kcb->kprobe_status = KPROBE_HIT_ACTIVE;
|
26 |
| - if (!p->pre_handler || !p->pre_handler(p, &(regs->regs))) { |
| 28 | + if (!p->pre_handler || !p->pre_handler(p, regs)) { |
27 | 29 | /*
|
28 | 30 | * Emulate singlestep (and also recover regs->pc)
|
29 | 31 | * as if there is a nop
|
30 | 32 | */
|
31 |
| - instruction_pointer_set(&(regs->regs), |
| 33 | + instruction_pointer_set(regs, |
32 | 34 | (unsigned long)p->addr + MCOUNT_INSN_SIZE);
|
33 | 35 | if (unlikely(p->post_handler)) {
|
34 | 36 | kcb->kprobe_status = KPROBE_HIT_SSDONE;
|
35 |
| - p->post_handler(p, &(regs->regs), 0); |
| 37 | + p->post_handler(p, regs, 0); |
36 | 38 | }
|
37 |
| - instruction_pointer_set(&(regs->regs), orig_ip); |
| 39 | + instruction_pointer_set(regs, orig_ip); |
38 | 40 | }
|
39 | 41 |
|
40 | 42 | /*
|
|
0 commit comments