Skip to content

Commit

Permalink
9322 Print stats since boot for first line of arcstat.pl
Browse files Browse the repository at this point in the history
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
  • Loading branch information
Pascal666 authored and prakashsurya committed Mar 21, 2018
1 parent 268bbb2 commit 0a052a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions usr/src/cmd/stat/arcstat/arcstat.pl
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0a052a6

Please sign in to comment.