From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: [PATCH RFC 8/9] mg-unixbench-download: make it generic Date: Thu, 26 Jun 2014 15:03:20 +0200 Message-ID: <20140626130320.20110.90515.stgit@Solace> References: <20140626124540.20110.24159.stgit@Solace> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140626124540.20110.24159.stgit@Solace> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian.Jackson@citrix.com, Wei Liu , Ian.Campbell@citrix.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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 --- 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