diff options
author | Marc Koderer <marc@koderer.com> | 2021-01-12 16:40:54 +0100 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2021-01-18 13:24:18 -0700 |
commit | 6970613b4c6a86501c1faa5a86dafa40e97b794e (patch) | |
tree | 0dbff7f1340c9a21fa43fe82f88a39f1770fc631 /samples | |
parent | f0ea149eee6bce70f7c55ebf8bca93a0b02bfbd0 (diff) |
samples/kprobes: Add ARM support
Plenty of architectures are already supported and this adds ARM
support.
Signed-off-by: Marc Koderer <marc@koderer.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/20210112154054.17138-1-marc@koderer.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/kprobes/kprobe_example.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/samples/kprobes/kprobe_example.c b/samples/kprobes/kprobe_example.c index 192aa68db0c0..331dcf151532 100644 --- a/samples/kprobes/kprobe_example.c +++ b/samples/kprobes/kprobe_example.c @@ -43,6 +43,10 @@ static int __kprobes handler_pre(struct kprobe *p, struct pt_regs *regs) " pstate = 0x%lx\n", p->symbol_name, p->addr, (long)regs->pc, (long)regs->pstate); #endif +#ifdef CONFIG_ARM + pr_info("<%s> pre_handler: p->addr = 0x%p, pc = 0x%lx, cpsr = 0x%lx\n", + p->symbol_name, p->addr, (long)regs->ARM_pc, (long)regs->ARM_cpsr); +#endif #ifdef CONFIG_S390 pr_info("<%s> pre_handler: p->addr, 0x%p, ip = 0x%lx, flags = 0x%lx\n", p->symbol_name, p->addr, regs->psw.addr, regs->flags); @@ -72,6 +76,10 @@ static void __kprobes handler_post(struct kprobe *p, struct pt_regs *regs, pr_info("<%s> post_handler: p->addr = 0x%p, pstate = 0x%lx\n", p->symbol_name, p->addr, (long)regs->pstate); #endif +#ifdef CONFIG_ARM + pr_info("<%s> post_handler: p->addr = 0x%p, cpsr = 0x%lx\n", + p->symbol_name, p->addr, (long)regs->ARM_cpsr); +#endif #ifdef CONFIG_S390 pr_info("<%s> pre_handler: p->addr, 0x%p, flags = 0x%lx\n", p->symbol_name, p->addr, regs->flags); |