diff options
Diffstat (limited to 'import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench')
3 files changed, 121 insertions, 0 deletions
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench/0001-avoid-gcc-optimize-away-the-loops.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench/0001-avoid-gcc-optimize-away-the-loops.patch new file mode 100644 index 000000000..2d8a2468a --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench/0001-avoid-gcc-optimize-away-the-loops.patch @@ -0,0 +1,79 @@ +[PATCH] avoid gcc optimize-away the loops + +Upstream-Status: pending + +Change expression used in do_integer_mul and do_uint64_mul +benchmarks so GCC doesn't optimize-away the loops, other +things are same: +- TEN(r *= s;); r -= t; ++ i = 0; ++ while ( i++ < 10) ++ r *= s; ++ r -= t; + +and TEN is macro: + #define TEN(a) a a a a a a a a a a + +Signed-off-by: Roy Li <rongqing.li@windriver.com> +--- + src/lat_ops.c | 30 +++++++++++++++++++++++++----- + 1 file changed, 25 insertions(+), 5 deletions(-) + +diff --git a/src/lat_ops.c b/src/lat_ops.c +index d343ff3..457072b 100644 +--- a/src/lat_ops.c ++++ b/src/lat_ops.c +@@ -126,11 +126,23 @@ do_integer_mul(iter_t iterations, void* cookie) + struct _state *pState = (struct _state*)cookie; + register int r = pState->N + 37431; + register int s = pState->N + 4; +- register int t = r * s * s * s * s * s * s * s * s * s * s - r; ++ register int t = r; ++ int i = 0; ++ ++ while ( i++ < 10) ++ t *= s; ++ t -= r; + + while (iterations-- > 0) { +- TEN(r *= s;); r -= t; +- TEN(r *= s;); r -= t; ++ i = 0; ++ while ( i++ < 10) ++ r *= s; ++ r -= t; ++ ++ i = 0; ++ while ( i++ < 10) ++ r *= s; ++ r -= t; + } + use_int(r); + } +@@ -207,13 +219,21 @@ do_int64_mul(iter_t iterations, void* cookie) + register int64 r = (int64)pState->N + 37420; + register int64 s = (int64)pState->N + 4; + register int64 t; ++ int i = 0; + + r += (int64)(pState->N + 6)<<32; + t = r * s * s * s * s * s * s * s * s * s * s - r; + + while (iterations-- > 0) { +- TEN(r *= s;); r -= t; +- TEN(r *= s;); r -= t; ++ i = 0; ++ while ( i++ < 10) ++ r *= s; ++ r -= t; ++ ++ i = 0; ++ while ( i++ < 10) ++ r *= s; ++ r -= t; + } + use_int((int)r); + } +-- +2.8.1 + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench/lmbench-run b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench/lmbench-run new file mode 100644 index 000000000..e904c75e4 --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench/lmbench-run @@ -0,0 +1,23 @@ +#!/bin/sh +# Wrapper script for lmbench written for the +# Debian GNU/Linux distribution by +# Javier Fernandez-Sanguino. +# Distributed under the GPL +SHAREDIR=/usr/share/lmbench/ +BINDIR=/usr/lib/lmbench/ +SCRIPTSDIR=$SHAREDIR/scripts +RESULTSDIR=$SHAREDIR/results +CONFIG=/var/lib/lmbench/config/`$SCRIPTSDIR/config` +runuid=`id -u` + +[ $runuid -gt 0 ] && { + echo "You must run this as the root user" + exit 0 +} +cd $SCRIPTSDIR +[ ! -f $CONFIG ] && ./config-run +./results + +echo "Benchmark run finished...." +echo "Remember you can find the results of the benchmark " +echo "under $RESULTSDIR" diff --git a/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench/rename-line-binary.patch b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench/rename-line-binary.patch new file mode 100644 index 000000000..9a405213a --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-benchmark/lmbench/lmbench/rename-line-binary.patch @@ -0,0 +1,19 @@ +Both lmbench and util-linux-ng packages provide own /usr/bin/line binaries. +Even though the binaries name is the same, their functionality is different. +This patch renames lmbench's line binary as lm_line to avoid conflicts with +util-linux-ng. script/config-run is also modified (patch) to call lm_line +instead of line. + +Upstream-Status: Inappropriate [build system specific change] + +--- patches/scripts/config-run 2006-11-26 15:11:04.000000000 -0500 ++++ patches/scripts/config-run 2011-04-01 09:35:50.000000000 -0400 +@@ -224,7 +224,7 @@ fi + + echo "Hang on, we are calculating your cache line size." + ../bin/$OS/msleep 250 +-LINE_SIZE=`../bin/$OS/line -M ${MB}M` ++LINE_SIZE=`../bin/$OS/lm_line -M ${MB}M` + export LINE_SIZE + echo "OK, it looks like your cache line is $LINE_SIZE bytes." + echo "" |