From e6ffe17ec45dd763ee8278246a112562f64a4ef2 Mon Sep 17 00:00:00 2001 From: dann Date: Wed, 21 May 2008 17:43:50 -0700 Subject: xtensa: add support for oprofile Support call graph profiling. Keep upper two bits of PC unchanged through backtrace rather than take them from sp (a1). The stack pointer is usually in the same GB (same upper 2 bits) as PC, but technically doesn't always have to be (and might not in the future, when taking full advantage of MMU v3). Signed-off-by: Dan Nicolaescu Signed-off-by: Pete Delaney Signed-off-by: Max Filippov Signed-off-by: Chris Zankel --- arch/xtensa/oprofile/init.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 arch/xtensa/oprofile/init.c (limited to 'arch/xtensa/oprofile/init.c') diff --git a/arch/xtensa/oprofile/init.c b/arch/xtensa/oprofile/init.c new file mode 100644 index 000000000000..a67eea379766 --- /dev/null +++ b/arch/xtensa/oprofile/init.c @@ -0,0 +1,26 @@ +/** + * @file init.c + * + * @remark Copyright 2008 Tensilica Inc. + * @remark Read the file COPYING + * + */ + +#include +#include +#include +#include + + +extern void xtensa_backtrace(struct pt_regs *const regs, unsigned int depth); + +int __init oprofile_arch_init(struct oprofile_operations *ops) +{ + ops->backtrace = xtensa_backtrace; + return -ENODEV; +} + + +void oprofile_arch_exit(void) +{ +} -- cgit v1.2.3