Commit e3e682b8 authored by David Mosberger's avatar David Mosberger

ia64: Consolidate backtrace printing in a single routine (ia64_do_show_stack()).

parent 2ca394c5
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
* Purpose: Generic MCA handling layer * Purpose: Generic MCA handling layer
* *
* Updated for latest kernel * Updated for latest kernel
* Copyright (C) 2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*
* Copyright (C) 2002 Dell Computer Corporation * Copyright (C) 2002 Dell Computer Corporation
* Copyright (C) Matt Domsch (Matt_Domsch@dell.com) * Copyright (C) Matt Domsch (Matt_Domsch@dell.com)
* *
...@@ -18,6 +21,7 @@ ...@@ -18,6 +21,7 @@
* Copyright (C) 1999 Silicon Graphics, Inc. * Copyright (C) 1999 Silicon Graphics, Inc.
* Copyright (C) Vijay Chander(vijay@engr.sgi.com) * Copyright (C) Vijay Chander(vijay@engr.sgi.com)
* *
* 03/04/15 D. Mosberger Added INIT backtrace support.
* 02/03/25 M. Domsch GUID cleanups * 02/03/25 M. Domsch GUID cleanups
* *
* 02/01/04 J. Hall Aligned MCA stack to 16 bytes, added platform vs. CPU * 02/01/04 J. Hall Aligned MCA stack to 16 bytes, added platform vs. CPU
...@@ -320,9 +324,7 @@ void ...@@ -320,9 +324,7 @@ void
init_handler_platform (sal_log_processor_info_t *proc_ptr, init_handler_platform (sal_log_processor_info_t *proc_ptr,
struct pt_regs *pt, struct switch_stack *sw) struct pt_regs *pt, struct switch_stack *sw)
{ {
unsigned long ip, sp, bsp;
struct unw_frame_info info; struct unw_frame_info info;
char buf[80];
/* if a kernel debugger is available call it here else just dump the registers */ /* if a kernel debugger is available call it here else just dump the registers */
...@@ -338,19 +340,8 @@ init_handler_platform (sal_log_processor_info_t *proc_ptr, ...@@ -338,19 +340,8 @@ init_handler_platform (sal_log_processor_info_t *proc_ptr,
fetch_min_state(&SAL_LPI_PSI_INFO(proc_ptr)->min_state_area, pt, sw); fetch_min_state(&SAL_LPI_PSI_INFO(proc_ptr)->min_state_area, pt, sw);
printk("\nCall Trace:\n");
unw_init_from_interruption(&info, current, pt, sw); unw_init_from_interruption(&info, current, pt, sw);
do { ia64_do_show_stack(&info, NULL);
unw_get_ip(&info, &ip);
if (ip == 0)
break;
unw_get_sp(&info, &sp);
unw_get_bsp(&info, &bsp);
snprintf(buf, sizeof(buf), " [<%016lx>] %%s\n\t\tsp=%016lx bsp=%016lx\n",
ip, sp, bsp);
print_symbol(buf, ip);
} while (unw_unwind(&info) >= 0);
printk("\nINIT dump complete. Please reboot now.\n"); printk("\nINIT dump complete. Please reboot now.\n");
while (1); /* hang city if no debugger */ while (1); /* hang city if no debugger */
......
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
#include "sigframe.h" #include "sigframe.h"
static void void
do_show_stack (struct unw_frame_info *info, void *arg) ia64_do_show_stack (struct unw_frame_info *info, void *arg)
{ {
unsigned long ip, sp, bsp; unsigned long ip, sp, bsp;
char buf[80]; /* don't make it so big that it overflows the stack! */ char buf[80]; /* don't make it so big that it overflows the stack! */
...@@ -57,7 +57,7 @@ do_show_stack (struct unw_frame_info *info, void *arg) ...@@ -57,7 +57,7 @@ do_show_stack (struct unw_frame_info *info, void *arg)
unw_get_sp(info, &sp); unw_get_sp(info, &sp);
unw_get_bsp(info, &bsp); unw_get_bsp(info, &bsp);
snprintf(buf, sizeof(buf), " [<%016lx>] %%s\n\t\tsp=%016lx bsp=%016lx\n", snprintf(buf, sizeof(buf), " [<%016lx>] %%s\n\t\t\t\tsp=%016lx bsp=%016lx\n",
ip, sp, bsp); ip, sp, bsp);
print_symbol(buf, ip); print_symbol(buf, ip);
} while (unw_unwind(info) >= 0); } while (unw_unwind(info) >= 0);
...@@ -73,12 +73,12 @@ void ...@@ -73,12 +73,12 @@ void
show_stack (struct task_struct *task) show_stack (struct task_struct *task)
{ {
if (!task) if (!task)
unw_init_running(do_show_stack, 0); unw_init_running(ia64_do_show_stack, 0);
else { else {
struct unw_frame_info info; struct unw_frame_info info;
unw_init_from_blocked_task(&info, task); unw_init_from_blocked_task(&info, task);
do_show_stack(&info, 0); ia64_do_show_stack(&info, 0);
} }
} }
......
...@@ -227,8 +227,10 @@ struct switch_stack { ...@@ -227,8 +227,10 @@ struct switch_stack {
}) })
struct task_struct; /* forward decl */ struct task_struct; /* forward decl */
struct unw_frame_info; /* forward decl */
extern void show_regs (struct pt_regs *); extern void show_regs (struct pt_regs *);
extern void ia64_do_show_stack (struct unw_frame_info *, void *);
extern unsigned long ia64_get_user_rbs_end (struct task_struct *, struct pt_regs *, extern unsigned long ia64_get_user_rbs_end (struct task_struct *, struct pt_regs *,
unsigned long *); unsigned long *);
extern long ia64_peek (struct task_struct *, struct switch_stack *, unsigned long, extern long ia64_peek (struct task_struct *, struct switch_stack *, unsigned long,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment