diff options
author | Dave Peverley <dpeverley@mpc-data.co.uk> | 2008-12-15 19:35:40 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-12-22 04:44:43 -0500 |
commit | 40a8b421b6a85f7786bf3007d316cd799efe8ea1 (patch) | |
tree | 64c422b0897587ceba98b83869dda4c3ddbb0070 /arch/sh/oprofile/common.c | |
parent | 60a51fbe5dd2baef0f35bcf79f25ac1ee239a660 (diff) |
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>
Diffstat (limited to 'arch/sh/oprofile/common.c')
-rw-r--r-- | arch/sh/oprofile/common.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/sh/oprofile/common.c b/arch/sh/oprofile/common.c index a4d8c0c9a63c..1d97d64cb95f 100644 --- a/arch/sh/oprofile/common.c +++ b/arch/sh/oprofile/common.c | |||
@@ -27,6 +27,8 @@ static struct op_sh_model *model; | |||
27 | 27 | ||
28 | static struct op_counter_config ctr[20]; | 28 | static struct op_counter_config ctr[20]; |
29 | 29 | ||
30 | extern void sh_backtrace(struct pt_regs * const regs, unsigned int depth); | ||
31 | |||
30 | static int op_sh_setup(void) | 32 | static int op_sh_setup(void) |
31 | { | 33 | { |
32 | /* Pre-compute the values to stuff in the hardware registers. */ | 34 | /* Pre-compute the values to stuff in the hardware registers. */ |
@@ -85,6 +87,13 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
85 | struct op_sh_model *lmodel = NULL; | 87 | struct op_sh_model *lmodel = NULL; |
86 | int ret; | 88 | int ret; |
87 | 89 | ||
90 | /* | ||
91 | * Always assign the backtrace op. If the counter initialization | ||
92 | * fails, we fall back to the timer which will still make use of | ||
93 | * this. | ||
94 | */ | ||
95 | ops->backtrace = sh_backtrace; | ||
96 | |||
88 | switch (current_cpu_data.type) { | 97 | switch (current_cpu_data.type) { |
89 | /* SH-4 types */ | 98 | /* SH-4 types */ |
90 | case CPU_SH7750: | 99 | case CPU_SH7750: |