so that it can handle the retrieval of different
benchmarks. The name of the benchmark to fetch should
be among the supported one, and is passed as an argument.
XXX This is a stab. As detailed in the cover letter, I
just wanted to give an idea of how things would look
like, if we take this path. I personally prefer it
like this, but let's talk about it.
Of course, if we decide to go this way, the name
will be changed from mg-unixbench-download to
mg-bench-download, and I'll structure the file
like this from the beginning.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
# UnixBench. By default we try to grab version 5.1.3
: ${REMOTEFILE_UNIXBENCH:=http://byte-unixbench.googlecode.com/files/unixbench-5.1.3.tgz}
: ${LOCALFILE_UNIXBENCH:=unixbench.tgz}
+
+# hackbench. By default, directly from mingo page!
+: ${REMOTEFILE_HACKBENCH:=http://people.redhat.com/mingo/cfs-scheduler/tools/hackbench.c}
+: ${LOCALFILE_HACKBENCH:=hackbench.c}
dstdir="${images}/benchs"
mkdir -p $dstdir
-wget ${REMOTEFILE_UNIXBENCH} -O ${dstdir}/${LOCALFILE_UNIXBENCH} || \
- fail "failed downloading the benchmark"
+for bench in "$@"; do
+ case $bench in
+ unixbench)
+ bench_url=${REMOTEFILE_UNIXBENCH}
+ bench_dst=${dstdir}/${LOCALFILE_UNIXBENCH}
+ ;;
+ hackbench)
+ bench_url=${REMOTEFILE_HACKBENCH}
+ bench_dst=${dstdir}/${LOCALFILE_HACKBENCH}
+ ;;
+ *)
+ fail "unknown benchmark $bench"
+ ;;
+ esac
+
+ wget ${bench_url} -O ${bench_dst} || fail "failed downloading ${bench}"
+done