Some distros such as ubuntu use dash as the default shell, and lmbench scripts use constructs incompatible with it. So, at least for ubuntu, let's change the shebangs from /bin/sh to /bin/bash.
The patch also re-masters the lmbench3.diff patch to have all the description of what it does. Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> --- .../0001-Fix-build-issues-with-lmbench.patch | 173 +++++++++++++++++ ...0002-Changing-shebangs-on-lmbench-scripts.patch | 204 ++++++++++++++++++++ client/tests/lmbench/lmbench.py | 5 +- client/tests/lmbench/lmbench3.diff | 148 -------------- 4 files changed, 381 insertions(+), 149 deletions(-) create mode 100644 client/tests/lmbench/0001-Fix-build-issues-with-lmbench.patch create mode 100644 client/tests/lmbench/0002-Changing-shebangs-on-lmbench-scripts.patch delete mode 100644 client/tests/lmbench/lmbench3.diff diff --git a/client/tests/lmbench/0001-Fix-build-issues-with-lmbench.patch b/client/tests/lmbench/0001-Fix-build-issues-with-lmbench.patch new file mode 100644 index 0000000..e9778b1 --- /dev/null +++ b/client/tests/lmbench/0001-Fix-build-issues-with-lmbench.patch @@ -0,0 +1,173 @@ +From 05546bfc9968a58e9569f2a8a9764f6e53f20167 Mon Sep 17 00:00:00 2001 +From: Lucas Meneghel Rodrigues <[email protected]> +Date: Thu, 8 Apr 2010 10:38:13 -0300 +Subject: [PATCH 1/2] Fix build issues with lmbench + +* removes Makefile references to bitkeeper +* default mail to no, fix job placement defaults (masouds) +* adds "config" Makefile targets to perform configuration only +* changes scripts/getlist to consider result files that do +* not start with "[lmbench 3.x..." (still requires such a line somewhere + in the first 1000 bytes of the file) +--- + Makefile | 4 ++++ + scripts/config-run | 13 ++++++++----- + scripts/getlist | 4 ++-- + src/Makefile | 44 ++++++-------------------------------------- + 4 files changed, 20 insertions(+), 45 deletions(-) + +diff --git a/Makefile b/Makefile +index d3d00f4..9a568f3 100644 +--- a/Makefile ++++ b/Makefile +@@ -5,6 +5,7 @@ + # + # build (default) go to the source directory and build the benchmark + # results go to the source directory and build and run the benchmark ++# config configures run parameters + # rerun run the benchmark again + # see see the results that came with this release + # Go to the results directory and read the Makefile. +@@ -22,6 +23,9 @@ build: + results: FRC + cd src && $(MAKE) results + ++config: ++ cd src && $(MAKE) config ++ + rerun: + cd src && $(MAKE) rerun + +diff --git a/scripts/config-run b/scripts/config-run +index b8c17d5..9958a31 100755 +--- a/scripts/config-run ++++ b/scripts/config-run +@@ -115,9 +115,12 @@ three attendent child processes sending data down the pipes and + three benchmark processes reading data and doing the measurements. + + EOF +- echo $ECHON "Job placement selection: $ECHOC" ++ echo $ECHON "Job placement selection [DEFAULT: 1]: $ECHOC" + read LMBENCH_SCHED + AGAIN=N ++ if [ "$LMBENCH_SCHED" == "" ]; then ++ LMBENCH_SCHED=1 ++ fi + case "$LMBENCH_SCHED" in + 1) LMBENCH_SCHED=DEFAULT;; + 2) LMBENCH_SCHED=BALANCED;; +@@ -657,13 +660,13 @@ fast box, they may be made available on the lmbench web page, which is + + EOF + +-echo $ECHON "Mail results [default yes] $ECHOC" ++echo $ECHON "Mail results [default no] $ECHOC" + read MAIL + case $MAIL in +- [Nn]*) MAIL=no +- echo OK, no results mailed. ++ [Yy]*) MAIL=yes ++ echo OK, results will be mailed. + ;; +- *) MAIL=yes ++ *) MAIL=no + ;; + esac + +diff --git a/scripts/getlist b/scripts/getlist +index 8c35970..f03b679 100755 +--- a/scripts/getlist ++++ b/scripts/getlist +@@ -22,9 +22,9 @@ if (-f $LIST) { + foreach $file (@files) { + next if $file =~ /\.INFO$/; + open(FD, $file) || next; +- next unless defined($_ = <FD>); ++ next unless read(FD, $_, 1000); + close(FD); +- next unless /^\[lmbench3.[01]/; ++ next unless /^\[lmbench3.[01]/m; + print "$file "; + } + print "\n"; +diff --git a/src/Makefile b/src/Makefile +index 2555014..cf0b779 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -4,6 +4,7 @@ + # + # lmbench [default] builds the benchmark suite for the current os/arch + # results builds, configures run parameters, and runs the benchmark ++# config configures run parameters + # rerun reruns the benchmark using the same parameters as last time + # scaling reruns the benchmark using same parameters as last time, + # except it asks what scaling value to use +@@ -118,8 +119,10 @@ results: lmbench + @env OS="${OS}" ../scripts/config-run + @env OS="${OS}" ../scripts/results + +-rerun: lmbench ++config: lmbench + @if [ ! -f $(CONFIG) ]; then env OS="${OS}" ../scripts/config-run; fi ++ ++rerun: lmbench config + @env OS="${OS}" ../scripts/results + + scaling: lmbench +@@ -165,41 +168,6 @@ debug: + assembler: + @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm + +-bk.ver: ../SCCS/s.ChangeSet +- rm -f bk.ver +- -echo `bk prs -hr+ -d'$$if(:SYMBOL:){:SYMBOL: }:UTC:' ../ChangeSet;` > bk.ver +- touch bk.ver +- +-dist: bk.ver +- @if [ "X`cd ..; bk sfiles -c`" != "X" ]; then \ +- echo "modified files!"; \ +- false; \ +- fi +- @if [ "X`cd ..; bk pending`" != "X" ]; then \ +- echo "pending changes!"; \ +- false; \ +- fi +- cd ..; \ +- SRCDIR=`pwd`; \ +- DIR=`basename $${SRCDIR}`; \ +- VERSION=`cat src/bk.ver| awk '{print $$1;}' | sed -e 's/Version-//g'`; \ +- cd ..; \ +- bk clone $${DIR} /tmp/lmbench-$${VERSION}; \ +- cd /tmp/lmbench-$${VERSION}; \ +- bk sfiles | xargs touch; \ +- sleep 5; \ +- bk get -s; \ +- for d in doc results scripts src; do \ +- cd $$d; bk get -s; cd ..; \ +- done; \ +- bk sfiles -U -g | xargs touch; \ +- cd src; \ +- make bk.ver; \ +- cd /tmp; \ +- tar czf $${SRCDIR}/../lmbench-$${VERSION}.tgz \ +- lmbench-$${VERSION}; \ +- rm -rf /tmp/lmbench-$${VERSION}; +- + get $(SRCS): + -get -s $(SRCS) + +@@ -228,9 +196,9 @@ testmake: $(SRCS) $(UTILS) # used by scripts/make to test gmake + install install-target dist get edit get-e clean clobber \ + share depend testmake + +-$O/lmbench : ../scripts/lmbench bk.ver ++$O/lmbench : ../scripts/lmbench + rm -f $O/lmbench +- sed -e "s/<version>/`cat bk.ver`/g" < ../scripts/lmbench > $O/lmbench ++ sed -e "s/<version>/666/g" < ../scripts/lmbench > $O/lmbench + chmod +x $O/lmbench + + $O/lmbench.a: $(LIBOBJS) +-- +1.6.6.1 + diff --git a/client/tests/lmbench/0002-Changing-shebangs-on-lmbench-scripts.patch b/client/tests/lmbench/0002-Changing-shebangs-on-lmbench-scripts.patch new file mode 100644 index 0000000..5e9dcdb --- /dev/null +++ b/client/tests/lmbench/0002-Changing-shebangs-on-lmbench-scripts.patch @@ -0,0 +1,204 @@ +From 7fc9ef8ce9ce630b53b20f1d4207c587df9b9763 Mon Sep 17 00:00:00 2001 +From: Lucas Meneghel Rodrigues <[email protected]> +Date: Thu, 8 Apr 2010 09:57:10 -0300 +Subject: [PATCH 2/2] Changing shebangs on lmbench scripts + +Some distros such as ubuntu use dash as the default +shell, and lmbench scripts use constructs incompatible +with it. So, at least for ubuntu, let's change the +shebangs from /bin/sh to /bin/bash. + +Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> +--- + scripts/build | 2 +- + scripts/compiler | 2 +- + scripts/config | 2 +- + scripts/config-run | 2 +- + scripts/config-scaling | 2 +- + scripts/do_ctx | 2 +- + scripts/info | 2 +- + scripts/lmbench | 2 +- + scripts/make | 2 +- + scripts/mkrelease | 2 +- + scripts/os | 2 +- + scripts/output | 2 +- + scripts/results | 2 +- + scripts/synchronize | 2 +- + scripts/target | 2 +- + scripts/version | 2 +- + scripts/xroff | 2 +- + 17 files changed, 17 insertions(+), 17 deletions(-) + +diff --git a/scripts/build b/scripts/build +index 16a6600..7f0d41e 100755 +--- a/scripts/build ++++ b/scripts/build +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + CC=${CC-`../scripts/compiler`} + MAKE=${MAKE-`../scripts/make`} +diff --git a/scripts/compiler b/scripts/compiler +index 2fca921..de57298 100755 +--- a/scripts/compiler ++++ b/scripts/compiler +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + if [ "X$CC" != "X" ] && echo "$CC" | grep -q '`' + then +diff --git a/scripts/config b/scripts/config +index b58cb60..2c0276d 100755 +--- a/scripts/config ++++ b/scripts/config +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + UNAME=`uname -n 2>/dev/null` + if [ X$UNAME = X ] +diff --git a/scripts/config-run b/scripts/config-run +index 9958a31..76ead34 100755 +--- a/scripts/config-run ++++ b/scripts/config-run +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # Configure parameters for lmbench. + # %I% %E% %...@% +diff --git a/scripts/config-scaling b/scripts/config-scaling +index 12e0f02..03f3e38 100755 +--- a/scripts/config-scaling ++++ b/scripts/config-scaling +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # config-scaling - reconfigure just the scaling parameter SYNC_MAX + # +diff --git a/scripts/do_ctx b/scripts/do_ctx +index 002a6c2..2b1db4c 100755 +--- a/scripts/do_ctx ++++ b/scripts/do_ctx +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # Make sure we can find: ./cmd, df, and netstat + PATH=.:$PATH:/etc:/usr/etc:/sbin:/usr/sbin +diff --git a/scripts/info b/scripts/info +index e6860ed..18a10b2 100755 +--- a/scripts/info ++++ b/scripts/info +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + UNAME=`uname -n 2>/dev/null` + if [ X$UNAME = X ] +diff --git a/scripts/lmbench b/scripts/lmbench +index 53ea511..63e5e07 100755 +--- a/scripts/lmbench ++++ b/scripts/lmbench +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # lmbench - run the lmbench benchmark suite. + # +diff --git a/scripts/make b/scripts/make +index 59bf238..2886ba6 100755 +--- a/scripts/make ++++ b/scripts/make +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + if [ "X$MAKE" != "X" ] && echo "$MAKE" | grep -q '`' + then +diff --git a/scripts/mkrelease b/scripts/mkrelease +index be50f03..656f9dd 100755 +--- a/scripts/mkrelease ++++ b/scripts/mkrelease +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # %W% + # +diff --git a/scripts/os b/scripts/os +index ea767c6..c9aed11 100755 +--- a/scripts/os ++++ b/scripts/os +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + if [ "X$OS" != "X" ] && echo "$OS" | grep -q '`' + then +diff --git a/scripts/output b/scripts/output +index 2a204e3..a27571a 100755 +--- a/scripts/output ++++ b/scripts/output +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + trap "echo /dev/null" 20 + OUTPUT=/dev/null; export OUTPUT + if [ -w /dev/tty ]; then +diff --git a/scripts/results b/scripts/results +index cd07c15..5f817d9 100755 +--- a/scripts/results ++++ b/scripts/results +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # $Id$ + +diff --git a/scripts/synchronize b/scripts/synchronize +index 302db00..eb36d5b 100755 +--- a/scripts/synchronize ++++ b/scripts/synchronize +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # %W% %...@% Copyright (c) 1998 Larry McVoy. + # +diff --git a/scripts/target b/scripts/target +index 77eee07..6998da9 100755 +--- a/scripts/target ++++ b/scripts/target +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # Figure out the OS name if possible. + # +diff --git a/scripts/version b/scripts/version +index 879b700..9e6bf6c 100755 +--- a/scripts/version ++++ b/scripts/version +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # %W% %...@% + +diff --git a/scripts/xroff b/scripts/xroff +index d5acf20..02c61d2 100755 +--- a/scripts/xroff ++++ b/scripts/xroff +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # X previewer like groff/nroff scripts. + groff -P -filename -P "| groff -Z -X -Tps $*" -X -Tps "$@" +-- +1.6.6.1 + diff --git a/client/tests/lmbench/lmbench.py b/client/tests/lmbench/lmbench.py index e440f50..33a86b4 100644 --- a/client/tests/lmbench/lmbench.py +++ b/client/tests/lmbench/lmbench.py @@ -28,7 +28,10 @@ class lmbench(test.test): tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) utils.extract_tarball_to_dir(tarball, self.srcdir) os.chdir(self.srcdir) - utils.system('patch -p1 < ../lmbench3.diff') + p1 = 'patch -p1 < ../0001-Fix-build-issues-with-lmbench.patch' + p2 = 'patch -p1 < ../0002-Changing-shebangs-on-lmbench-scripts.patch' + utils.system(p1) + utils.system(p2) # build lmbench utils.system('make') diff --git a/client/tests/lmbench/lmbench3.diff b/client/tests/lmbench/lmbench3.diff deleted file mode 100644 index f6b268b..0000000 --- a/client/tests/lmbench/lmbench3.diff +++ /dev/null @@ -1,148 +0,0 @@ -diff -urw lmbench3.old/Makefile lmbench3/Makefile ---- lmbench3.old/Makefile 2005-08-22 17:19:55.000000000 -0700 -+++ lmbench3/Makefile 2009-12-02 15:55:29.000000000 -0800 -@@ -5,6 +5,7 @@ - # - # build (default) go to the source directory and build the benchmark - # results go to the source directory and build and run the benchmark -+# config configures run parameters - # rerun run the benchmark again - # see see the results that came with this release - # Go to the results directory and read the Makefile. -@@ -22,6 +23,9 @@ - results: FRC - cd src && $(MAKE) results - -+config: -+ cd src && $(MAKE) config -+ - rerun: - cd src && $(MAKE) rerun - -diff -urw lmbench3.old/scripts/config-run lmbench3/scripts/config-run ---- lmbench3.old/scripts/config-run 2005-08-22 17:19:55.000000000 -0700 -+++ lmbench3/scripts/config-run 2009-12-03 15:03:46.000000000 -0800 -@@ -115,9 +115,12 @@ - three benchmark processes reading data and doing the measurements. - - EOF -- echo $ECHON "Job placement selection: $ECHOC" -+ echo $ECHON "Job placement selection [DEFAULT: 1]: $ECHOC" - read LMBENCH_SCHED - AGAIN=N -+ if [ "$LMBENCH_SCHED" == "" ]; then -+ LMBENCH_SCHED=1 -+ fi - case "$LMBENCH_SCHED" in - 1) LMBENCH_SCHED=DEFAULT;; - 2) LMBENCH_SCHED=BALANCED;; -@@ -657,13 +660,13 @@ - - EOF - --echo $ECHON "Mail results [default yes] $ECHOC" -+echo $ECHON "Mail results [default no] $ECHOC" - read MAIL - case $MAIL in -- [Nn]*) MAIL=no -- echo OK, no results mailed. -+ [Yy]*) MAIL=yes -+ echo OK, results will be mailed. - ;; -- *) MAIL=yes -+ *) MAIL=no - ;; - esac - -diff -urw lmbench3.old/scripts/getlist lmbench3/scripts/getlist ---- lmbench3.old/scripts/getlist 2005-08-22 17:19:55.000000000 -0700 -+++ lmbench3/scripts/getlist 2009-12-01 17:52:29.000000000 -0800 -@@ -22,9 +22,9 @@ - foreach $file (@files) { - next if $file =~ /\.INFO$/; - open(FD, $file) || next; -- next unless defined($_ = <FD>); -+ next unless read(FD, $_, 1000); - close(FD); -- next unless /^\[lmbench3.[01]/; -+ next unless /^\[lmbench3.[01]/m; - print "$file "; - } - print "\n"; -diff -urw lmbench3.old/src/Makefile lmbench3/src/Makefile ---- lmbench3.old/src/Makefile 2005-08-22 17:19:54.000000000 -0700 -+++ lmbench3/src/Makefile 2009-12-02 15:55:22.000000000 -0800 -@@ -4,6 +4,7 @@ - # - # lmbench [default] builds the benchmark suite for the current os/arch - # results builds, configures run parameters, and runs the benchmark -+# config configures run parameters - # rerun reruns the benchmark using the same parameters as last time - # scaling reruns the benchmark using same parameters as last time, - # except it asks what scaling value to use -@@ -118,8 +119,10 @@ - @env OS="${OS}" ../scripts/config-run - @env OS="${OS}" ../scripts/results - --rerun: lmbench -+config: lmbench - @if [ ! -f $(CONFIG) ]; then env OS="${OS}" ../scripts/config-run; fi -+ -+rerun: lmbench config - @env OS="${OS}" ../scripts/results - - scaling: lmbench -@@ -165,41 +168,6 @@ - assembler: - @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm - --bk.ver: ../SCCS/s.ChangeSet -- rm -f bk.ver -- -echo `bk prs -hr+ -d'$$if(:SYMBOL:){:SYMBOL: }:UTC:' ../ChangeSet;` > bk.ver -- touch bk.ver -- --dist: bk.ver -- @if [ "X`cd ..; bk sfiles -c`" != "X" ]; then \ -- echo "modified files!"; \ -- false; \ -- fi -- @if [ "X`cd ..; bk pending`" != "X" ]; then \ -- echo "pending changes!"; \ -- false; \ -- fi -- cd ..; \ -- SRCDIR=`pwd`; \ -- DIR=`basename $${SRCDIR}`; \ -- VERSION=`cat src/bk.ver| awk '{print $$1;}' | sed -e 's/Version-//g'`; \ -- cd ..; \ -- bk clone $${DIR} /tmp/lmbench-$${VERSION}; \ -- cd /tmp/lmbench-$${VERSION}; \ -- bk sfiles | xargs touch; \ -- sleep 5; \ -- bk get -s; \ -- for d in doc results scripts src; do \ -- cd $$d; bk get -s; cd ..; \ -- done; \ -- bk sfiles -U -g | xargs touch; \ -- cd src; \ -- make bk.ver; \ -- cd /tmp; \ -- tar czf $${SRCDIR}/../lmbench-$${VERSION}.tgz \ -- lmbench-$${VERSION}; \ -- rm -rf /tmp/lmbench-$${VERSION}; -- - get $(SRCS): - -get -s $(SRCS) - -@@ -228,9 +196,9 @@ - install install-target dist get edit get-e clean clobber \ - share depend testmake - --$O/lmbench : ../scripts/lmbench bk.ver -+$O/lmbench : ../scripts/lmbench - rm -f $O/lmbench -- sed -e "s/<version>/`cat bk.ver`/g" < ../scripts/lmbench > $O/lmbench -+ sed -e "s/<version>/666/g" < ../scripts/lmbench > $O/lmbench - chmod +x $O/lmbench - - $O/lmbench.a: $(LIBOBJS) -- 1.6.6.1 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
