Whamcloud - gitweb
LU-5710 corrected some typos and grammar errors
[fs/lustre-release.git] / lustre / tests / create.pl
index c5f3f12..f740c18 100644 (file)
@@ -12,11 +12,14 @@ use Getopt::Long;
 
 use vars qw(
            $MAX_THREADS
+           $SCRIPT_NAME
            );
 
 # Don't try to run more than this many threads concurrently.
 $MAX_THREADS = 16;
 
+$SCRIPT_NAME = "create.pl";
+
 # Initialize variables
 my $silent = 0;
 my $use_mcreate = 1; # should we use mcreate or open?
@@ -82,7 +85,7 @@ sub usage () {
     print "\t--mountpt\tlocation of lustre mount\n";
     print "\t--num_mounts=n\tnumber of lustre mounts to test across, default=-1 (single mount point without numeric suffix)\n\n";
     print "example: $0 --mountpt=/mnt/lustre --num_mounts=2 --iterations=50\n";
-    print "         will perform 50 interations in /mnt/lustre1 and /mnt/lustre2\n";
+       print "         will perform 50 iterations in /mnt/lustre1 and /mnt/lustre2\n";
     print "         $0 --mountpt=/mnt/lustre --num_mounts=-1 --iterations=50\n";
     print "         will perform 50 iterations in /mnt/lustre only\n\n";
     exit;
@@ -113,15 +116,15 @@ sub fork_and_create ($) {
                  }
                  $d = int(rand() * $num_files);
                  my $path = "${mountpt}${which}/thread${thread_num}.${d}";
-                 print  "Thread $thread_num: Unlink $path start [" . $$."]...\n" if !$silent;
+                 print  "$SCRIPT_NAME - Thread $thread_num: Unlink $path start [" . $$."]...\n" if !$silent;
                  if (unlink($path)) {
-                     print "Thread $thread_num: Unlink done [$$] $path: Success\n" if !$silent;
+                     print "$SCRIPT_NAME - Thread $thread_num: Unlink done [$$] $path: Success\n" if !$silent;
                  } else {
-                     print "Thread $thread_num: Unlink done [$$] $path: $!\n"if !$silent;
+                     print "$SCRIPT_NAME - Thread $thread_num: Unlink done [$$] $path: $!\n"if !$silent;
                  }
              }
              if (($current_iteration) % 100 == 0) {
-                 print STDERR "Thread $thread_num: " . $current_iteration . " operations [" . $$ . "]\n";
+                 print "$SCRIPT_NAME - Thread $thread_num: " . $current_iteration . " operations [" . $$ . "]\n";
              }
              $current_iteration++;
          }
@@ -135,7 +138,7 @@ sub fork_and_create ($) {
              unlink("$path") if (-e $path);
          }
          
-         print "Thread $thread_num: Done.\n";
+         print "$SCRIPT_NAME - Thread $thread_num: Done.\n";
          
          exit 0;
 
@@ -159,16 +162,16 @@ sub do_open ($) {
     if ($use_mcreate) {
         my $tmp = `./mcreate $path`;
         if ($tmp) {
-            print  "Creating $path [" . $$."]...\n" if !$silent;
+            print  "$SCRIPT_NAME - Creating $path [" . $$."]...\n" if !$silent;
             $tmp =~ /.*error: (.*)\n/;
-            print  "Create done [$$] $path: $!\n" if !$silent;
+            print  "$SCRIPT_NAME - Create done [$$] $path: $!\n" if !$silent;
         } else {
-            print  "Create done [$$] $path: Success\n"if !$silent;
+            print  "$SCRIPT_NAME - Create done [$$] $path: Success\n"if !$silent;
         }
     } else {
-        print  "Opening $path [" . $$."]...\n"if !$silent;
+        print  "$SCRIPT_NAME - Opening $path [" . $$."]...\n"if !$silent;
         open(FH, ">$path") || die "open($path: $!";
-        print  "Open done [$$] $path: Success\n"if !$silent;
+        print  "$SCRIPT_NAME - Open done [$$] $path: Success\n"if !$silent;
         close(FH) || die;
     }
 }