aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2010-08-03 14:22:21 -0400
committerRalf Baechle <ralf@linux-mips.org>2010-08-05 08:26:29 -0400
commit8a1492370b493cf680b86885286f07cb9b967716 (patch)
treeac1efeafead9a4092397e546d1afb3115a4ac954 /samples
parentc1bf207d6ee1eb72e9c10365edbdc7c9ff7fb9b0 (diff)
SAMPLES: kprobe_example: Make it print something on MIPS.
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>
Diffstat (limited to 'samples')
-rw-r--r--samples/kprobes/kprobe_example.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/samples/kprobes/kprobe_example.c b/samples/kprobes/kprobe_example.c
index a681998a871c..ebf5e0c368ea 100644
--- a/samples/kprobes/kprobe_example.c
+++ b/samples/kprobes/kprobe_example.c
@@ -32,6 +32,11 @@ static int handler_pre(struct kprobe *p, struct pt_regs *regs)
32 " msr = 0x%lx\n", 32 " msr = 0x%lx\n",
33 p->addr, regs->nip, regs->msr); 33 p->addr, regs->nip, regs->msr);
34#endif 34#endif
35#ifdef CONFIG_MIPS
36 printk(KERN_INFO "pre_handler: p->addr = 0x%p, epc = 0x%lx,"
37 " status = 0x%lx\n",
38 p->addr, regs->cp0_epc, regs->cp0_status);
39#endif
35 40
36 /* A dump_stack() here will give a stack backtrace */ 41 /* A dump_stack() here will give a stack backtrace */
37 return 0; 42 return 0;
@@ -49,6 +54,10 @@ static void handler_post(struct kprobe *p, struct pt_regs *regs,
49 printk(KERN_INFO "post_handler: p->addr = 0x%p, msr = 0x%lx\n", 54 printk(KERN_INFO "post_handler: p->addr = 0x%p, msr = 0x%lx\n",
50 p->addr, regs->msr); 55 p->addr, regs->msr);
51#endif 56#endif
57#ifdef CONFIG_MIPS
58 printk(KERN_INFO "post_handler: p->addr = 0x%p, status = 0x%lx\n",
59 p->addr, regs->cp0_status);
60#endif
52} 61}
53 62
54/* 63/*