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

Re: [Xen-devel] [PATCH v5 03/17] xenctx: Add -n (--display-stack-pages) option to output larger stack



On Thu, 2014-03-20 at 15:06 -0400, Don Slutz wrote:
> From: Don Slutz <Don@xxxxxxxxxxxxxxx>
> 
> Important: This is the stack size to display not the configured
> stack size.
> 
> Note: use with caution (easy to get garbage).
> 
> Below is various pictures of a configured 3 page stack, and where
> the SP currently is.  Each box is a page.
> 
>        +------------------+
>        |                  |
>        |                  |
>        |                  |
>        |                  |
>        |                  |
>        +------------------+
>        |                  |
>        |                  |
>        |                  |
>        |                  |
>        |                  |
>        +------------------+
>        |                  |
>        |                  |
>        |                  |
> SP --> |                  |
>        |                  |
>        +------------------+
> 
> Display using "-n 1" since the used stack pages is 1.

Like George I am also confused by what these diagrams are trying to show
me, and even having read your response to him I'm confused.

Why is the SP moving around in these pictures? I understood that this
option was changing what was considered to be the limit of the stack,
not the stack pointer itself, so shouldn't it be the base of the stack
which is moving around?

Perhaps if you had the diagram once and along side it had columns
showing what is printed for each -n value as a range

e.g.
                              None     -n 1
       +------------------+              +
       |                  |              |
       |                  |              |
       |                  |              |
       |                  |              |
       |                  |              |
       +------------------+     +        |
       |                  |     |        |
SP --> |                  |     +        +
       |                  |
       |                  |
       |                  |
       +------------------+

(or whatever the reality is)

[...]
> Signed-off-by: Don Slutz <Don@xxxxxxxxxxxxxxx>

Out of date?
> ---
> v5: Adjust option to -n, --display-stack-pages.  Adjust usage message.
> 
>  tools/xentrace/xenctx.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
> index 42a47f3..caa8899 100644
> --- a/tools/xentrace/xenctx.c
> +++ b/tools/xentrace/xenctx.c
> @@ -35,6 +35,7 @@ static struct xenctx {
>      int frame_ptrs;
>      int stack_trace;
>      int disp_all;
> +    int multiple_pages;
>      int all_vcpus;
>      int self_paused;
>      xc_dominfo_t dominfo;
> @@ -664,6 +665,8 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int 
> vcpu, int width)
>  
>      stack_limit = ((stack_pointer(ctx) + XC_PAGE_SIZE)
>                     & ~((guest_word_t) XC_PAGE_SIZE - 1));
> +    if ( xenctx.multiple_pages > 1 )
> +        stack_limit += (xenctx.multiple_pages - 1) * XC_PAGE_SIZE;

"multiple_pages" sounds like a boolean to me, you seem to use it as
"extra_pages", but why not just call it nr_stack_pages, initialise it to
1 and override it with --display-stack-pages.

Ian.


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