summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-benchmark/lmbench
diff options
context:
space:
mode:
authorNoor Ahsan <noor_ahsan@mentor.com>2011-08-29 16:17:51 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2011-09-01 16:30:32 +0200
commita577b53823d5a0e078777a5fb56a1e3d776b3130 (patch)
treeacb6e7659046119b5407786b2f38b188d5019355 /meta-oe/recipes-benchmark/lmbench
parent5c36440b5721550c0b61f4d70af5f743223204fb (diff)
downloadmeta-openembedded-a577b53823d5a0e078777a5fb56a1e3d776b3130.tar.gz
lmbench: Add version 3.0-a9 (initial recipe)
* Imported from oe.dev commit id bac6441118e0b78d55c98afdc108f03b6c655909. Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-benchmark/lmbench')
-rw-r--r--meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/obey-ranlib.patch30
-rw-r--r--meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-results-script.patch160
-rw-r--r--meta-oe/recipes-benchmark/lmbench/lmbench/lmbench-run23
-rw-r--r--meta-oe/recipes-benchmark/lmbench/lmbench/rename-line-binary.patch19
-rw-r--r--meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb54
5 files changed, 286 insertions, 0 deletions
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/obey-ranlib.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/obey-ranlib.patch
new file mode 100644
index 000000000..41a3b3205
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/obey-ranlib.patch
@@ -0,0 +1,30 @@
1In some cases the host may have too old of a ranlib to work. Since it's
2not exactly a great idea to not be using the cross ranlib anyhow, fix the
3Makefile so we can override ranlib and then override it
4
5Upstream-Status: Inappropriate [build system specific change]
6---
7 src/Makefile | 3 ++-
8 1 file changed, 2 insertions(+), 1 deletion(-)
9
10Index: lmbench-3.0-a9/src/Makefile
11===================================================================
12--- lmbench-3.0-a9.orig/src/Makefile
13+++ lmbench-3.0-a9/src/Makefile
14@@ -38,6 +38,7 @@ CC=`../scripts/compiler`
15 MAKE=`../scripts/make`
16 AR=ar
17 ARCREATE=cr
18+RANLIB=ranlib
19
20 # base of installation location
21 BASE=/usr/local
22@@ -217,7 +218,7 @@ $O/lmbench : ../scripts/lmbench version.
23 $O/lmbench.a: $(LIBOBJS)
24 /bin/rm -f $O/lmbench.a
25 $(AR) $(ARCREATE) $O/lmbench.a $(LIBOBJS)
26- -ranlib $O/lmbench.a
27+ -$(RANLIB) $O/lmbench.a
28
29 $O/lib_timing.o : lib_timing.c $(INCS)
30 $(COMPILE) -c lib_timing.c -o $O/lib_timing.o
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-results-script.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-results-script.patch
new file mode 100644
index 000000000..894f146d4
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-results-script.patch
@@ -0,0 +1,160 @@
1Now that we have our binaries in /usr/bin rather than the normal
2lmbench hierarchy we need to update the scripts as well to behave well here.
3
4Upstream-Status: Inappropriate [This is related to the OE-specific behavior
5of installing into /usr/bin, etc, rather than dumping everything into
6/usr/share/lmbench or similar]
7
8Index: lmbench-3.0-a9/scripts/results
9===================================================================
10--- lmbench-3.0-a9.orig/scripts/results
11+++ lmbench-3.0-a9/scripts/results
12@@ -8,11 +8,11 @@ RESULTS=results/$OS
13 BASE=../$RESULTS/`uname -n`
14 EXT=0
15
16-if [ ! -f "../bin/$OS/$CONFIG" ]
17+if [ ! -f "$CONFIG" ]
18 then echo "No config file?"
19 exit 1
20 fi
21-. ../bin/$OS/$CONFIG
22+. $CONFIG
23
24 if [ ! -d ../$RESULTS ]
25 then mkdir -p ../$RESULTS
26@@ -23,11 +23,9 @@ do EXT=`expr $EXT + 1`
27 RESULTS=$BASE.$EXT
28 done
29
30-cd ../bin/$OS
31-PATH=.:${PATH}; export PATH
32 export SYNC_MAX
33 export OUTPUT
34-lmbench $CONFIG 2>../${RESULTS}
35+lmbench $CONFIG 2>${RESULTS}
36
37 if [ X$MAIL = Xyes ]
38 then echo Mailing results
39Index: lmbench-3.0-a9/scripts/config-run
40===================================================================
41--- lmbench-3.0-a9.orig/scripts/config-run
42+++ lmbench-3.0-a9/scripts/config-run
43@@ -132,20 +132,20 @@ export LMBENCH_SCHED
44 ############################################################################
45 echo $L; echo "";
46 echo "Hang on, we are calculating your timing granularity."
47-../bin/$OS/msleep 250
48-ENOUGH=`../bin/$OS/enough`
49+msleep 250
50+ENOUGH=`enough`
51 export ENOUGH
52 echo "OK, it looks like you can time stuff down to $ENOUGH usec resolution."
53 echo ""
54 echo "Hang on, we are calculating your timing overhead."
55-../bin/$OS/msleep 250
56-TIMING_O=`../bin/$OS/timing_o`
57+msleep 250
58+TIMING_O=`timing_o`
59 export TIMING_O
60 echo "OK, it looks like your gettimeofday() costs $TIMING_O usecs."
61 echo ""
62 echo "Hang on, we are calculating your loop overhead."
63-../bin/$OS/msleep 250
64-LOOP_O=`../bin/$OS/loop_o`
65+msleep 250
66+LOOP_O=`loop_o`
67 export LOOP_O
68 echo "OK, it looks like your benchmark loop costs $LOOP_O usecs."
69 echo ""
70@@ -177,7 +177,7 @@ then
71 fi
72 if [ X$MB = X ]
73 then $ECHON "Probing system for available memory: $ECHOC"
74- MB=`../bin/$OS/memsize 4096`
75+ MB=`memsize 4096`
76 fi
77 TOTAL_MEM=$MB
78 MB=`echo \( $MB \* 7 \) / 10 | bc 2>/dev/null`
79@@ -205,9 +205,9 @@ fi
80 # Certain machines tend to barf when you try and bcopy 8MB.
81 # Figure out how much we can use.
82 echo "Checking to see if you have $MB MB; please wait for a moment..."
83-MB=`../bin/$OS/memsize $MB`
84-MB=`../bin/$OS/memsize $MB`
85-MB=`../bin/$OS/memsize $MB`
86+MB=`memsize $MB`
87+MB=`memsize $MB`
88+MB=`memsize $MB`
89 if [ `expr $SYNC_MAX \* $MB` -gt `expr $TOTAL_MEM` ]
90 then
91 MB=`expr $TOTAL_MEM / $SYNC_MAX`
92@@ -223,8 +223,8 @@ then echo Warning: you have only ${MB}MB
93 fi
94
95 echo "Hang on, we are calculating your cache line size."
96-../bin/$OS/msleep 250
97-LINE_SIZE=`../bin/$OS/lm_line -M ${MB}M`
98+msleep 250
99+LINE_SIZE=`lm_line -M ${MB}M`
100 export LINE_SIZE
101 echo "OK, it looks like your cache line is $LINE_SIZE bytes."
102 echo ""
103@@ -479,7 +479,7 @@ EOF
104 then
105 for i in $disks
106 do if [ -r $i ]
107- then ../bin/$OS/flushdisk $i
108+ then flushdisk $i
109 if [ $? -eq 1 ]
110 then echo "Must be root to run disk benchmarks."
111 echo "Root is needed to flush the buffer cache"
112@@ -584,7 +584,7 @@ fi
113 echo $L
114 echo ""
115 echo "Calculating mhz, please wait for a moment..."
116-MHZ=`../bin/$OS/mhz`
117+MHZ=`mhz`
118 cat<<EOF
119 I think your CPU mhz is
120
121@@ -689,9 +689,9 @@ esac
122
123 INFO=`../scripts/info`
124 if [ $MAIL = yes ]
125-then if [ ! -f ../bin/$OS/$INFO ]
126- then cp ../scripts/info-template ../bin/$OS/$INFO
127- chmod +w ../bin/$OS/$INFO
128+then if [ ! -f $INFO ]
129+ then cp ../scripts/info-template $INFO
130+ chmod +w $INFO
131 REUSE=no
132 else
133 REUSE=view
134@@ -705,7 +705,7 @@ then if [ ! -f ../bin/$OS/$INFO ]
135 ;;
136 [Vv]*) REUSE=view
137 echo $L
138- more ../bin/$OS/$INFO
139+ more $INFO
140 echo $L
141 ;;
142 *) REUSE=yes
143@@ -733,7 +733,7 @@ EOF
144 then EDITOR=$TMP
145 fi
146 if [ X$EDITOR != "none" ]
147- then $EDITOR ../bin/$OS/`../scripts/info`
148+ then $EDITOR `../scripts/info`
149 fi
150 fi
151 fi
152@@ -750,7 +750,7 @@ EOF
153
154 VERSION=`../scripts/version`
155
156-C=../bin/$OS/`../scripts/config`
157+C=`../scripts/config`
158 echo DISKS=\"$DISKS\" > $C
159 echo DISK_DESC=\"$DISK_DESC\" >> $C
160 echo OUTPUT=$OUTPUT >> $C
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/lmbench-run b/meta-oe/recipes-benchmark/lmbench/lmbench/lmbench-run
new file mode 100644
index 000000000..e904c75e4
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench/lmbench-run
@@ -0,0 +1,23 @@
1#!/bin/sh
2# Wrapper script for lmbench written for the
3# Debian GNU/Linux distribution by
4# Javier Fernandez-Sanguino.
5# Distributed under the GPL
6SHAREDIR=/usr/share/lmbench/
7BINDIR=/usr/lib/lmbench/
8SCRIPTSDIR=$SHAREDIR/scripts
9RESULTSDIR=$SHAREDIR/results
10CONFIG=/var/lib/lmbench/config/`$SCRIPTSDIR/config`
11runuid=`id -u`
12
13[ $runuid -gt 0 ] && {
14 echo "You must run this as the root user"
15 exit 0
16}
17cd $SCRIPTSDIR
18[ ! -f $CONFIG ] && ./config-run
19./results
20
21echo "Benchmark run finished...."
22echo "Remember you can find the results of the benchmark "
23echo "under $RESULTSDIR"
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/rename-line-binary.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/rename-line-binary.patch
new file mode 100644
index 000000000..9a405213a
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench/rename-line-binary.patch
@@ -0,0 +1,19 @@
1Both lmbench and util-linux-ng packages provide own /usr/bin/line binaries.
2Even though the binaries name is the same, their functionality is different.
3This patch renames lmbench's line binary as lm_line to avoid conflicts with
4util-linux-ng. script/config-run is also modified (patch) to call lm_line
5instead of line.
6
7Upstream-Status: Inappropriate [build system specific change]
8
9--- patches/scripts/config-run 2006-11-26 15:11:04.000000000 -0500
10+++ patches/scripts/config-run 2011-04-01 09:35:50.000000000 -0400
11@@ -224,7 +224,7 @@ fi
12
13 echo "Hang on, we are calculating your cache line size."
14 ../bin/$OS/msleep 250
15-LINE_SIZE=`../bin/$OS/line -M ${MB}M`
16+LINE_SIZE=`../bin/$OS/lm_line -M ${MB}M`
17 export LINE_SIZE
18 echo "OK, it looks like your cache line is $LINE_SIZE bytes."
19 echo ""
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
new file mode 100644
index 000000000..7efdad53f
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
@@ -0,0 +1,54 @@
1DESCRIPTION = "Tools for performance analysis."
2HOMEPAGE = "http://lmbench.sourceforge.net/"
3SECTION = "console/utils"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
6 file://COPYING-2;md5=8e9aee2ccc75d61d107e43794a25cdf9"
7
8inherit autotools
9
10SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
11 file://lmbench-run \
12 file://rename-line-binary.patch \
13 file://update-results-script.patch \
14 file://obey-ranlib.patch \
15 "
16SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
17SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
18
19EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
20 LDFLAGS="${LDFLAGS}" LD="${LD}" OS="${TARGET_SYS}" \
21 TARGET="${TARGET_OS}" BASE="${prefix}"'
22
23do_configure() {
24 :
25}
26
27do_compile () {
28 . ${CONFIG_SITE}
29 if [ X"$ac_cv_uint" = X"yes" ]; then
30 CFLAGS="${CFLAGS} -DHAVE_uint"
31 fi
32 install -d ${S}/bin/${TARGET_SYS}
33 oe_runmake -C src
34}
35
36do_install () {
37 install -d ${D}${localstatedir}/run/lmbench \
38 ${D}${bindir} ${D}${mandir} ${D}${libdir}/lmbench \
39 ${D}${datadir}/lmbench/scripts
40 oe_runmake 'BASE=${D}${prefix}' \
41 -C src install
42 mv ${D}${bindir}/line ${D}${bindir}/lm_line
43 mv ${D}${prefix}/man/* ${D}${mandir}/
44 install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/
45 sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${PN},;' \
46 -e 's,^BINDIR=.*$,BINDIR=${libdir}/${PN},;' \
47 -e 's,^CONFIG=.*$,CONFIG=$SHAREDIR/`$SCRIPTSDIR/config`,;' \
48 ${D}${bindir}/lmbench-run
49 install -m 0755 ${S}/scripts/lmbench ${D}${bindir}
50 install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts
51}
52
53RDEPENDS_${PN} = "debianutils"
54FILES_${PN} += "${datadir}/lmbench"