This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: analysis of polling in systemtap
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Martin Hunt <hunt at redhat dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: 19 Dec 2005 14:29:55 -0500
- Subject: Re: analysis of polling in systemtap
- References: <1134762840.3952.49.camel@monkey2>
hunt wrote:
> [...] Unfortunately if an error is hit, the error message is
> sometimes cleared before the script exits. [...] Error and warning
> messages are sent over a separate channel and are displayed
> immediately. [...]
The error/warning messages already go to stderr, if I read the code
correctly. A script that generates lots of stdout + stderr traffic
may need to be diagnosed the same way as for unix tools generally:
separate stderr redirection.
> [...]
> sortn(called, 10, SORT_VALUE)
> printa(called, 10, "%1d called %2s\t%d times")
> delete called
> [...]
One obvious problem with this is the race and possible mismatches
between the "sortn" and "printa" calls. Compared to this, the
proposed sorted-limited-foreach is indeed somewhat slower, but
likewise requires the same number of script lines:
foreach (x in called- limit 10)
printf("%d called %s" ... )
# there is also a race here.
delete called
- FChE