analysis of polling in systemtap
Frank Ch. Eigler
fche@redhat.com
Mon Dec 19 19:53:00 GMT 2005
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
More information about the Systemtap
mailing list