This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stack_used() not accurate?


Wenji Huang <wenji.huang@oracle.com> writes:

> [...]  I did a test and found it kept the constant value.

If the kernel switches to a separate stack for int3 handling, that
could explain the constant value.

> function stack_used_new:long() %{ /*pure */
>  {
>          unsigned long *n = end_of_stack(current);
>          unsigned long free;
>          while (*n == 0)
>                  n++;
>          free = (unsigned long)n - (unsigned long)end_of_stack(current);
>          THIS->__retvalue = THREAD_SIZE - free;
> }
> %}

This searching for non-0 values seems dangerously unbounded.  Plus it
may measure the *maximum historical* rather current stack usage.


- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]