|
Description
|
Runnning the following script produces unexpected results:
#!/usr/sbin/dtrace -s
tick-20ms
{
@ticks["ticks"] = sum(1);
}
tick-200ms
{
printa(@ticks);
clear(@ticks);
}
One would expect 5 outputs per second, where each output prints "10".
Instead, we get one output of 50, and four more of 0:
ticks 50
0 31809 :tick-200ms
ticks 0
0 31809 :tick-200ms
ticks 0
0 31809 :tick-200ms
ticks 0
0 31809 :tick-200ms
ticks 0
Tuning 'switchrate' to 200ms gives the correct behavior.
xxxxx@xxxxx.com 2004-12-09 19:36:20 GMT
|