summaryrefslogtreecommitdiffstats
path: root/arch/avr32/oprofile/op_model_avr32.c
diff options
context:
space:
mode:
authorNikolaus Voss <n.voss@weinmann.de>2008-09-03 12:50:32 +0200
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-09-22 09:51:01 +0200
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 df42325c7f8..a3e9b3c4845 100644
--- a/arch/avr32/oprofile/op_model_avr32.c
+++ b/arch/avr32/oprofile/op_model_avr32.c
@@ -22,6 +22,8 @@
#define AVR32_PERFCTR_IRQ_GROUP 0
#define AVR32_PERFCTR_IRQ_LINE 1
+void avr32_backtrace(struct pt_regs * const regs, unsigned int depth);
+
enum { PCCNT, PCNT0, PCNT1, NR_counter };
struct avr32_perf_counter {
@@ -223,6 +225,8 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
memcpy(ops, &avr32_perf_counter_ops,
sizeof(struct oprofile_operations));
+ ops->backtrace = avr32_backtrace;
+
printk(KERN_INFO "oprofile: using AVR32 performance monitoring.\n");
return 0;