X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fllobdstat;h=3ab51c65b64caab6b7d19167534dbccc286e97a7;hb=0d75d5cd5a6217ec75bac8d3f479bbfb8a10be29;hp=733cb4b9149809dca834aa013e0ded1c1249e421;hpb=20f7890945db5147ae214deb0f23b09175515edf;p=fs%2Flustre-release.git diff --git a/lustre/utils/llobdstat b/lustre/utils/llobdstat index 733cb4b..3ab51c6 100755 --- a/lustre/utils/llobdstat +++ b/lustre/utils/llobdstat @@ -5,14 +5,13 @@ my $pname = $0; -my $defaultpath = "/proc/fs/lustre"; my $obdstats = "stats"; sub usage() { print STDERR "Usage: $pname [ [}]\n"; - print STDERR "where ost_name : ost name under $defaultpath/obdfilter\n"; - print STDERR " interval : sample interaval in seconds\n"; + print STDERR "where ost_name : ost name under obdfilter\n"; + print STDERR " interval : sample interval in seconds\n"; print STDERR "example: $pname lustre-OST0000 2\n"; print STDERR "Use CTRL + C to stop statistics printing\n"; exit 1; @@ -33,9 +32,14 @@ if (($#ARGV < 0) || ($#ARGV > 2)) { } elsif ( -f "$ARGV[0]/$obdstats" ) { $statspath = "$ARGV[0]/$obdstats"; } else { - my $st = "$defaultpath/obdfilter/$ARGV[0]/$obdstats"; + my $st = glob ("/{proc,sys}/fs/lustre/obdfilter/$ARGV[0]"); if ( -f "$st" ) { $statspath = $st; + } else { + my $st = glob("/{proc,sys}/fs/lustre/obdfilter/$ARGV[0]/$obdstats"); + if ( -f "$st" ) { + $statspath = $st; + } } } if ( $statspath =~ /^None$/ ) { @@ -49,7 +53,7 @@ if (($#ARGV < 0) || ($#ARGV > 2)) { } } -print "$pname on $statspath\n"; +print "$pname on $ARGV[0]\n"; my %cur; my %last;