aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/oprofile/op_model_avr32.c
diff options
context:
space:
mode:
authorNikolaus Voss <n.voss@weinmann.de>2008-09-03 06:50:32 -0400
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-09-22 03:51:01 -0400
commit3d256151471ba9fd60a5b896a706eb21a6b1cea1 (patch)
treed6a509267161238f5fd9ac011bfa368a968e71b4 /arch/avr32/oprofile/op_model_avr32.c
parentf3c450be7b0defab59e360eca8a7e201d424d526 (diff)
Add kernel support for oprofile callgraphs on AVR32
This patch adds backtracing capability to oprofile profiling in kernel and user mode on AVR32. This is done by going through the frames on the stack and adding oprofile traces for all return addresses. The code being profiled has to be compiled with frame pointers to make this work. Signed-off-by: Nikolaus Voss <n.voss@weinmann.de> Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/oprofile/op_model_avr32.c')
-rw-r--r--arch/avr32/oprofile/op_model_avr32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/avr32/oprofile/op_model_avr32.c b/arch/avr32/oprofile/op_model_avr32.c
index df42325c7f81..a3e9b3c4845a 100644
--- a/arch/avr32/oprofile/op_model_avr32.c
+++ b/arch/avr32/oprofile/op_model_avr32.c
@@ -22,6 +22,8 @@
22#define AVR32_PERFCTR_IRQ_GROUP 0 22#define AVR32_PERFCTR_IRQ_GROUP 0
23#define AVR32_PERFCTR_IRQ_LINE 1 23#define AVR32_PERFCTR_IRQ_LINE 1
24 24
25void avr32_backtrace(struct pt_regs * const regs, unsigned int depth);
26
25enum { PCCNT, PCNT0, PCNT1, NR_counter }; 27enum { PCCNT, PCNT0, PCNT1, NR_counter };
26 28
27struct avr32_perf_counter { 29struct avr32_perf_counter {
@@ -223,6 +225,8 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
223 memcpy(ops, &avr32_perf_counter_ops, 225 memcpy(ops, &avr32_perf_counter_ops,
224 sizeof(struct oprofile_operations)); 226 sizeof(struct oprofile_operations));
225 227
228 ops->backtrace = avr32_backtrace;
229
226 printk(KERN_INFO "oprofile: using AVR32 performance monitoring.\n"); 230 printk(KERN_INFO "oprofile: using AVR32 performance monitoring.\n");
227 231
228 return 0; 232 return 0;