Skip to content

Commit

Permalink
Use *_HOME' instead of *_PATH' variable names consistently.
Browse files Browse the repository at this point in the history
Use `HOME' to identify a single directory; use `PATH' to identify
a list of directories.
  • Loading branch information
eeide committed May 25, 2011
1 parent 9cbc259 commit 90fb2dc
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 99 deletions.
18 changes: 9 additions & 9 deletions utah/scripts/coverage/README.COV
Expand Up @@ -3,11 +3,11 @@

************************************************************
- Quick start to build optimized compilers:
* setup $COV_BASE_PATH environment, e.g in bash:
export COV_BASE_PATH=/uusoc/exports/scratch/chenyang/branch-test,
* setup $COV_BASE_HOME environment, e.g in bash:
export COV_BASE_HOME=/uusoc/exports/scratch/chenyang/branch-test,
where holds all coverage stuff

* cd $COV_BASE_PATH
* cd $COV_BASE_HOME
mkdir sources

and check out csmith:
Expand All @@ -18,17 +18,17 @@

* ./build_gcov_compilers.pl -enable-opt

* optimized gcc and clang were installed in $COV_BASE_PATH/bin
* optimized gcc and clang were installed in $COV_BASE_HOME/bin

************************************************************

- Coverage test steps:

* setup $COV_BASE_PATH environment, e.g in bash:
export COV_BASE_PATH=/uusoc/exports/scratch/chenyang/branch-test,
* setup $COV_BASE_HOME environment, e.g in bash:
export COV_BASE_HOME=/uusoc/exports/scratch/chenyang/branch-test,
where holds all coverage stuff

* cd $COV_BASE_PATH
* cd $COV_BASE_HOME
mkdir sources

and check out csmith:
Expand All @@ -41,11 +41,11 @@

* run build_gcov_compilers.pl script, which will:

- download compilers sources to $COV_BASE_PATH/sources;
- download compilers sources to $COV_BASE_HOME/sources;

- build compilers with appropriate options

- install compilers to $COV_BASE_PATH
- install compilers to $COV_BASE_HOME

* run gen_cov.pl, which will run coverage tests for llvm and gcc.
For each tested compilers, the script will:
Expand Down
48 changes: 24 additions & 24 deletions utah/scripts/coverage/build_gcov_compilers.pl
Expand Up @@ -10,19 +10,19 @@

my $CPUS = Sys::CPU::cpu_count();

my $COV_BASE_PATH = $ENV{"COV_BASE_PATH"};
my $COV_BASE_HOME = $ENV{"COV_BASE_HOME"};

########################################################

#die "please set env $COV_BASE_PATH first!"
# if (!defined($COV_BASE_PATH));
#die "please set env $COV_BASE_HOME first!"
# if (!defined($COV_BASE_HOME));

# for my convenience
if (!defined($COV_BASE_PATH)) {
$COV_BASE_PATH = "/uusoc/exports/scratch/chenyang/tmp/branch_test";
if (!defined($COV_BASE_HOME)) {
$COV_BASE_HOME = "/uusoc/exports/scratch/chenyang/tmp/branch_test";
}

my $COMPILER_SOURCES_PATH = "$COV_BASE_PATH/sources";
my $COMPILER_SOURCES_HOME = "$COV_BASE_HOME/sources";

my @compilers = (
"gcc",
Expand All @@ -32,12 +32,12 @@
);

my %paths = (
"gcc" => ["$COMPILER_SOURCES_PATH", "current-gcc"],
"llvm" => ["$COMPILER_SOURCES_PATH", "llvm"],
"llvm-regular" => ["$COMPILER_SOURCES_PATH", "llvm-regular"],
"llvm-gcc" => ["$COMPILER_SOURCES_PATH", "llvm-gcc-4.2"],
"clang" => ["$COMPILER_SOURCES_PATH/llvm/tools", "clang"],
"llvm-testsuite" => ["$COMPILER_SOURCES_PATH/llvm/projects", "test-suite"],
"gcc" => ["$COMPILER_SOURCES_HOME", "current-gcc"],
"llvm" => ["$COMPILER_SOURCES_HOME", "llvm"],
"llvm-regular" => ["$COMPILER_SOURCES_HOME", "llvm-regular"],
"llvm-gcc" => ["$COMPILER_SOURCES_HOME", "llvm-gcc-4.2"],
"clang" => ["$COMPILER_SOURCES_HOME/llvm/tools", "clang"],
"llvm-testsuite" => ["$COMPILER_SOURCES_HOME/llvm/projects", "test-suite"],
);

my %svn_dependencies = (
Expand Down Expand Up @@ -67,12 +67,12 @@
my $enable_optimized = "";

my %config_options = (
"gcc" => "--prefix=$COV_BASE_PATH --program-prefix=current- --enable-languages=c,c++ --enable-lto --enable-coverage --disable-bootstrap",
"gcc-opt" => "--prefix=$COV_BASE_PATH --program-prefix=current- --enable-languages=c,c++ --enable-lto --enable-coverage=opt --disable-bootstrap",
"llvm" => "--prefix=$COV_BASE_PATH",
"llvm-opt" => "--prefix=$COV_BASE_PATH --enable-optimized",
"llvm-regular" => "--prefix=$COV_BASE_PATH --enable-optimized",
"llvm-gcc" => "--prefix=$COV_BASE_PATH --enable-languages=c,c++ --program-prefix=llvm- --enable-checking --enable-llvm=$COMPILER_SOURCES_PATH/llvm-regular/build --disable-bootstrap --disable-multilib",
"gcc" => "--prefix=$COV_BASE_HOME --program-prefix=current- --enable-languages=c,c++ --enable-lto --enable-coverage --disable-bootstrap",
"gcc-opt" => "--prefix=$COV_BASE_HOME --program-prefix=current- --enable-languages=c,c++ --enable-lto --enable-coverage=opt --disable-bootstrap",
"llvm" => "--prefix=$COV_BASE_HOME",
"llvm-opt" => "--prefix=$COV_BASE_HOME --enable-optimized",
"llvm-regular" => "--prefix=$COV_BASE_HOME --enable-optimized",
"llvm-gcc" => "--prefix=$COV_BASE_HOME --enable-languages=c,c++ --program-prefix=llvm- --enable-checking --enable-llvm=$COMPILER_SOURCES_HOME/llvm-regular/build --disable-bootstrap --disable-multilib",
);

my %make_options = (
Expand Down Expand Up @@ -245,7 +245,7 @@ ()

download($program, $path, $dir, $svn_repo);

my $working_dir = "$COMPILER_SOURCES_PATH/llvm/build";
my $working_dir = "$COMPILER_SOURCES_HOME/llvm/build";
print "chaning to $working_dir\n";
chdir $working_dir or die;

Expand All @@ -261,7 +261,7 @@ ()
my $res = runit($cp_cmd);
die "Can't exec $cp_cmd" if ($res != 0);

$ENV{"PATH"} = "$COV_BASE_PATH/bin:$ENV{'PATH'}";
$ENV{"PATH"} = "$COV_BASE_HOME/bin:$ENV{'PATH'}";
my $opt = "";
$opt = "--enable-optimized" if (not ($enable_optimized eq ""));
$res = runit("../configure $opt");
Expand Down Expand Up @@ -310,11 +310,11 @@ ()
go_build();
}

if (!(-d $COV_BASE_PATH)) {
mkdir $COV_BASE_PATH or die;
if (!(-d $COV_BASE_HOME)) {
mkdir $COV_BASE_HOME or die;
}
if (!(-d "$COMPILER_SOURCES_PATH")) {
mkdir "$COMPILER_SOURCES_PATH" or die;
if (!(-d "$COMPILER_SOURCES_HOME")) {
mkdir "$COMPILER_SOURCES_HOME" or die;
}

main();
Expand Down
70 changes: 35 additions & 35 deletions utah/scripts/coverage/gen_cov.pl
Expand Up @@ -5,59 +5,59 @@
use Digest::MD5 qw(md5);
use File::stat;

my $COV_BASE_PATH = $ENV{"COV_BASE_PATH"};
my $COV_BASE_HOME = $ENV{"COV_BASE_HOME"};

#die "please set env $COV_BASE_PATH first!"
# if (!defined($COV_BASE_PATH));
#die "please set env $COV_BASE_HOME first!"
# if (!defined($COV_BASE_HOME));

# for my convenience
if (!defined($COV_BASE_PATH)) {
$COV_BASE_PATH = "/uusoc/exports/scratch/chenyang/branch-test";
if (!defined($COV_BASE_HOME)) {
$COV_BASE_HOME = "/uusoc/exports/scratch/chenyang/branch-test";
}

my $PATH = "$COV_BASE_PATH/bin";
my $COMPILER_SOURCES_PATH = "$COV_BASE_PATH/sources";
my $PATH = "$COV_BASE_HOME/bin";
my $COMPILER_SOURCES_HOME = "$COV_BASE_HOME/sources";

# tmp setting on bethe where expect was installed locally
# we don't need those if expect was installed via apt-get, etc
my $EXPECT_BASE_PATH = "$COV_BASE_PATH/expect/usr";
my $EXPECT_BASE_HOME = "$COV_BASE_HOME/expect/usr";

my $VOLATILE_PATH = "$COMPILER_SOURCES_PATH/volatile";
my $VOLATILE_HOME = "$COMPILER_SOURCES_HOME/volatile";

$PATH = "$EXPECT_BASE_PATH/bin:$VOLATILE_PATH:$PATH";
$PATH = "$EXPECT_BASE_HOME/bin:$VOLATILE_HOME:$PATH";

$ENV{"PATH"} = "$PATH:$ENV{'PATH'}";

if (defined($ENV{'LD_LIBRARY_PATH'})) {
$ENV{"LD_LIBRARY_PATH"} = "$EXPECT_BASE_PATH/lib:$ENV{'LD_LIBRARY_PATH'}";
$ENV{"LD_LIBRARY_PATH"} = "$EXPECT_BASE_HOME/lib:$ENV{'LD_LIBRARY_PATH'}";
}
else {
$ENV{"LD_LIBRARY_PATH"} = "$EXPECT_BASE_PATH/lib";
$ENV{"LD_LIBRARY_PATH"} = "$EXPECT_BASE_HOME/lib";
}

my $CSMITH_HOME = "$COMPILER_SOURCES_PATH/csmith";
my $CSMITH_HOME = "$COMPILER_SOURCES_HOME/csmith";
my $CSMITH = "$CSMITH_HOME/src/csmith";

my $LCOV_PATH = "$COMPILER_SOURCES_PATH/lcov-1.8/bin";
my $LCOV = "$LCOV_PATH/lcov";
my $LCOV_GEN_HTML = "$LCOV_PATH/genhtml";
my $COV_DATA_PATH = "$COV_BASE_PATH/test_data";
my $LCOV_HOME = "$COMPILER_SOURCES_HOME/lcov-1.8/bin";
my $LCOV = "$LCOV_HOME/lcov";
my $LCOV_GEN_HTML = "$LCOV_HOME/genhtml";
my $COV_DATA_HOME = "$COV_BASE_HOME/test_data";

my %compilers = (
"gcc" => "$COV_BASE_PATH/bin/current-gcc",
#"clang" => "$COV_BASE_PATH/bin/clang",
"llvm" => "$COV_BASE_PATH/bin/clang",
"gcc" => "$COV_BASE_HOME/bin/current-gcc",
#"clang" => "$COV_BASE_HOME/bin/clang",
"llvm" => "$COV_BASE_HOME/bin/clang",
);

my %compiler_build_paths = (
"gcc" => "$COMPILER_SOURCES_PATH/current-gcc/build",
"llvm" => "$COMPILER_SOURCES_PATH/llvm/build",
"clang" => "$COMPILER_SOURCES_PATH/llvm/build/tools/clang",
"llvm-testsuite" => "$COMPILER_SOURCES_PATH/llvm/build/projects/test-suite",
"gcc" => "$COMPILER_SOURCES_HOME/current-gcc/build",
"llvm" => "$COMPILER_SOURCES_HOME/llvm/build",
"clang" => "$COMPILER_SOURCES_HOME/llvm/build/tools/clang",
"llvm-testsuite" => "$COMPILER_SOURCES_HOME/llvm/build/projects/test-suite",
);

my %base_cov_dirs = (
"gcc" => "$COMPILER_SOURCES_PATH/current-gcc/build/gcc",
"gcc" => "$COMPILER_SOURCES_HOME/current-gcc/build/gcc",
);

my %base_checks = (
Expand Down Expand Up @@ -97,9 +97,9 @@

my $MIN_PROGRAM_SIZE = 10000;

my $CSMITH_OUT = "$COV_DATA_PATH/csmith_out";
my $CSMITH_OUT = "$COV_DATA_HOME/csmith_out";

my $TEST_FAILS_OUT = "$COV_DATA_PATH/compilers_fail_out.txt";
my $TEST_FAILS_OUT = "$COV_DATA_HOME/compilers_fail_out.txt";

my %prog_checksums = ();

Expand Down Expand Up @@ -308,9 +308,9 @@ ($$$)
sub gen_extended_cov() {
foreach my $compiler (keys %compilers) {
my $build_path = $compiler_build_paths{$compiler};
my $extended_lcov_info = "$COV_DATA_PATH/$compiler" . "_extended.info";
my $html_outdir = "$COV_DATA_PATH/${compiler}_html_ext";
my $summary = "$COV_DATA_PATH/${compiler}_summary_ext.txt";
my $extended_lcov_info = "$COV_DATA_HOME/$compiler" . "_extended.info";
my $html_outdir = "$COV_DATA_HOME/${compiler}_html_ext";
my $summary = "$COV_DATA_HOME/${compiler}_summary_ext.txt";

gen_lcov_info($compiler, $build_path, $extended_lcov_info);
gen_lcov_html($summary, $html_outdir, $extended_lcov_info);
Expand All @@ -320,18 +320,18 @@ ()
sub gen_base_cov() {
foreach my $compiler (keys %compilers) {
my $build_path = $compiler_build_paths{$compiler};
my $base_lcov_info = "$COV_DATA_PATH/$compiler.info";
my $html_outdir = "$COV_DATA_PATH/${compiler}_html";
my $summary = "$COV_DATA_PATH/${compiler}_summary.txt";
my $base_lcov_info = "$COV_DATA_HOME/$compiler.info";
my $html_outdir = "$COV_DATA_HOME/${compiler}_html";
my $summary = "$COV_DATA_HOME/${compiler}_summary.txt";

gen_base_cov_data($compiler);
gen_lcov_info($compiler, $build_path, $base_lcov_info);
gen_lcov_html($summary, $html_outdir, $base_lcov_info);
}
}

if (!(-d $COV_DATA_PATH)) {
mkdir "$COV_DATA_PATH";
if (!(-d $COV_DATA_HOME)) {
mkdir "$COV_DATA_HOME";
}

gen_base_cov();
Expand Down
20 changes: 10 additions & 10 deletions utah/scripts/coverage/parse_cov_results.pl
Expand Up @@ -5,20 +5,20 @@
use strict;


my $COV_BASE_PATH = $ENV{"COV_BASE_PATH"};
my $COV_BASE_HOME = $ENV{"COV_BASE_HOME"};

#die "please set env $COV_BASE_PATH first!"
# if (!defined($COV_BASE_PATH));
#die "please set env $COV_BASE_HOME first!"
# if (!defined($COV_BASE_HOME));

# for my convenience
if (!defined($COV_BASE_PATH)) {
$COV_BASE_PATH = "/uusoc/exports/scratch/chenyang/branch-test/test_data";
if (!defined($COV_BASE_HOME)) {
$COV_BASE_HOME = "/uusoc/exports/scratch/chenyang/branch-test/test_data";
}

my $COV_DATA_PATH = "$COV_BASE_PATH";
my $LN_OUT = "$COV_BASE_PATH/ln.out";
my $FN_OUT = "$COV_BASE_PATH/fn.out";
my $BR_OUT = "$COV_BASE_PATH/br.out";
my $COV_DATA_HOME = "$COV_BASE_HOME";
my $LN_OUT = "$COV_BASE_HOME/ln.out";
my $FN_OUT = "$COV_BASE_HOME/fn.out";
my $BR_OUT = "$COV_BASE_HOME/br.out";

my %base_overall_info = ();
my %ext_overall_info = ();
Expand Down Expand Up @@ -233,7 +233,7 @@ ($$$)

###########################################################

die "$COV_DATA_PATH doesn't exist!" if (!(-d $COV_DATA_PATH));
die "$COV_DATA_HOME doesn't exist!" if (!(-d $COV_DATA_HOME));

if (@ARGV != 3) {
help();
Expand Down
8 changes: 4 additions & 4 deletions utah/scripts/john_driver/evaluate_program.pl
Expand Up @@ -74,7 +74,7 @@
die "oops: CSMITH_HOME environment variable needs to be set"
if (!defined($CSMITH_HOME));

my $VOLATILE_PATH=$CSMITH_HOME."/utah/scripts/john_driver";
my $VOLATILE_HOME=$CSMITH_HOME."/utah/scripts/john_driver";

my $LOCKFN = "/var/tmp/version_search_lockfile";

Expand Down Expand Up @@ -697,7 +697,7 @@ ($$$$$$$)
}

if (1) {
system "cat $compilerout >> ${VOLATILE_PATH}/compiler_output.txt";
system "cat $compilerout >> ${VOLATILE_HOME}/compiler_output.txt";
}

if ($VALGRIND_ON_COMPILER) {
Expand Down Expand Up @@ -969,7 +969,7 @@ ($$$$$)
system "touch ../../${NOTEFILE_PREFIX}checksum_$compiler.txt";
$interesting = 1;
triage($compiler,
"$VOLATILE_PATH/test-${arch}-${base_compiler}-wrong-code-template.sh",
"$VOLATILE_HOME/test-${arch}-${base_compiler}-wrong-code-template.sh",
$opt1, $opt, $root, $base_compiler, $arch);
$consistent = 0;
last;
Expand All @@ -983,7 +983,7 @@ ($$$$$)
print "INTERNAL VOLATILE FAILURE${write_problem} $compiler $opt WRAP=$wrap\n";
$interesting = 1;
triage($compiler,
"$VOLATILE_PATH/test-${arch}-${base_compiler}-volatile-template.sh",
"$VOLATILE_HOME/test-${arch}-${base_compiler}-volatile-template.sh",
$opt1, $opt, $root, $base_compiler, $arch);
$consistent = 0;
last;
Expand Down
10 changes: 5 additions & 5 deletions utah/scripts/john_driver/random_test.pl
Expand Up @@ -57,9 +57,9 @@

if ($use_pintool) {
# Before you could use pintool to test volatile accesses, change the pintool location when necessary!
my $PIN_PATH = $ENV{"PIN_PATH"};
die "oops: PIN_PATH environment variable needs to be set"
if (!defined($PIN_PATH));
my $PIN_HOME = $ENV{"PIN_HOME"};
die "oops: PIN_HOME environment variable needs to be set"
if (!defined($PIN_HOME));

$XTRA .= " --enable-volatile-tests $platform --vol-addr-file $PINTOOL_VOL_ADDR ";
my $pin_cmd;
Expand All @@ -68,10 +68,10 @@
# i.e., obj-ia32/pinatrace.so for x86 and obj-intel64/pinatrace.so for x86_64.
# For testing compcert, we use the ia32 version
if (($platform eq "x86") || (not ($CSMITH_CCOMP eq ""))) {
$pin_cmd = "$PIN_PATH/ia32/bin/pinbin -t $PIN_PATH/source/tools/ManualExamples/obj-ia32/pinatrace.so -vol_input $PINTOOL_VOL_ADDR $PIN_MODE --";
$pin_cmd = "$PIN_HOME/ia32/bin/pinbin -t $PIN_HOME/source/tools/ManualExamples/obj-ia32/pinatrace.so -vol_input $PINTOOL_VOL_ADDR $PIN_MODE --";
}
elsif ($platform eq "x86_64") {
$pin_cmd = "$PIN_PATH/intel64/bin/pinbin -t $PIN_PATH/source/tools/ManualExamples/obj-intel64/pinatrace.so -vol_input $PINTOOL_VOL_ADDR $PIN_MODE --";
$pin_cmd = "$PIN_HOME/intel64/bin/pinbin -t $PIN_HOME/source/tools/ManualExamples/obj-intel64/pinatrace.so -vol_input $PINTOOL_VOL_ADDR $PIN_MODE --";
}
else {
die "Invalid platform[$platform] for pintool!";
Expand Down

0 comments on commit 90fb2dc

Please sign in to comment.