[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 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.

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

> 
> 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.

>      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®.