diff options
author | Tiezhu Yang <yangtiezhu@loongson.cn> | 2023-02-25 08:52:57 +0100 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2023-02-25 15:12:17 +0100 |
commit | a6484baa3b02b9d71bfd6016e7632dd1c02d5cba (patch) | |
tree | c2f0bab49f67311c63bb3a16cd91fac54b864d90 /samples | |
parent | LoongArch: Mark some assembler symbols as non-kprobe-able (diff) | |
download | linux-a6484baa3b02b9d71bfd6016e7632dd1c02d5cba.tar.xz linux-a6484baa3b02b9d71bfd6016e7632dd1c02d5cba.zip |
samples/kprobes: Add LoongArch support
Add LoongArch specific info in handler_pre() and handler_post().
Tested-by: Jeff Xie <xiehuan09@gmail.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
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 fd346f58ddba..ef44c614c6d9 100644 --- a/samples/kprobes/kprobe_example.c +++ b/samples/kprobes/kprobe_example.c @@ -55,6 +55,10 @@ static int __kprobes handler_pre(struct kprobe *p, struct pt_regs *regs) pr_info("<%s> p->addr, 0x%p, ip = 0x%lx, flags = 0x%lx\n", p->symbol_name, p->addr, regs->psw.addr, regs->flags); #endif +#ifdef CONFIG_LOONGARCH + pr_info("<%s> p->addr = 0x%p, era = 0x%lx, estat = 0x%lx\n", + p->symbol_name, p->addr, regs->csr_era, regs->csr_estat); +#endif /* A dump_stack() here will give a stack backtrace */ return 0; @@ -92,6 +96,10 @@ static void __kprobes handler_post(struct kprobe *p, struct pt_regs *regs, pr_info("<%s> p->addr, 0x%p, flags = 0x%lx\n", p->symbol_name, p->addr, regs->flags); #endif +#ifdef CONFIG_LOONGARCH + pr_info("<%s> p->addr = 0x%p, estat = 0x%lx\n", + p->symbol_name, p->addr, regs->csr_estat); +#endif } static int __init kprobe_init(void) |