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

Re: [Xen-devel] [PATCH v2 07/12] xenctx: Add stack addr to call trace.



On 11/07/13 07:50, Ian Campbell wrote:
On Wed, 2013-11-06 at 15:08 -0500, Don Slutz wrote:
From: Don Slutz <Don@xxxxxxxxxxxxxxx>
Can you give an example of the output please.
Here it is (With all patches active):
dcs-xen-54:~/xen>sudo /home/don/xen/dist/install/usr/lib/xen/bin/xenctx -s /boot/System.map-2.6.18-128.el5 2
rip: ffffffff8006b2b0 default_idle+0x29
flags: 00000246 i z p
rsp: ffffffff803ddf90
rax: 0000000000000000ÂÂ rcx: 0000000000000000ÂÂ rdx: 0000000000000000
rbx: ffffffff8006b287ÂÂ rsi: 0000000000000001ÂÂ rdi: ffffffff802f0658
rbp: 0000000000086800ÂÂÂ r8: ffffffff803dc000ÂÂÂ r9: 000000000000003f
r10: ffff81017d2437c0ÂÂ r11: 0000000000000282ÂÂ r12: 0000000000000000
r13: 0000000000000000ÂÂ r14: 0000000000000000ÂÂ r15: 0000000000000000
 cs: 0010 @ 0000000000000000
ÂÂÂÂÂÂÂÂÂÂ /ffffffff(a9b)
 ss: 0018 @ 0000000000000000
ÂÂÂÂÂÂÂÂÂÂ /ffffffff(c93)
 ds: 0018 @ 0000000000000000
ÂÂÂÂÂÂÂÂÂÂ /ffffffff(c93)
 es: 0018 @ 0000000000000000
ÂÂÂÂÂÂÂÂÂÂ /ffffffff(c93)
 fs: 0000 @ 0000000000000000
ÂÂÂÂÂÂÂÂÂÂ /ffffffff(c00)
 gs: 0000 @ ffffffff803ac000\0000000000000000 boot_cpu_pda\
ÂÂÂÂÂÂÂÂÂÂ /ffffffff(c00)
Code (instr addr ffffffff8006b2b0)
65 48 8b 04 25 10 00 00 00 8b 80 38 e0 ff ff a8 08 75 04 fb f4 <eb> 01 fb 65 48 8b 04 25 10 00 00


Stack:
ffffffff803ddf90: ffffffff80048d19 0000000000200800Â .......... .....
ffffffff803ddfa0: ffffffff803e7801 0000000000086800Â .x>......h......
ffffffff803ddfb0: 0000000000000000 ffffffff80430720Â ........ .C.....
ffffffff803ddfc0: ffffffff803e722f 80008e000010019c /r>.............
ffffffff803ddfd0: 00000000ffffffff 0000000000000000Â ................
ffffffff803ddfe0: 0000000000000000 0000000000200000Â .......... .....
ffffffff803ddff0: 0000000000000000 0000000000000000Â ................

Call Trace:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ [<ffffffff8006b2b0>] default_idle+0x29 <--
ffffffff803ddf90:Â [<ffffffff80048d19>] cpu_idle+0x95
ffffffff803ddfa0:Â [<ffffffff803e7801>] start_kernel+0x220
ffffffff803ddfc0:Â [<ffffffff803e722f>] x86_64_start_kernel+0x22f


What is "stack address" is it the base of the function's stack frame
perhaps? Or maybe the top? Or maybe the framepointer?
It is the address of the stack "word".

      
Signed-off-by: Don Slutz <Don@xxxxxxxxxxxxxxx>
---
 tools/xentrace/xenctx.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index dcf431c..4dc6574 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -700,6 +700,9 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
         printf("Stack Trace:\n");
     else
         printf("Call Trace:\n");
+    printf("%s ", width == 8
+           ? "                "
+           : "        ");
I think this can be done as ("%*s", width*2, "") or something roughly
like that.
Will look into it.
ÂÂ -Don Slutz

      
     printf("%c [<", xenctx.stack_trace ? '*' : ' ');
     print_stack_word(instr_pointer(ctx), width);
     printf(">]");
@@ -715,9 +718,10 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
                     p = map_page(ctx, vcpu, stack);
                     if (!p)
                         return -1;
-                    printf("|   ");
+                    print_stack_word(stack, width);
+                    printf(": |   ");
                     print_stack_word(read_stack_word(p, width), width);
-                    printf("   \n");
+                    printf("\n");
                     stack += width;
                 }
             } else {
@@ -729,7 +733,8 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
                 return -1;
             frame = read_stack_word(p, width);
             if (xenctx.stack_trace) {
-                printf("|-- ");
+                print_stack_word(stack, width);
+                printf(": |-- ");
                 print_stack_word(read_stack_word(p, width), width);
                 printf("\n");
             }
@@ -740,7 +745,8 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
                 if (!p)
                     return -1;
                 word = read_stack_word(p, width);
-                printf("%c [<", xenctx.stack_trace ? '|' : ' ');
+                print_stack_word(stack, width);
+                printf(": %c [<", xenctx.stack_trace ? '|' : ' ');
                 print_stack_word(word, width);
                 printf(">]");
                 print_symbol(word);
@@ -756,13 +762,15 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width)
                 return -1;
             word = read_stack_word(p, width);
             if (is_kernel_text(word)) {
-                printf("  [<");
+                print_stack_word(stack, width);
+                printf(":  [<");
                 print_stack_word(word, width);
                 printf(">]");
                 print_symbol(word);
                 printf("\n");
             } else if (xenctx.stack_trace) {
-                printf("    ");
+                print_stack_word(stack, width);
+                printf(":    ");
                 print_stack_word(word, width);
                 printf("\n");
             }


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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