Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
SAMPLES: kprobe_example: Make it print something on MIPS.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Daney authored and ralfbaechle committed Aug 5, 2010
1 parent c1bf207 commit 8a14923
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions samples/kprobes/kprobe_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
}

/*
Expand Down

0 comments on commit 8a14923

Please sign in to comment.