WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] make x86-64 stack dump readable

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] make x86-64 stack dump readable
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Tue, 30 Aug 2005 17:29:49 +0200
Delivery-date: Tue, 30 Aug 2005 15:26:41 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On an 80-columns-wide terminal, the stack dump wrapped in an ugly way
(as
its basic structure was appearantly based on i386 assumptions).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

---
/home/jbeulich/src/xen/2005-08-22/xen/arch/x86/traps.c  2005-08-21
02:34:41.000000000 +0200
+++ 2005-08-22/xen/arch/x86/traps.c     2005-08-26 09:52:44.000000000
+0200
@@ -100,6 +100,7 @@ unsigned long do_get_debugreg(int reg);
 
 static int debug_stack_lines = 20;
 integer_param("debug_stack_lines", debug_stack_lines);
+static const int debug_stack_items = 32 / sizeof(unsigned long);
 
 int is_kernel_text(unsigned long addr)
 {
@@ -125,7 +126,7 @@ void show_guest_stack(void)
 
     printk("Guest stack trace from "__OP"sp=%p:\n   ", stack);
 
-    for ( i = 0; i < (debug_stack_lines*8); i++ )
+    for ( i = 0; i < (debug_stack_lines * debug_stack_items); i++ )
     {
         if ( ((long)stack & (STACK_SIZE-1)) == 0 )
             break;
@@ -137,7 +138,7 @@ void show_guest_stack(void)
             i = 1;
             break;
         }
-        if ( (i != 0) && ((i % 8) == 0) )
+        if ( (i != 0) && ((i % debug_stack_items) == 0) )
             printk("\n   ");
         printk("%p ", _p(addr));
         stack++;
@@ -176,11 +177,11 @@ void show_stack(unsigned long *esp)
 
     printk("Xen stack trace from "__OP"sp=%p:\n   ", stack);
 
-    for ( i = 0; i < (debug_stack_lines*8); i++ )
+    for ( i = 0; i < (debug_stack_lines * debug_stack_items); i++ )
     {
         if ( ((long)stack & (STACK_SIZE-1)) == 0 )
             break;
-        if ( (i != 0) && ((i % 8) == 0) )
+        if ( (i != 0) && ((i % debug_stack_items) == 0) )
             printk("\n   ");
         addr = *stack++;
         printk("%p ", _p(addr));

Attachment: xen-x86_64-readable-stack-dump.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] make x86-64 stack dump readable, Jan Beulich <=