summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-benchmark/lmbench
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
commit1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch)
tree0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-oe/recipes-benchmark/lmbench
downloadmeta-openembedded-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
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-config-script.patch12
-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-3.0-a9/use-base_libdir-instead-of-hardcoded-lib.patch32
-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.bb76
7 files changed, 352 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 0000000000..41a3b3205b
--- /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-config-script.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-config-script.patch
new file mode 100644
index 0000000000..b46e09ad15
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-config-script.patch
@@ -0,0 +1,12 @@
1Upstream-Status: Pending
2Index: lmbench-3.0-a9/scripts/config
3===================================================================
4--- lmbench-3.0-a9/scripts/config 2000-01-31 18:29:31.000000000 -0600
5+++ lmbench-3.0-a9/scripts/config 2013-03-01 00:19:41.032984315 -0600
6@@ -3,5 +3,5 @@
7 UNAME=`uname -n 2>/dev/null`
8 if [ X$UNAME = X ]
9 then echo CONFIG
10-else echo CONFIG.$UNAME
11+else echo ../scripts/CONFIG.$UNAME
12 fi
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 0000000000..894f146d42
--- /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-3.0-a9/use-base_libdir-instead-of-hardcoded-lib.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/use-base_libdir-instead-of-hardcoded-lib.patch
new file mode 100644
index 0000000000..3351ce8875
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/use-base_libdir-instead-of-hardcoded-lib.patch
@@ -0,0 +1,32 @@
1From 0d09e31970616e09beb7f238c2b59bfc541148fb Mon Sep 17 00:00:00 2001
2From: Ting Liu <b28495@freescale.com>
3Date: Fri, 22 Nov 2013 15:20:08 +0800
4Subject: [PATCH] use base_libdir instead of hardcoded /lib
5
6Upsteam Status: Inappropriate [configuration]
7
8Signed-off-by: Ting Liu <b28495@freescale.com>
9---
10 src/Makefile | 4 ++--
11 1 files changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/src/Makefile b/src/Makefile
14index c7a8c79..c7e4e3c 100644
15--- a/src/Makefile
16+++ b/src/Makefile
17@@ -143,10 +143,10 @@ install-target:
18 if [ ! -d $(BASE) ]; then mkdir $(BASE); fi
19 if [ ! -d $(BASE)/bin ]; then mkdir $(BASE)/bin; fi
20 if [ ! -d $(BASE)/include ]; then mkdir $(BASE)/include; fi
21- if [ ! -d $(BASE)/lib ]; then mkdir $(BASE)/lib; fi
22+ if [ ! -d $(BASE)$(base_libdir) ]; then mkdir $(BASE)$(base_libdir); fi
23 cp $(EXES) $(BASE)/bin
24 cp $(INCS) $(BASE)/include
25- cp $O/lmbench.a $(BASE)/lib/libmbench.a
26+ cp $O/lmbench.a $(BASE)$(base_libdir)
27 cd ../doc; env MAKEFLAGS="$(MAKEFLAGS)" make CC="${CC}" OS="${OS}" BASE="$(BASE)" install
28
29
30--
311.7.5.4
32
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 0000000000..e904c75e43
--- /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 0000000000..9a405213ad
--- /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 0000000000..41db15000e
--- /dev/null
+++ b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
@@ -0,0 +1,76 @@
1SUMMARY = "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-brokensep
9
10PR = "r2"
11
12SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
13 file://lmbench-run \
14 file://rename-line-binary.patch \
15 file://update-results-script.patch \
16 file://obey-ranlib.patch \
17 file://update-config-script.patch \
18 file://use-base_libdir-instead-of-hardcoded-lib.patch \
19"
20SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
21SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
22
23EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
24 LDFLAGS="${LDFLAGS}" LD="${LD}" OS="${TARGET_SYS}" \
25 TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"'
26
27do_configure() {
28 :
29}
30
31do_compile () {
32 . ${CONFIG_SITE}
33 if [ X"$ac_cv_uint" = X"yes" ]; then
34 CFLAGS="${CFLAGS} -DHAVE_uint"
35 fi
36 install -d ${S}/bin/${TARGET_SYS}
37 oe_runmake -C src
38}
39
40do_install () {
41 install -d ${D}${sysconfdir}/default/volatiles \
42 ${D}${bindir} ${D}${mandir} ${D}${libdir}/lmbench \
43 ${D}${datadir}/lmbench/scripts
44
45 echo "d root root 0755 ${localstatedir}/run/${BPN} none" \
46 > ${D}${sysconfdir}/default/volatiles/99_lmbench
47 if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
48 install -d ${D}${sysconfdir}/tmpfiles.d
49 echo "d /run/${BPN} - - - -" \
50 > ${D}${sysconfdir}/tmpfiles.d/lmbench.conf
51 fi
52
53 oe_runmake 'BASE=${D}${prefix}' \
54 -C src install
55 mv ${D}${bindir}/line ${D}${bindir}/lm_line
56 install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/
57 sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${PN},;' \
58 -e 's,^BINDIR=.*$,BINDIR=${libdir}/${PN},;' \
59 -e 's,^CONFIG=.*$,CONFIG=`$SCRIPTSDIR/config`,;' \
60 ${D}${bindir}/lmbench-run
61 install -m 0755 ${S}/scripts/lmbench ${D}${bindir}
62 install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts
63}
64
65pkg_postinst_${PN} () {
66 if [ -z "$D" ]; then
67 if command -v systemd-tmpfiles >/dev/null; then
68 systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/lmbench.conf
69 elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
70 ${sysconfdir}/init.d/populate-volatile.sh update
71 fi
72 fi
73}
74
75RDEPENDS_${PN} = "debianutils"
76FILES_${PN} += "${datadir}/lmbench ${libdir}/lmbench"