SAMPLES: kprobe_example: Make it print something on MIPS.
authorDavid Daney <ddaney@caviumnetworks.com>
Tue, 3 Aug 2010 18:22:21 +0000 (11:22 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 5 Aug 2010 12:26:29 +0000 (13:26 +0100)
This KProbes example is a little useless if it doesn't print anything.
For MIPS print similar messages to those produced on x86 and PPC.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
To: ananth@in.ibm.com
To: anil.s.keshavamurthy@intel.com
To: davem@davemloft.net
To: masami.hiramatsu.pt@hitachi.com
Cc: linux-kernel@vger.kernel.org
Cc: hschauhan@nulltrace.org
Patchwork: https://patchwork.linux-mips.org/patch/1528/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
samples/kprobes/kprobe_example.c

index a681998a871cae548eb05f741ed6533daa17d238..ebf5e0c368ea0eb4bf48fbda2f76b5b347c3e247 100644 (file)
@@ -32,6 +32,11 @@ static int handler_pre(struct kprobe *p, struct pt_regs *regs)
                        " msr = 0x%lx\n",
                p->addr, regs->nip, regs->msr);
 #endif
+#ifdef CONFIG_MIPS
+       printk(KERN_INFO "pre_handler: p->addr = 0x%p, epc = 0x%lx,"
+                       " status = 0x%lx\n",
+               p->addr, regs->cp0_epc, regs->cp0_status);
+#endif
 
        /* A dump_stack() here will give a stack backtrace */
        return 0;
@@ -49,6 +54,10 @@ static void handler_post(struct kprobe *p, struct pt_regs *regs,
        printk(KERN_INFO "post_handler: p->addr = 0x%p, msr = 0x%lx\n",
                p->addr, regs->msr);
 #endif
+#ifdef CONFIG_MIPS
+       printk(KERN_INFO "post_handler: p->addr = 0x%p, status = 0x%lx\n",
+               p->addr, regs->cp0_status);
+#endif
 }
 
 /*