Whamcloud - gitweb
LU-5030 tests: remove /proc paths from tests
[fs/lustre-release.git] / lustre / utils / llobdstat
index 733cb4b..3ab51c6 100755 (executable)
@@ -5,14 +5,13 @@
 
 my $pname = $0;
 
-my $defaultpath = "/proc/fs/lustre";
 my $obdstats = "stats";
 
 sub usage()
 {
     print STDERR "Usage: $pname <ost_name> [<interval> [<count>}]\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;