X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fcreate.pl;h=f740c183be66fce80a1b533ab3edb03c0b93b4fe;hb=5a6aa0e6d1583cc0d4c82ae8c95fb7b9856d6284;hp=c5f3f12129ca049196d15a3e83e272988ae28bce;hpb=a2a0746305449dbd925879b14dc2c0d6040bb8bf;p=fs%2Flustre-release.git diff --git a/lustre/tests/create.pl b/lustre/tests/create.pl index c5f3f12..f740c18 100644 --- a/lustre/tests/create.pl +++ b/lustre/tests/create.pl @@ -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; } }