From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: anemo@mba.ocn.ne.jp
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org,
Franck Bui-Huu <vagabon.xyz@gmail.com>
Subject: [PATCH 5/7] Miscellaneous cleanup in prologue analysis code
Date: Tue, 1 Aug 2006 11:27:15 +0200 [thread overview]
Message-ID: <1154424438145-git-send-email-vagabon.xyz@gmail.com> (raw)
In-Reply-To: <11544244373398-git-send-email-vagabon.xyz@gmail.com>
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(®s);
- show_frametrace(current, ®s);
+ show_backtrace(current, ®s);
return;
}
#endif
--
1.4.2.rc2
next prev parent reply other threads:[~2006-08-01 9:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-01 9:27 [PATCH 0/7] Improve prologue analysis code Franck Bui-Huu
2006-08-01 9:27 ` [PATCH 1/7] Make get_frame_info() more readable Franck Bui-Huu
2006-08-01 15:02 ` Atsushi Nemoto
2006-08-01 9:27 ` [PATCH 2/7] Make get_frame_info() more robust Franck Bui-Huu
2006-08-01 9:27 ` [PATCH 3/7] Make frame_info_init() more readable Franck Bui-Huu
2006-08-01 9:27 ` [PATCH 4/7] Remove unused MODULE_RANGE macro Franck Bui-Huu
2006-08-01 9:27 ` Franck Bui-Huu [this message]
2006-08-01 9:27 ` [PATCH 6/7] Fix dump_stack() Franck Bui-Huu
2006-08-01 15:08 ` Atsushi Nemoto
2006-08-01 15:36 ` Franck Bui-Huu
2006-08-01 16:05 ` Atsushi Nemoto
2006-08-01 17:43 ` Franck Bui-Huu
2006-08-02 1:54 ` Atsushi Nemoto
2006-08-01 9:27 ` [PATCH 7/7] Allow unwind_stack() to return ra for leaf function Franck Bui-Huu
2006-08-01 15:48 ` Atsushi Nemoto
2006-08-01 19:38 ` Franck Bui-Huu
2006-08-02 1:51 ` Atsushi Nemoto
2006-08-02 10:21 ` Franck Bui-Huu
2006-08-02 11:25 ` Atsushi Nemoto
2006-08-02 13:08 ` Franck Bui-Huu
2006-08-02 16:00 ` Atsushi Nemoto
2006-08-02 16:56 ` Franck Bui-Huu
2006-08-03 4:52 ` Atsushi Nemoto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1154424438145-git-send-email-vagabon.xyz@gmail.com \
--to=vagabon.xyz@gmail.com \
--cc=anemo@mba.ocn.ne.jp \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox