[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH RFC 8/9] mg-unixbench-download: make it generic
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@xxxxxxxxxx> --- ap-common | 4 ++++ mg-unixbench-download | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ap-common b/ap-common index 000ca69..ff0f205 100644 --- a/ap-common +++ b/ap-common @@ -140,3 +140,7 @@ info_linux_tree () { # 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} diff --git a/mg-unixbench-download b/mg-unixbench-download index 891b0b1..c4d5ab3 100755 --- a/mg-unixbench-download +++ b/mg-unixbench-download @@ -30,5 +30,20 @@ images=`getconfig Images`; 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 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |