sh: oprofile: Backtrace support.

This patch improves the oprofile support on sh and adds backtrace
support.

Signed-off-by: Dave Peverley <dpeverley@mpc-data.co.uk>
Signed-off-by: Chris Smith <chris.smith@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
Dave Peverley
2008-12-16 09:35:40 +09:00
committed by Paul Mundt
parent 60a51fbe5d
commit 40a8b421b6
2 changed files with 127 additions and 0 deletions

View File

@@ -27,6 +27,8 @@ static struct op_sh_model *model;
static struct op_counter_config ctr[20];
extern void sh_backtrace(struct pt_regs * const regs, unsigned int depth);
static int op_sh_setup(void)
{
/* Pre-compute the values to stuff in the hardware registers. */
@@ -85,6 +87,13 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
struct op_sh_model *lmodel = NULL;
int ret;
/*
* Always assign the backtrace op. If the counter initialization
* fails, we fall back to the timer which will still make use of
* this.
*/
ops->backtrace = sh_backtrace;
switch (current_cpu_data.type) {
/* SH-4 types */
case CPU_SH7750: