diff options
-rwxr-xr-x | usr/src/cmd/stat/arcstat/arcstat.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr/src/cmd/stat/arcstat/arcstat.pl b/usr/src/cmd/stat/arcstat/arcstat.pl index 8f13221910..d4f12a9e1c 100755 --- a/usr/src/cmd/stat/arcstat/arcstat.pl +++ b/usr/src/cmd/stat/arcstat/arcstat.pl @@ -166,8 +166,11 @@ sub init { detailed_usage() if $vflag; @hdr = @xhdr if $xflag; #reset headers to xhdr - # check if L2ARC exists + # we want to capture the stats here, so that we can use them to check + # if an L2ARC device exists; but more importantly, so that we print + # the stats since boot as the first line of output from main(). snap_stats(); + if (defined $cur{"l2_size"}) { $l2exist = 1; } @@ -353,12 +356,12 @@ sub main { if ($count > 0) { $count_flag = 1; } while (1) { print_header() if ($i == 0); - snap_stats(); calculate(); print_values(); last if ($count_flag == 1 && $count-- <= 1); $i = (($i == $hdr_intr) && (not $raw_output)) ? 0 : $i+1; sleep($int); + snap_stats(); } close($out) if defined $out; } |