summaryrefslogtreecommitdiff
path: root/arch/x86/oprofile
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2007-10-19 20:35:04 +0200
committerThomas Gleixner <tglx@linutronix.de>2007-10-19 20:35:04 +0200
commitf1df280f53d7c3ce8613a3b25d1efe009b9860dd (patch)
tree7b9d6d837355bd913fb5b41017556f1137adee18 /arch/x86/oprofile
parentab483570a13be2a34c0502b166df8f8b26802103 (diff)
x86: introduce frame_pointer() and stack_pointer()
This patch defines frame_pointer() and stack_pointer() similar to the already defined instruction_pointer(). Thus the oprofile code can be written in a more readable fashion. [ tglx: arch/x86 adaptation ] Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r--arch/x86/oprofile/backtrace.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/arch/x86/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c
index dc59a808009f..0ed046a187f7 100644
--- a/arch/x86/oprofile/backtrace.c
+++ b/arch/x86/oprofile/backtrace.c
@@ -76,16 +76,8 @@ dump_user_backtrace(struct frame_head * head)
void
x86_backtrace(struct pt_regs * const regs, unsigned int depth)
{
- struct frame_head *head;
- unsigned long stack;
-
-#ifdef CONFIG_X86_64
- head = (struct frame_head *)regs->rbp;
- stack = regs->rsp;
-#else
- head = (struct frame_head *)regs->ebp;
- stack = regs->esp;
-#endif
+ struct frame_head *head = (struct frame_head *)frame_pointer(regs);
+ unsigned long stack = stack_pointer(regs);
if (!user_mode_vm(regs)) {
if (depth)