Commit ea9b5013 authored by Huang Shijie's avatar Huang Shijie Committed by Linus Torvalds

samples/kprobes: print out the symbol name for the hooks

Print out the symbol name for the hooks, it makes the logs more
readable.

Link: http://lkml.kernel.org/r/1463535417-29637-2-git-send-email-shijie.huang@arm.comSigned-off-by: default avatarHuang Shijie <shijie.huang@arm.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Steve Capper <steve.capper@arm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d04659ac
...@@ -27,24 +27,24 @@ static struct kprobe kp = { ...@@ -27,24 +27,24 @@ static struct kprobe kp = {
static int handler_pre(struct kprobe *p, struct pt_regs *regs) static int handler_pre(struct kprobe *p, struct pt_regs *regs)
{ {
#ifdef CONFIG_X86 #ifdef CONFIG_X86
printk(KERN_INFO "pre_handler: p->addr = 0x%p, ip = %lx," printk(KERN_INFO "<%s> pre_handler: p->addr = 0x%p, ip = %lx,"
" flags = 0x%lx\n", " flags = 0x%lx\n",
p->addr, regs->ip, regs->flags); p->symbol_name, p->addr, regs->ip, regs->flags);
#endif #endif
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
printk(KERN_INFO "pre_handler: p->addr = 0x%p, nip = 0x%lx," printk(KERN_INFO "<%s> pre_handler: p->addr = 0x%p, nip = 0x%lx,"
" msr = 0x%lx\n", " msr = 0x%lx\n",
p->addr, regs->nip, regs->msr); p->symbol_name, p->addr, regs->nip, regs->msr);
#endif #endif
#ifdef CONFIG_MIPS #ifdef CONFIG_MIPS
printk(KERN_INFO "pre_handler: p->addr = 0x%p, epc = 0x%lx," printk(KERN_INFO "<%s> pre_handler: p->addr = 0x%p, epc = 0x%lx,"
" status = 0x%lx\n", " status = 0x%lx\n",
p->addr, regs->cp0_epc, regs->cp0_status); p->symbol_name, p->addr, regs->cp0_epc, regs->cp0_status);
#endif #endif
#ifdef CONFIG_TILEGX #ifdef CONFIG_TILEGX
printk(KERN_INFO "pre_handler: p->addr = 0x%p, pc = 0x%lx," printk(KERN_INFO "<%s> pre_handler: p->addr = 0x%p, pc = 0x%lx,"
" ex1 = 0x%lx\n", " ex1 = 0x%lx\n",
p->addr, regs->pc, regs->ex1); p->symbol_name, p->addr, regs->pc, regs->ex1);
#endif #endif
/* A dump_stack() here will give a stack backtrace */ /* A dump_stack() here will give a stack backtrace */
...@@ -56,20 +56,20 @@ static void handler_post(struct kprobe *p, struct pt_regs *regs, ...@@ -56,20 +56,20 @@ static void handler_post(struct kprobe *p, struct pt_regs *regs,
unsigned long flags) unsigned long flags)
{ {
#ifdef CONFIG_X86 #ifdef CONFIG_X86
printk(KERN_INFO "post_handler: p->addr = 0x%p, flags = 0x%lx\n", printk(KERN_INFO "<%s> post_handler: p->addr = 0x%p, flags = 0x%lx\n",
p->addr, regs->flags); p->symbol_name, p->addr, regs->flags);
#endif #endif
#ifdef CONFIG_PPC #ifdef CONFIG_PPC
printk(KERN_INFO "post_handler: p->addr = 0x%p, msr = 0x%lx\n", printk(KERN_INFO "<%s> post_handler: p->addr = 0x%p, msr = 0x%lx\n",
p->addr, regs->msr); p->symbol_name, p->addr, regs->msr);
#endif #endif
#ifdef CONFIG_MIPS #ifdef CONFIG_MIPS
printk(KERN_INFO "post_handler: p->addr = 0x%p, status = 0x%lx\n", printk(KERN_INFO "<%s> post_handler: p->addr = 0x%p, status = 0x%lx\n",
p->addr, regs->cp0_status); p->symbol_name, p->addr, regs->cp0_status);
#endif #endif
#ifdef CONFIG_TILEGX #ifdef CONFIG_TILEGX
printk(KERN_INFO "post_handler: p->addr = 0x%p, ex1 = 0x%lx\n", printk(KERN_INFO "<%s> post_handler: p->addr = 0x%p, ex1 = 0x%lx\n",
p->addr, regs->ex1); p->symbol_name, p->addr, regs->ex1);
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment