From 3d256151471ba9fd60a5b896a706eb21a6b1cea1 Mon Sep 17 00:00:00 2001 From: Nikolaus Voss Date: Wed, 3 Sep 2008 12:50:32 +0200 Subject: 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 Signed-off-by: Haavard Skinnemoen --- arch/avr32/oprofile/op_model_avr32.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/avr32/oprofile/op_model_avr32.c') 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 @@ #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; -- cgit v1.2.3-59-g8ed1b