From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v4 06/15] xenctx: Add command line option -t (--tag-stack-dump) Date: Wed, 19 Mar 2014 16:10:52 +0000 Message-ID: <5329C18C.90803@eu.citrix.com> References: <1395180940-23901-1-git-send-email-dslutz@verizon.com> <1395180940-23901-7-git-send-email-dslutz@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1395180940-23901-7-git-send-email-dslutz@verizon.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: Don Slutz , xen-devel@lists.xen.org Cc: Don Slutz , Ian Jackson , Ian Campbell , Jan Beulich , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On 03/18/2014 10:15 PM, Don Slutz wrote: > If specified, add stack address to dump. > > Here is an example: > > Stack: > ffffffff803ddf90: ffffffff80048d19 0000000000200800 ffffffff803e7801 0000000000086800 > ffffffff803ddfb0: 0000000000000000 ffffffff80430720 ffffffff803e722f 80008e000010019c > ffffffff803ddfd0: 00000000ffffffff 0000000000000000 0000000000000000 0000000000200000 > ffffffff803ddff0: 0000000000000000 0000000000000000 > > Signed-off-by: Don Slutz Reviewed-by: George Dunlap > --- > tools/xentrace/xenctx.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c > index 850e091..9808e55 100644 > --- a/tools/xentrace/xenctx.c > +++ b/tools/xentrace/xenctx.c > @@ -39,6 +39,7 @@ static struct xenctx { > int bytes_per_line; > int lines; > int decode_as_ascii; > + int tag_stack_dump; > int all_vcpus; > int self_paused; > xc_dominfo_t dominfo; > @@ -684,6 +685,11 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width) > int j = 0; > int k; > > + if ( xenctx.tag_stack_dump ) > + { > + print_stack_word(stack, width); > + printf(":"); > + } > while ( stack < stack_limit && > stack < stack_pointer(ctx) + i * xenctx.bytes_per_line ) > { > @@ -885,13 +891,15 @@ static void usage(void) > printf(" change the number of lines output for Stack.\n"); > printf(" -D, --decode-as-ascii\n"); > printf(" add a decode of Stack dump as ascii.\n"); > + printf(" -t, --tag-stack-dump\n"); > + printf(" add address on each line of Stack dump.\n"); > } > > int main(int argc, char **argv) > { > int ch; > int ret; > - static const char *sopts = "fs:hak:SCmb:l:D"; > + static const char *sopts = "fs:hak:SCmb:l:Dt"; > static const struct option lopts[] = { > {"stack-trace", 0, NULL, 'S'}, > {"symbol-table", 1, NULL, 's'}, > @@ -899,6 +907,7 @@ int main(int argc, char **argv) > {"kernel-start", 1, NULL, 'k'}, > {"multiple-pages", 0, NULL, 'm'}, > {"decode-as-ascii", 0, NULL, 'D'}, > + {"tag-stack-dump", 0, NULL, 't'}, > {"bytes-per-line", 1, NULL, 'b'}, > {"lines", 1, NULL, 'l'}, > {"all", 0, NULL, 'a'}, > @@ -933,6 +942,9 @@ int main(int argc, char **argv) > case 'D': > xenctx.decode_as_ascii = 1; > break; > + case 't': > + xenctx.tag_stack_dump = 1; > + break; > case 'b': > xenctx.bytes_per_line = strtol(optarg, NULL, 0); > if ( xenctx.bytes_per_line < 4 ||