[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-ia64-devel] [PATCH] [4/6] panic stack trace: port reguster dump to xen



4/6
ported panic stack trace from linux.


Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

--
diff -r 14c97257fcd2 -r fc7f2f8057cb xen/arch/ia64/Makefile
--- a/xen/arch/ia64/Makefile    Wed Dec 28 15:19:59 2005 +0900
+++ b/xen/arch/ia64/Makefile    Wed Dec 28 15:20:00 2005 +0900
@@ -26,6 +26,9 @@
 # xen stack unwinder
 # unwind_decoder.c is included in unwind.c
 OBJS += unwind.o
+#unwind.o: CFLAGS += -DUNW_DEBUG=4
+
+OBJS += process-linux-xen.o
 
 # perfmon.o
 # unwind.o needed for kernel unwinding (rare)
@@ -35,11 +38,26 @@
 # remove following line if not privifying in memory
 # OBJS += privify.o
 
-default: $(OBJS) head.o xen.lds.s
-       $(LD) -r -o arch.o $(OBJS)
+default: $(TARGET)
+
+$(CURDIR)/arch.o: $(OBJS)
+       $(LD) -r -o $@ $(OBJS)
+
+$(TARGET)-syms: $(ALL_OBJS) head.o xen.lds.s
        $(LD) $(LDFLAGS) -T $(BASEDIR)/arch/$(TARGET_ARCH)/xen.lds.s -N \
-               -Map map.out head.o $(ALL_OBJS) -o $(TARGET)-syms
-       $(OBJCOPY) -R .note -R .comment -S $(TARGET)-syms $(TARGET)
+               -Map map.out head.o $(ALL_OBJS) -o $@
+       $(NM) -n $@ | $(BASEDIR)/tools/symbols > $(BASEDIR)/xen-syms.S
+       $(MAKE) $(BASEDIR)/xen-syms.o
+       $(LD) $(LDFLAGS) -T $(BASEDIR)/arch/$(TARGET_ARCH)/xen.lds.s -N \
+               -Map map.out head.o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
+       $(NM) -n $@ | $(BASEDIR)/tools/symbols >$(BASEDIR)/xen-syms.S
+       $(MAKE) $(BASEDIR)/xen-syms.o
+       $(LD) $(LDFLAGS) -T $(BASEDIR)/arch/$(TARGET_ARCH)/xen.lds.s -N \
+               -Map map.out head.o $(ALL_OBJS) $(BASEDIR)/xen-syms.o -o $@
+       rm -f $(BASEDIR)/xen-syms.S $(BASEDIR)/xen-syms.o
+
+$(TARGET): $(TARGET)-syms
+       $(OBJCOPY) -R .note -R .comment -S $(TARGET)-syms $@
        $(NM) -n $(TARGET)-syms | grep -v '\( [aUw] \)\|\(__crc_\)\|\( 
\$[adt]\)'\
                 > $(BASEDIR)/System.map
 
diff -r 14c97257fcd2 -r fc7f2f8057cb xen/arch/ia64/linux-xen/process-linux-xen.c
--- a/xen/arch/ia64/linux-xen/process-linux-xen.c       Wed Dec 28 15:19:59 
2005 +0900
+++ b/xen/arch/ia64/linux-xen/process-linux-xen.c       Wed Dec 28 15:20:00 
2005 +0900
@@ -5,6 +5,16 @@
  *     David Mosberger-Tang <davidm@xxxxxxxxxx>
  * 04/11/17 Ashok Raj  <ashok.raj@xxxxxxxxx> Added CPU Hotplug Support
  */
+#ifdef XEN
+#include <xen/types.h>
+#include <xen/lib.h>
+#include <xen/symbols.h>
+#include <xen/smp.h>
+#include <asm/uaccess.h>
+#include <asm/processor.h>
+#include <asm/ptrace.h>
+#include <asm/unwind.h>
+#else
 #define __KERNEL_SYSCALLS__    /* see <asm/unistd.h> */
 #include <linux/config.h>
 
@@ -55,6 +65,7 @@
 
 unsigned long boot_option_idle_override = 0;
 EXPORT_SYMBOL(boot_option_idle_override);
+#endif
 
 void
 ia64_do_show_stack (struct unw_frame_info *info, void *arg)
@@ -91,6 +102,7 @@
        }
 }
 
+#ifndef XEN
 void
 dump_stack (void)
 {
@@ -98,16 +110,28 @@
 }
 
 EXPORT_SYMBOL(dump_stack);
-
+#endif
+
+#ifdef XEN
+void
+show_registers(struct pt_regs *regs)
+#else
 void
 show_regs (struct pt_regs *regs)
+#endif
 {
        unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
 
+#ifndef XEN
        print_modules();
        printk("\nPid: %d, CPU %d, comm: %20s\n", current->pid, 
smp_processor_id(), current->comm);
        printk("psr : %016lx ifs : %016lx ip  : [<%016lx>]    %s\n",
               regs->cr_ipsr, regs->cr_ifs, ip, print_tainted());
+#else
+       printk("\nCPU %d\n", smp_processor_id());
+       printk("psr : %016lx ifs : %016lx ip  : [<%016lx>]\n",
+              regs->cr_ipsr, regs->cr_ifs, ip);
+#endif
        print_symbol("ip is at %s\n", ip);
        printk("unat: %016lx pfs : %016lx rsc : %016lx\n",
               regs->ar_unat, regs->ar_pfs, regs->ar_rsc);
@@ -154,6 +178,7 @@
                show_stack(NULL, NULL);
 }
 
+#ifndef XEN
 void
 do_notify_resume_user (sigset_t *oldset, struct sigscratch *scr, long 
in_syscall)
 {
@@ -820,4 +845,4 @@
                pm_power_off();
        machine_halt();
 }
-
+#endif // !XEN
diff -r 14c97257fcd2 -r fc7f2f8057cb xen/arch/ia64/xen/xenmisc.c
--- a/xen/arch/ia64/xen/xenmisc.c       Wed Dec 28 15:19:59 2005 +0900
+++ b/xen/arch/ia64/xen/xenmisc.c       Wed Dec 28 15:20:00 2005 +0900
@@ -178,11 +178,6 @@
 ///////////////////////////////
 // from arch/ia64/traps.c
 ///////////////////////////////
-
-void show_registers(struct pt_regs *regs)
-{
-       printf("*** ADD REGISTER DUMP HERE FOR DEBUGGING\n");
-}
 
 int is_kernel_text(unsigned long addr)
 {


-- 
yamahata

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.