Me@0: #!/usr/bin/perl Me@0: Me@0: # perl script that calls loop extraction on every trace in the Me@0: # standard location for full traces Me@0: # For each trace, Me@0: # create a directory to hold the extracted loops, Me@0: # gunzip the trace and pipe it to the java statement that runs Me@0: # runs the extraction program, passing it the just-created Me@0: # directory to put the extracted loops into Me@0: Me@0: $BAADRootDir = $ARGV[0]; Me@0: Me@0: print "$BAADRootDir\n"; Me@0: Me@0: #Set where the extraction program directory is Me@0: $extractorDir = "$BAADRootDir/1__Development/0__Code_Dev/". Me@0: "2__DepQ_loop_paper/LoopExtractor/dist"; Me@0: Me@0: # String used to run extractor Me@0: $extractCmd = "java -jar $extractorDir/LoopExtractor.jar"; Me@0: Me@0: $tracesBaseDir = "$BAADRootDir/1__Development/2__Traces_and_Runs". Me@0: "/8__Traces_shared/full_traces_Fmt4"; Me@0: Me@0: $loopsBaseDir = "$BAADRootDir/1__Development/". Me@0: "2__Traces_and_Runs/8__Traces_shared/loop_files/full_loop_traces"; Me@0: Me@0: Me@0: Me@0: # grab all file names in current directory Me@0: # Expecting to be in the directory with all the trace files to be Me@0: # processed Me@0: print "tracesDir: $tracesBaseDir\n"; Me@0: print "loopsDir: $loopsBaseDir\n"; Me@0: $dired = `ls $tracesBaseDir`; Me@0: @fileNames = split("\n", $dired); Me@0: Me@0: @fileNames = ("",""); Me@0: Me@0: # filter filenames so have only trace files Me@0: # then extract benchmark name and architecture name from file name Me@0: foreach $fileName (@fileNames) Me@0: { print "filename: $fileName\n"; Me@0: if ($fileName =~ /trace_(\w+)_X0_(\w+)\.gz/) Me@0: { $traceName = $fileName; Me@0: $benchName = $1; Me@0: print "benchmark: $benchName\n"; Me@0: $tracePath = "$tracesBaseDir/$fileName"; Me@0: Me@0: # make directory to hold extracted loops Me@0: $loopDir = "$loopsBaseDir/$benchName"; Me@0: print "loopDir: $loopDir\n"; Me@0: `mkdir -p $loopDir`; Me@0: Me@0: # run the extraction program Me@0: print `zcat $tracePath | $extractCmd $loopDir`; Me@0: `gzip $loopDir/*.trace`; Me@0: } Me@0: } Me@0: