Skip to content

Commit af78ced

Browse files
sandeepspctmarinas
authored andcommitted
kprobes: Add arm64 case in kprobe example module
Add info prints in sample kprobe handlers for ARM64 Signed-off-by: Sandeepa Prabhu <sandeepa.s.prabhu@gmail.com> Signed-off-by: David A. Long <dave.long@linaro.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent fcfd708 commit af78ced

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎samples/kprobes/kprobe_example.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ static int handler_pre(struct kprobe *p, struct pt_regs *regs)
4646
" ex1 = 0x%lx\n",
4747
p->symbol_name, p->addr, regs->pc, regs->ex1);
4848
#endif
49+
#ifdef CONFIG_ARM64
50+
pr_info("<%s> pre_handler: p->addr = 0x%p, pc = 0x%lx,"
51+
" pstate = 0x%lx\n",
52+
p->symbol_name, p->addr, (long)regs->pc, (long)regs->pstate);
53+
#endif
4954

5055
/* A dump_stack() here will give a stack backtrace */
5156
return 0;
@@ -71,6 +76,10 @@ static void handler_post(struct kprobe *p, struct pt_regs *regs,
7176
printk(KERN_INFO "<%s> post_handler: p->addr = 0x%p, ex1 = 0x%lx\n",
7277
p->symbol_name, p->addr, regs->ex1);
7378
#endif
79+
#ifdef CONFIG_ARM64
80+
pr_info("<%s> post_handler: p->addr = 0x%p, pstate = 0x%lx\n",
81+
p->symbol_name, p->addr, (long)regs->pstate);
82+
#endif
7483
}
7584

7685
/*

0 commit comments

Comments
 (0)