This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: stack_used() not accurate?
- From: "Mike Snitzer" <snitzer at gmail dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: "Wenji Huang" <wenji dot huang at oracle dot com>, systemtap at sourceware dot org
- Date: Thu, 29 May 2008 11:43:29 -0400
- Subject: Re: stack_used() not accurate?
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=TSM+4KBB2AQ+/ccMLaZA4kqf4U/OCVt68EgIUrUNrVA=; b=f1WIo8Kgd/xsQduSwKetLN6+HFz3LZDawQ1Fi0+Nfnf2NljTsGi0tQNfGZewVr2I3we2k0J4NY8sgwMLi3tU3RTUWhrLhcZMJiOOUU4nLKe54bsAoYHFJlwIrYTP+/OTEnBkzMEBWwOd+ZLq/Rao6b06vE6jOqvveFEoJZqCpEE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=o0z8c1J4OTqbpUeVpgfq+gxWy3An9cc/agtT0iFq2fS3pzDbqgX1k57BBsj9i/hrzPNyemI6sNOtnMcYFqo6+LJdjGO5ujk67pLk8kSC0upi0U/W5I10rl48G+9cxdtsaZBlh4E6J8nvBMYw5uIA8XTMC10h8/yECsiSMv5obGY=
- References: <170fa0d20805281912r54e0f931h9bdbc9e9c7880b7e@mail.gmail.com> <483E720D.8050808@oracle.com> <y0mprr59nf4.fsf@ton.toronto.redhat.com>
On Thu, May 29, 2008 at 10:48 AM, Frank Ch. Eigler <fche@redhat.com> wrote:
> 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.
Thanks for the explanation.
>> 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.
Yes, when using Wenji's stack_used_new() I'm seeing free=0 quite
frequently; obviously that isn't useful/accurate.
I'll be exploring other implementations, but any suggestions would be
very welcome.
Mike