aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-06-19 11:36:24 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2021-07-30 12:21:13 +0000
commitef1a2282f224e0201f1fb42125c1dcf020049501 (patch)
tree0174901c7a20c5d66e0c5f7680de4c8af228782b
parent802c3e0ed6259b276b4e8274b974e255f363cd21 (diff)
Rework installation procedure
Clone the CPU2006.git repo instead of installing from a tarball. Remove unused features. Change-Id: Id4ec5ce6eca37cf1d7b727fdee3ec388055c09b4
-rwxr-xr-xrun.sh89
-rwxr-xr-xspec2xxx-install123
2 files changed, 83 insertions, 129 deletions
diff --git a/run.sh b/run.sh
index 73927c5..a48c413 100755
--- a/run.sh
+++ b/run.sh
@@ -170,40 +170,71 @@ else
ignore_errors_opt=""
fi
-cpus=(1 2 3 0)
-outputdir=${nodename}-0123-0
+mapfile -t cpus < <(seq 1 $(($(nproc --all) - 1)); echo 0)
-installdir=$HOME/${outputdir}
+installdir=$HOME/$nodename
mkdir -p ${installdir}
-# Prepare bench sources etc...
-if [ ! -d $HOME/tarballs ]; then
- git clone ssh://git@dev-private-git.linaro.org/restricted-benchmarks/tarballs.git $HOME/tarballs
-else
- git -C $HOME/tarballs remote update -p
- git -C $HOME/tarballs reset --hard origin/master
-fi
-sha1=$(git -C $HOME/tarballs log -n1 --pretty=format:%h)
-mode=$(getconf LONG_BIT)
-
# Clean old results if requested (to make some free space)
for spec in $installdir/cpu2006-*; do
if [ x"$clean_older_than" != x"" ] && [ -d $spec/result ]; then
find $spec/result -depth "(" -type f -o -type l ")" -mtime +$clean_older_than -exec rm {} \;
find $spec/result -depth -empty -delete # removes empty dirs
fi
+ # Remove SPEC installs with no results (i.e., stale unused versions).
+ if ! [ -d $spec/result ]; then
+ needed=false
+ for cpu in "${cpus[@]}"; do
+ if [ x"$spec" = x"$installdir/cpu2006-$hw_tag-$cpu" ]; then
+ needed=true
+ fi
+ done
+ if ! $needed; then
+ rm -rf $spec
+ fi
+ fi
done
-for cpu in "${cpus[@]}"
-do
- if ${forceinstall} ; then
- rm -rf ${installdir}/cpu2006-$sha1-$mode-$cpu
- fi
- if [ ! -d ${installdir}/cpu2006-$sha1-$mode-$cpu ]; then
- ${mydir}/spec2xxx-install -d ${installdir}/cpu2006-$sha1-$mode-$cpu $HOME/tarballs/cpu2006-1.2-linaro.tar.xz
+sha1=$(git ls-remote ssh://dev-private-git.linaro.org/restricted-benchmarks/CPU2006 refs/heads/master | cut -f 1)
+
+pids=()
+for cpu in "${cpus[@]}"; do
+ (
+ delete=$forceinstall
+ if [ -d $installdir/cpu2006-$hw_tag-$cpu ] \
+ && [ x"$(git -C $installdir/cpu2006-$hw_tag-$cpu rev-parse HEAD)" \
+ != x"$sha1" ]; then
+ delete=true
+ fi
+ if $delete; then
+ rm -rf ${installdir}/cpu2006-$hw_tag-$cpu
+ fi
+ if [ ! -d ${installdir}/cpu2006-$hw_tag-$cpu ]; then
+ ${mydir}/spec2xxx-install -v \
+ -d ${installdir}/cpu2006-$hw_tag-$cpu \
+ -s cpu2006
+ fi
+ ) &
+ pids+=($!)
+ # Avoid bashing on the git server too much
+ sleep 10
+done
+
+status=0
+
+echo "Note: Waiting for cpu2006-$hw_tag-* to install"
+for pid in "${pids[@]}"; do
+ result=0; wait $pid || result=$?
+ if [ $result != 0 ]; then
+ status=1
fi
done
+if [ $status != 0 ]; then
+ echo "ERROR: Failed installing cpu2006-$hw_tag-*"
+ exit $status
+fi
+
if [ x"$sysroot" != x"" ]; then
sysroot_remote=${sysroot%:*}
sysroot_dir=${sysroot##*:}
@@ -229,7 +260,7 @@ do
--perf-bin "/usr/lib/linux-tools/$hw_tag/perf" \
--helpercpu 0 --profiler perf -e cycles/period=20HZ/u \
--perf-buildid-dir local --save-temps $sysroot_opt \
- --toolchain $toolchain -v ${installdir}/cpu2006-$sha1-$mode-$cpu
+ --toolchain $toolchain -v ${installdir}/cpu2006-$hw_tag-$cpu
done
declare -A bmks
@@ -274,8 +305,6 @@ do
esac
done
-status=0
-
# Build the benchmarks
pids=()
for cpu in "${cpus[@]}"
@@ -283,7 +312,7 @@ do
# If nothing to run on this cpu, continue
[ x"${bmks[${cpu}]}" = x ] && continue
(
- cd ${installdir}/cpu2006-$sha1-$mode-$cpu
+ cd ${installdir}/cpu2006-$hw_tag-$cpu
set +x
. shrc
$verbose
@@ -305,7 +334,7 @@ done
# Close ssh connection used for building
for cpu in "${cpus[@]}"; do
- cleanup=${installdir}/cpu2006-$sha1-$mode-$cpu/bin/ssh-$config-finish_build
+ cleanup=${installdir}/cpu2006-$hw_tag-$cpu/bin/ssh-$config-finish_build
if [ -e $cleanup ]; then
$cleanup
fi
@@ -315,7 +344,7 @@ if $ignore_errors; then
# Remove failed-to-build benchmarks from run lists.
# Otherwise we will try to build them again.
for cpu in "${cpus[@]}"; do
- failed_csv="${installdir}/cpu2006-$sha1-$mode-$cpu/result/failed.$config.csv.build.$cpu"
+ failed_csv="${installdir}/cpu2006-$hw_tag-$cpu/result/failed.$config.csv.build.$cpu"
if [ ! -f "$failed_csv" ]; then
continue
fi
@@ -338,7 +367,7 @@ for cpu in "${cpus[@]}"; do
# If nothing to run on this cpu, continue
[ x"${bmks[${cpu}]}" = x ] && continue
(
- cd ${installdir}/cpu2006-$sha1-$mode-$cpu
+ cd ${installdir}/cpu2006-$hw_tag-$cpu
set +x
. shrc
$verbose
@@ -371,9 +400,9 @@ fi
# FIXME: Support other armv8 boards besides the tx1.
for cpu in "${cpus[@]}"
do
- if [[ ${mode} == 32 && ${nodename} =~ .*-tx1-.* ]]; then
- echo "Removing SPEC installation at ${installdir}/cpu2006-$sha1-$mode-$cpu"
- rm -rf ${installdir}/cpu2006-$sha1-$mode-$cpu
+ if [ x"$hw_tag" = x"tx1_32" ]; then
+ echo "Removing SPEC installation at ${installdir}/cpu2006-$hw_tag-$cpu"
+ rm -rf ${installdir}/cpu2006-$hw_tag-$cpu
fi
done
diff --git a/spec2xxx-install b/spec2xxx-install
index 12620d0..8443b83 100755
--- a/spec2xxx-install
+++ b/spec2xxx-install
@@ -2,9 +2,6 @@
set -e
-dest_dir="`pwd`"
-version=""
-
while getopts "d:s:v" OPTION; do
case $OPTION in
d) dest_dir="$OPTARG" ;;
@@ -19,37 +16,34 @@ if [ -e "$dest_dir" ]; then
exit 1
fi
-mkdir "$dest_dir"
+mkdir -p "$dest_dir"
-tarball="$1"
-shift
-if ! [ -f "$tarball" ]; then
- echo "ERROR: Wrong SPEC tarball: $tarball"
- exit 1
-fi
+case "$version" in
+ "cpu2000"*) git_repo="CPU2000.git" ;;
+ "cpu2006"*) git_repo="CPU2006.git" ;;
+ *)
+ echo "UNKNOWN SPEC VERSION: $version"
+ exit 1
+ ;;
+esac
if [ $# -gt 0 ]; then
echo "ERROR: Extra arguments: $@"
exit 1
fi
-if [ x"$version" = x"" ]; then
- case "$tarball" in
- *"2000"*"1.3"*) version="cpu2000v1.3" ;;
- *"2006"*"1.2"*) version="cpu2006v1.2" ;;
- esac
+branch=""
+if [ x"$version" = x"${version%v*}" ]; then
+ branch="-b master --single-branch"
fi
-case "$version" in
- "cpu2000v1.3") ;;
- "cpu2006v1.2") ;;
- *)
- echo UNKNOWN SPEC VERSION TAR: $tar
- exit 1
- ;;
-esac
+git clone $branch --reference "/home/shared/git/$git_repo" \
+ "ssh://dev-private-git.linaro.org/restricted-benchmarks/$git_repo" \
+ "$dest_dir"
-cat $tarball | (cd $dest_dir && tar --strip-components=1 -xJ && chmod -R +w ./)
+if [ x"$version" = x"${version%v*}" ]; then
+ version="${version}v$(cat "$dest_dir/version.txt")"
+fi
cpu="$(uname -m)"
case "$cpu" in
@@ -58,90 +52,21 @@ case "$cpu" in
;;
esac
-toolstar=""
case "$version" in
- "cpu2000v1.3")
+ "cpu2000"*)
case "$cpu" in
"x86_64") arch=linux-glibc22-x86_64 ;;
"ia32") arch=linux-redhat62-ia32 ;;
- "armv7l")
- arch=linux-armv7l
- toolstar=linux-armv7l-122.tar.bz2
- ;;
- "aarch64")
- arch=linux-aarch64
- toolstar=linux-aarch64-122.tar.bz2
- ;;
- *)
- toolstar="build"
- ;;
+ "armv7l") arch=linux-armv7l ;;
+ "aarch64") arch=linux-aarch64 ;;
esac
;;
- "cpu2006v1.2")
+ "cpu2006"*)
case "$cpu" in
"x86_64") arch=linux-suse10-amd64 ;;
"ia32") arch=linux-redhat62-ia32 ;;
- "armv7l")
- arch=linux-armv7l
- toolstar=linux-armv7l-118.tar
- ;;
- "aarch64")
- arch=linux-apm-arm64
- toolstar=linux-apm-arm64-118.tar
- ;;
- *)
- toolstar="build"
- ;;
- esac
- ;;
-esac
-
-case "$toolstar" in
- "") ;;
- "build")
- arch="linux-$cpu"
-
- # Make sure bash is used for building perl
- echo "/bin/bash \$@" > $dest_dir/bin/sh
- chmod +x $dest_dir/bin/sh
-
- case "$version" in
- "cpu2000v1.3")
- # Patch up specmd5sum
- sed -i -e "/^int/d" -e "/^getline/d" -e "/^getdelim/d" \
- $dest_dir/tools/src/specmd5sum/lib/getline.h
-
- # Patch up perl sources
- sed -i -e "s#command line#command\.line#" \
- $dest_dir/tools/src/perl-5.8.7/makedepend.SH
- sed -i -e "/asm\/page.h/d" \
- $dest_dir/tools/src/perl-5.8.7/ext/IPC/SysV/SysV.xs
- ;;
- esac
-
- # Find where libm.so and libdl.so are
- libpth=$(ssh $target find /usr -name libm.so | sed -e "s#/libm.so##")
- # config.guess can be too old to know about new architecture.
- configflags="--build=$cpu-unknown-linux-gnu"
-
- ssh $target "cd $dest_dir && PATH=$dest_dir/bin:\$PATH PERLFLAGS='-A libs=-lm -A libs=-ldl -A libs=-lcrypt -Dlibpth=$libpth' CONFIGFLAGS=\"$configflags\" $dest_dir/tools/src/buildtools && . shrc && packagetools $arch"
-
- # Clean up
- rm $dest_dir/bin/sh
-
- # Copy newly-built tools to the scripts dir
- cp $dest_dir/$arch-*.tar* $(dirname $0)/
- ;;
- *)
- case "$version" in
- "cpu2000"*)
- cat $(dirname $0)/$toolstar \
- | (cd $dest_dir && tar -xj && chmod -R +w ./)
- ;;
- "cpu2006"*)
- cat $(dirname $0)/$toolstar \
- | (cd $dest_dir && tar -x && chmod -R +w ./)
- ;;
+ "armv7l") arch=linux-armv7l ;;
+ "aarch64") arch=linux-apm-arm64 ;;
esac
;;
esac