linux-mips
[Top] [All Lists]

[PATCH 5/7] Miscellaneous cleanup in prologue analysis code

To: anemo@mba.ocn.ne.jp
Subject: [PATCH 5/7] Miscellaneous cleanup in prologue analysis code
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
Date: Tue, 1 Aug 2006 11:27:15 +0200
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, Franck Bui-Huu <vagabon.xyz@gmail.com>
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=kMov9A5uPO7hXlariBgNoChz+tDes9/Zp0WBaKlyL3eavJ/TLZH3U86m4M0mj8T/geVDbbOOM+p3fJ8/c3Ys+TQYYKv8FU2hYNhADnRAY3EBkdSHLvAx7/w48H7W9EUGETlAfe8NtpZZ9DIrTTKRKyg/Fw3kkmS4Ty+8WrzRE9w=
In-reply-to: <11544244373398-git-send-email-vagabon.xyz@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <11544244373398-git-send-email-vagabon.xyz@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
We usually use backtrace term for dumping a call tree during
debug. Therefore this patch renames show_frametrace() into
show_backtrace().

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
---
 arch/mips/kernel/traps.c |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 4a11a3d..15fa445 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -74,19 +74,18 @@ void (*board_ejtag_handler_setup)(void);
 void (*board_bind_eic_interrupt)(int irq, int regset);
 
 
-static void show_trace(unsigned long *stack)
+static void show_trace(unsigned long *sp)
 {
-       const int field = 2 * sizeof(unsigned long);
        unsigned long addr;
 
        printk("Call Trace:");
 #ifdef CONFIG_KALLSYMS
        printk("\n");
 #endif
-       while (!kstack_end(stack)) {
-               addr = *stack++;
+       while (!kstack_end(sp)) {
+               addr = *sp++;
                if (__kernel_text_address(addr)) {
-                       printk(" [<%0*lx>] ", field, addr);
+                       printk(" [<%0*lx>] ", 2 * sizeof(unsigned long), addr);
                        print_symbol("%s\n", addr);
                }
        }
@@ -104,22 +103,21 @@ __setup("raw_show_trace", set_raw_show_t
 
 extern unsigned long unwind_stack(struct task_struct *task,
                                  unsigned long **sp, unsigned long pc);
-static void show_frametrace(struct task_struct *task, struct pt_regs *regs)
+static void show_backtrace(struct task_struct *task, struct pt_regs *regs)
 {
-       const int field = 2 * sizeof(unsigned long);
-       unsigned long *stack = (long *)regs->regs[29];
+       unsigned long *sp = (long *)regs->regs[29];
        unsigned long pc = regs->cp0_epc;
        int top = 1;
 
        if (raw_show_trace || !__kernel_text_address(pc)) {
-               show_trace(stack);
+               show_trace(sp);
                return;
        }
        printk("Call Trace:\n");
        while (__kernel_text_address(pc)) {
-               printk(" [<%0*lx>] ", field, pc);
+               printk(" [<%0*lx>] ", 2 * sizeof(unsigned long), pc);
                print_symbol("%s\n", pc);
-               pc = unwind_stack(task, &stack, pc);
+               pc = unwind_stack(task, &sp, pc);
                if (top && pc == 0)
                        pc = regs->regs[31];    /* leaf? */
                top = 0;
@@ -127,7 +125,7 @@ static void show_frametrace(struct task_
        printk("\n");
 }
 #else
-#define show_frametrace(task, r) show_trace((long *)(r)->regs[29]);
+#define show_backtrace(task, r) show_trace((long *)(r)->regs[29]);
 #endif
 
 /*
@@ -160,7 +158,7 @@ static void show_stacktrace(struct task_
                i++;
        }
        printk("\n");
-       show_frametrace(task, regs);
+       show_backtrace(task, regs);
 }
 
 static noinline void prepare_frametrace(struct pt_regs *regs)
@@ -211,7 +209,7 @@ #ifdef CONFIG_KALLSYMS
        if (!raw_show_trace) {
                struct pt_regs regs;
                prepare_frametrace(&regs);
-               show_frametrace(current, &regs);
+               show_backtrace(current, &regs);
                return;
        }
 #endif
-- 
1.4.2.rc2


<Prev in Thread] Current Thread [Next in Thread>