From: Don Slutz Subject: [PATCH v2 07/12] xenctx: Add stack addr to call trace. Date: Wed, 6 Nov 2013 15:08:15 -0500 Message-ID: <1383768500-4245-8-git-send-email-dslutz@terremark.com> References: <1383768500-4245-1-git-send-email-dslutz@terremark.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1383768500-4245-1-git-send-email-dslutz@terremark.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org, George Dunlap , Ian Jackson , Stefano Stabellini , Ian Campbell , Jan Beulich Cc: Don Slutz List-Id: xen-devel@lists.xenproject.org From: Don Slutz Signed-off-by: Don Slutz --- 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 + ? " " + : " "); 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"); } -- 1.7.1