From 97f3a9e4a87aaa46fde1d5a1ca0903931432016a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 31 Aug 2022 23:39:28 -0700 Subject: lmbench: Add patch to fix typo including string.h header Move all patches under one directory, to keep it simple Signed-off-by: Khem Raj --- ...usl-define-guard-before-redefining-sockle.patch | 27 --- ...Fix-typos-in-lat_unix_connect-manual-page.patch | 30 --- .../0001-doc-Fix-typos-in-manual-pages.patch | 100 ---------- .../0001-lat_fifo-Fix-cleanup-sequence.patch | 42 ---- .../0001-lat_http.c-Add-printf-format.patch | 24 --- ...ench-Point-webpage-lm-to-target-directory.patch | 77 -------- ...efile-use-libdir-instead-of-hardcoded-lib.patch | 34 ---- ...t-CFLAGS-LDFLAGS-to-append-values-passed-.patch | 73 ------- .../fix-lmbench-memory-check-failure.patch | 215 --------------------- .../lmbench_result_html_report.patch | 69 ------- .../lmbench/lmbench-3.0-a9/obey-ranlib.patch | 36 ---- .../lmbench-3.0-a9/update-config-script.patch | 22 --- .../lmbench-3.0-a9/update-results-script.patch | 170 ---------------- ...usl-define-guard-before-redefining-sockle.patch | 27 +++ ...1-bench.h-Fix-typo-in-specifying-string.h.patch | 27 +++ ...Fix-typos-in-lat_unix_connect-manual-page.patch | 30 +++ .../0001-doc-Fix-typos-in-manual-pages.patch | 100 ++++++++++ .../0001-lat_fifo-Fix-cleanup-sequence.patch | 42 ++++ .../0001-lat_http.c-Add-printf-format.patch | 24 +++ ...ench-Point-webpage-lm-to-target-directory.patch | 77 ++++++++ ...efile-use-libdir-instead-of-hardcoded-lib.patch | 34 ++++ ...t-CFLAGS-LDFLAGS-to-append-values-passed-.patch | 73 +++++++ .../lmbench/fix-lmbench-memory-check-failure.patch | 215 +++++++++++++++++++++ .../lmbench/lmbench_result_html_report.patch | 69 +++++++ .../lmbench/lmbench/obey-ranlib.patch | 36 ++++ .../lmbench/lmbench/update-config-script.patch | 22 +++ .../lmbench/lmbench/update-results-script.patch | 170 ++++++++++++++++ .../recipes-benchmark/lmbench/lmbench_3.0-a9.bb | 1 + 28 files changed, 947 insertions(+), 919 deletions(-) delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-doc-Fix-typos-in-manual-pages.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_fifo-Fix-cleanup-sequence.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_http.c-Add-printf-format.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lmbench-Point-webpage-lm-to-target-directory.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/fix-lmbench-memory-check-failure.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/lmbench_result_html_report.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/obey-ranlib.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-config-script.patch delete mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-results-script.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/0001-Check-for-musl-define-guard-before-redefining-sockle.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/0001-bench.h-Fix-typo-in-specifying-string.h.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/0001-doc-Fix-typos-in-manual-pages.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/0001-lat_fifo-Fix-cleanup-sequence.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/0001-lat_http.c-Add-printf-format.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/0001-lmbench-Point-webpage-lm-to-target-directory.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/fix-lmbench-memory-check-failure.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/lmbench_result_html_report.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/obey-ranlib.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/update-config-script.patch create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/update-results-script.patch diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch deleted file mode 100644 index d7169495fa..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-Check-for-musl-define-guard-before-redefining-sockle.patch +++ /dev/null @@ -1,27 +0,0 @@ -From ac1657e11cbb0545bdf4d1124def8c013958ed7e Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 12 Jul 2017 18:08:51 -0700 -Subject: [PATCH] Check for musl define guard before redefining socklen_t - -musl uses __DEFINED_socklen_t so check for that as well -along with HAVE_socklen_t - -Signed-off-by: Khem Raj - ---- - src/bench.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/bench.h b/src/bench.h -index 597d068..2ebdf5a 100644 ---- a/src/bench.h -+++ b/src/bench.h -@@ -77,7 +77,7 @@ typedef long long int64; - #endif /* HAVE_int64_t */ - #endif /* HAVE_int64 */ - --#ifndef HAVE_socklen_t -+#if !defined(HAVE_socklen_t) && !defined(__DEFINED_socklen_t) - typedef int socklen_t; - #endif - diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch deleted file mode 100644 index d49dac5b20..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 9bf2b363c5173c03adecf366f116415dbc559017 Mon Sep 17 00:00:00 2001 -From: Yanfei Xu -Date: Tue, 23 Feb 2021 10:54:26 +0800 -Subject: [PATCH 1/2] doc: Fix typos in lat_unix_connect manual page - -Signed-off-by: Yanfei Xu ---- - doc/lat_unix_connect.8 | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/doc/lat_unix_connect.8 b/doc/lat_unix_connect.8 -index b42e9a4..5ab1a51 100644 ---- a/doc/lat_unix_connect.8 -+++ b/doc/lat_unix_connect.8 -@@ -25,9 +25,9 @@ is a client/server program that measures interprocess - connection latencies. The benchmark times the creation and connection of - an AF_UNIX socket to a local server. - .LP --.B lat_connect --has three forms of usage: as a server (-s), as a client (lat_connect), --and as a shutdown (lat_connect -S). -+.B lat_unix_connect -+has three forms of usage: as a server (-s), as a client (lat_unix_connect), -+and as a shutdown (lat_unix_connect -S). - .SH OUTPUT - The reported time is in microseconds per connection. - Output format is like so --- -2.27.0 - diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-doc-Fix-typos-in-manual-pages.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-doc-Fix-typos-in-manual-pages.patch deleted file mode 100644 index b27e6c9fe0..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-doc-Fix-typos-in-manual-pages.patch +++ /dev/null @@ -1,100 +0,0 @@ -From a8d86a2d994a008dab3c3ecad65528c0e5fc2cba Mon Sep 17 00:00:00 2001 -From: He Zhe -Date: Fri, 22 Jan 2021 11:22:48 +0800 -Subject: [PATCH] doc: Fix typos in manual pages - -Signed-off-by: He Zhe ---- - doc/bw_mem.8 | 2 +- - doc/lat_fcntl.8 | 2 +- - doc/lat_fifo.8 | 2 +- - doc/lat_http.8 | 6 +++--- - doc/lat_select.8 | 2 +- - doc/lat_sig.8 | 2 +- - 6 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/doc/bw_mem.8 b/doc/bw_mem.8 -index 33df417..9e84d73 100644 ---- a/doc/bw_mem.8 -+++ b/doc/bw_mem.8 -@@ -3,7 +3,7 @@ - .SH NAME - bw_mem \- time memory bandwidth - .SH SYNOPSIS --.B bw_mem_cp -+.B bw_mem - [ - .I "-P " - ] -diff --git a/doc/lat_fcntl.8 b/doc/lat_fcntl.8 -index cf3c93e..2e501d6 100644 ---- a/doc/lat_fcntl.8 -+++ b/doc/lat_fcntl.8 -@@ -3,7 +3,7 @@ - .SH NAME - lat_fcntl \- fcntl file locking benchmark - .SH SYNOPSIS --.B lat_ctx -+.B lat_fcntl - [ - .I "-P " - ] -diff --git a/doc/lat_fifo.8 b/doc/lat_fifo.8 -index 65e5a08..90bc900 100644 ---- a/doc/lat_fifo.8 -+++ b/doc/lat_fifo.8 -@@ -3,7 +3,7 @@ - .SH NAME - lat_fifo \- FIFO benchmark - .SH SYNOPSIS --.B lat_ctx -+.B lat_fifo - [ - .I "-P " - ] -diff --git a/doc/lat_http.8 b/doc/lat_http.8 -index a4bb459..99c5d4a 100644 ---- a/doc/lat_http.8 -+++ b/doc/lat_http.8 -@@ -1,9 +1,9 @@ - .\" $Id$ --.TH LAT_FCNTL 8 "$Date$" "(c)1994-2000 Carl Staelin and Larry McVoy" "LMBENCH" -+.TH LAT_HTTP 8 "$Date$" "(c)1994-2000 Carl Staelin and Larry McVoy" "LMBENCH" - .SH NAME --lat_fcntl \- fcntl file locking benchmark -+lat_http \- http GET request latency - .SH SYNOPSIS --.B lat_ctx -+.B lat_http - [ - .I "-d" - ] -diff --git a/doc/lat_select.8 b/doc/lat_select.8 -index 03f83bf..e13499f 100644 ---- a/doc/lat_select.8 -+++ b/doc/lat_select.8 -@@ -3,7 +3,7 @@ - .SH NAME - lat_select \- select benchmark - .SH SYNOPSIS --.B lat_ctx -+.B lat_select - [ - .I "-P " - ] -diff --git a/doc/lat_sig.8 b/doc/lat_sig.8 -index 91baf78..19a8838 100644 ---- a/doc/lat_sig.8 -+++ b/doc/lat_sig.8 -@@ -3,7 +3,7 @@ - .SH NAME - lat_sig \- select benchmark - .SH SYNOPSIS --.B lat_ctx -+.B lat_sig - [ - .I "-P " - ] --- -2.17.1 - diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_fifo-Fix-cleanup-sequence.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_fifo-Fix-cleanup-sequence.patch deleted file mode 100644 index 42b14cecee..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_fifo-Fix-cleanup-sequence.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 78912c0ac5e090095a2f2bd6226e02cce949e72e Mon Sep 17 00:00:00 2001 -From: He Zhe -Date: Fri, 22 Jan 2021 10:03:38 +0000 -Subject: [PATCH] lat_fifo: Fix cleanup sequence - -Files should be unlinked after all users exit. - -Signed-off-by: He Zhe ---- - src/lat_fifo.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/src/lat_fifo.c b/src/lat_fifo.c -index c625161..85bb9d1 100644 ---- a/src/lat_fifo.c -+++ b/src/lat_fifo.c -@@ -120,16 +120,16 @@ cleanup(iter_t iterations, void * cookie) - - if (iterations) return; - -- unlink(state->filename1); -- unlink(state->filename2); -- close(state->wr); -- close(state->rd); -- - if (state->pid > 0) { -- kill(state->pid, 15); -+ kill(state->pid, SIGKILL); - waitpid(state->pid, NULL, 0); - state->pid = 0; - } -+ -+ unlink(state->filename1); -+ unlink(state->filename2); -+ close(state->wr); -+ close(state->rd); - } - - void --- -2.29.2 - diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_http.c-Add-printf-format.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_http.c-Add-printf-format.patch deleted file mode 100644 index 943b3ec889..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lat_http.c-Add-printf-format.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 7c05fa5353ad91acae6e5e8a01f65d54935ef778 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 27 Jun 2017 14:39:10 -0700 -Subject: [PATCH] lat_http.c: Add printf format - -Signed-off-by: Khem Raj - ---- - src/lat_http.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/lat_http.c b/src/lat_http.c -index c630d59..28d04f7 100644 ---- a/src/lat_http.c -+++ b/src/lat_http.c -@@ -27,7 +27,7 @@ http(char *server, char *file, int prog) - sock = tcp_connect(server, prog, SOCKOPT_REUSE); - sprintf(buf, "GET /%s HTTP/1.0\r\n\r\n\n", file); - if (debug) { -- printf(buf); -+ printf("%s", buf); - } - write(sock, buf, strlen(buf)); - while ((n = read(sock, buf, XFERSIZE)) > 0) { diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lmbench-Point-webpage-lm-to-target-directory.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lmbench-Point-webpage-lm-to-target-directory.patch deleted file mode 100644 index 4a26b8ea7a..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-lmbench-Point-webpage-lm-to-target-directory.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 353e8a62bf3cb5f1b9504efa16b8b974e93cac49 Mon Sep 17 00:00:00 2001 -From: He Zhe -Date: Fri, 22 Jan 2021 10:58:41 +0800 -Subject: [PATCH] lmbench: Point webpage-lm to target directory - -As webpage-lm.tar has been copied to ${datadir}\lmbench. -Plus improve 'hello' copying in lmbench script. - -Signed-off-by: He Zhe ---- - scripts/lmbench | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/scripts/lmbench b/scripts/lmbench -index 7a52cb1..82e36b6 100755 ---- a/scripts/lmbench -+++ b/scripts/lmbench -@@ -167,7 +167,7 @@ if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_UNIX = XYES ]; then - lat_unix -P $SYNC_MAX - fi - if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_PROC = XYES ]; then -- cp hello /tmp/hello -+ cp `which hello` /tmp/hello - for i in fork exec shell - do lat_proc -P $SYNC_MAX $i - done -@@ -237,14 +237,14 @@ fi - - date >> ${OUTPUT} - echo Local networking >> ${OUTPUT} --if [ ! -d ../../src/webpage-lm ] --then (cd ../../src && tar xf webpage-lm.tar) -+if [ ! -d /usr/share/lmbench/webpage-lm ] -+then (cd /usr/share/lmbench && tar xf webpage-lm.tar) - sync - sleep 1 - fi - SERVERS="lat_udp lat_tcp lat_rpc lat_connect bw_tcp" - for server in $SERVERS; do $server -s; done --DOCROOT=../../src/webpage-lm lmhttp 8008 & -+DOCROOT=/usr/share/lmbench/webpage-lm lmhttp 8008 & - sleep 2; - - if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_UDP = XYES ]; then -@@ -280,15 +280,15 @@ bw_tcp -S localhost - - if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_HTTP = XYES ]; then - # I want a hot cache number -- lat_http localhost 8008 < ../../src/webpage-lm/URLS > /dev/null 2>&1 -- lat_http localhost 8008 < ../../src/webpage-lm/URLS -+ lat_http localhost 8008 < /usr/share/lmbench/webpage-lm/URLS > /dev/null 2>&1 -+ lat_http localhost 8008 < /usr/share/lmbench/webpage-lm/URLS - fi - lat_http -S localhost 8008 - - for remote in $REMOTE - do - echo Networking to $remote >> ${OUTPUT} -- $RCP $SERVERS lmhttp ../../src/webpage-lm.tar ${remote}:/tmp -+ $RCP $SERVERS lmhttp /usr/share/lmbench/webpage-lm.tar ${remote}:/tmp - for server in $SERVERS - do $RSH $remote -n /tmp/$server -s & - done -@@ -327,8 +327,8 @@ do - - if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_HTTP = XYES ]; then - # I want a hot cache number -- lat_http $remote 8008 < ../../src/webpage-lm/URLS > /dev/null 2>&1 -- lat_http $remote 8008 < ../../src/webpage-lm/URLS -+ lat_http $remote 8008 < /usr/share/lmbench/webpage-lm/URLS > /dev/null 2>&1 -+ lat_http $remote 8008 < /usr/share/lmbench/webpage-lm/URLS - fi - lat_http -S $remote 8008 - --- -2.17.1 - diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch deleted file mode 100644 index 04cef960fc..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ea683a0dbaa30a0bf101adb09a1a2531c7112c62 Mon Sep 17 00:00:00 2001 -From: Mingli Yu -Date: Mon, 27 Aug 2018 11:02:45 +0800 -Subject: [PATCH] src/Makefile: use libdir instead of hardcoded /lib - -use libdir instead of hardcoded /lib - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Mingli Yu ---- - src/Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/Makefile b/src/Makefile -index 4678d54..b73ddb6 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -141,10 +141,10 @@ install-target: - if [ ! -d $(BASE) ]; then mkdir $(BASE); fi - if [ ! -d $(BASE)/bin ]; then mkdir $(BASE)/bin; fi - if [ ! -d $(BASE)/include ]; then mkdir $(BASE)/include; fi -- if [ ! -d $(BASE)/lib ]; then mkdir $(BASE)/lib; fi -+ if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir $(DESTDIR)$(libdir); fi - cp $(EXES) $(BASE)/bin - cp $(INCS) $(BASE)/include -- cp $O/lmbench.a $(BASE)/lib/libmbench.a -+ cp $O/lmbench.a $(DESTDIR)$(libdir)/libmbench.a - cd ../doc; env MAKEFLAGS="$(MAKEFLAGS)" make CC="${CC}" OS="${OS}" BASE="$(BASE)" install - - --- -2.7.4 - diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch deleted file mode 100644 index 1d5d9c12ab..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch +++ /dev/null @@ -1,73 +0,0 @@ -From b27c253bfb78fa3c5f416e6caee101098a4b58cc Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 12 Jul 2017 18:09:46 -0700 -Subject: [PATCH] build: Adjust CFLAGS/LDFLAGS to append values passed from env - -For musl we have to pass additional arguments via cflags and ldflags -to link in librirpc, make room for those changes to take effect - -Signed-off-by: Khem Raj - ---- - scripts/build | 2 +- - src/Makefile | 14 +++++++------- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/scripts/build b/scripts/build -index 34a1371..3786741 100755 ---- a/scripts/build -+++ b/scripts/build -@@ -18,7 +18,7 @@ done - - trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BASE}$$.o ${BASE}$$; exit 1' 1 2 15 - --LDLIBS=-lm -+LDLIBS="$LDLIBS -lm" - - # check for HP-UX's ANSI compiler - echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c -diff --git a/src/Makefile b/src/Makefile -index d9efd54..96467d7 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -112,8 +112,8 @@ LIBOBJS= $O/lib_tcp.o $O/lib_udp.o $O/lib_unix.o $O/lib_timing.o \ - $O/lib_sched.o - - lmbench: $(UTILS) -- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all -- -@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt -+ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all -+ -@env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt - - results: lmbench - @env OS="${OS}" ../scripts/config-run -@@ -137,7 +137,7 @@ os: lmbench - @env OS="${OS}" BENCHMARK_HARDWARE=NO BENCHMARK_OS=YES ../scripts/results - - install: lmbench -- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target -+ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target - - install-target: - if [ ! -d $(BASE) ]; then mkdir $(BASE); fi -@@ -155,16 +155,16 @@ all: $(EXES) $O/lmbench - opt: $(OPT_EXES) - asm: $(ASMS) - $(ASMS): -- $(CC) -S $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ `basename $@ .s`.c -+ $(CC) -S $(CFLAGS) $(CPPFLAGS) -o $@ `basename $@ .s`.c $(LDFLAGS) - - Wall: -- @env CFLAGS="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt -+ @env CFLAGS+="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt - - debug: -- @env CFLAGS="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt -+ @env CFLAGS+="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt - - assembler: -- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm -+ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm - - - tag: diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/fix-lmbench-memory-check-failure.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/fix-lmbench-memory-check-failure.patch deleted file mode 100644 index cbab5c424e..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/fix-lmbench-memory-check-failure.patch +++ /dev/null @@ -1,215 +0,0 @@ -From 65180976c9963432d166b47a0b692260a69c0d47 Mon Sep 17 00:00:00 2001 -From: Qingming Su -Date: Tue, 19 Aug 2014 05:16:17 -0400 -Subject: [PATCH] lmbench: Can't proceed on some targets - -lmbench can't proceed on some targets. The memory check fails because the -memory latency of each page is longer then 10us, which is a time limit set -in the original memsize.c. - -The memory latency is very different on different targets due to the -hardware and current system load. The targets with slower memory -chips or heavy system load need much longer time to read or write -the memory. - -This fix changes the fixed time limit of 10us to a specific value calculated -from the runtime target. - -Also set an upper limit of memory size used for lmbench testing. The memory -check sometimes fails if the target has a large amount of memory, for -example more than 4G. - -Signed-off-by: Qingming Su -Signed-off-by: Fupan Li - -Add and reword above comments - -Upstream-status: inappropriate [ configuration ] - -Signed-off-by: Mark Hatle - ---- - scripts/config-run | 12 +++++++--- - src/Makefile | 4 ++-- - src/memsize.c | 66 +++++++++++++++++++++++++++++++++++------------------- - 3 files changed, 54 insertions(+), 28 deletions(-) - -diff --git a/scripts/config-run b/scripts/config-run -index 918cbdf..096ed12 100755 ---- a/scripts/config-run -+++ b/scripts/config-run -@@ -197,6 +197,12 @@ The bigger the range, the more accurate the results, but larger sizes - take somewhat longer to run the benchmark. - - EOF -+ -+# By default, use 512M memory as the upper limit for lmbench test -+if [ $MB -gt 512 ];then -+MB=512 -+fi -+ - echo $ECHON "MB [default $MB]: $ECHOC" - read TMP - if [ X$TMP != X ] -@@ -687,10 +693,10 @@ case $MAIL in - ;; - esac - --INFO=`../scripts/info` -+INFO=`../scripts/hostinfo` - if [ $MAIL = yes ] - then if [ ! -f $INFO ] -- then cp ../scripts/info-template $INFO -+ then cp ../scripts/hostinfo-template $INFO - chmod +w $INFO - REUSE=no - else -@@ -733,7 +739,7 @@ EOF - then EDITOR=$TMP - fi - if [ X$EDITOR != "none" ] -- then $EDITOR `../scripts/info` -+ then $EDITOR `../scripts/hostinfo` - fi - fi - fi -diff --git a/src/Makefile b/src/Makefile -index c7e4e3c..d9efd54 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -50,7 +50,7 @@ TARGET=`../scripts/target` - BINDIR=../bin/$(OS) - CONFIG=../bin/$(OS)/`../scripts/config` - UTILS=../scripts/target ../scripts/os ../scripts/gnu-os ../scripts/compiler \ -- ../scripts/info ../scripts/info-template ../scripts/version \ -+ ../scripts/hostinfo ../scripts/hostinfo-template ../scripts/version \ - ../scripts/config ../scripts/config-run ../scripts/results \ - ../scripts/lmbench ../scripts/make ../scripts/build - INSTALL=cp -@@ -240,7 +240,7 @@ $O/getopt.o : getopt.c $(INCS) - $(COMPILE) -c getopt.c -o $O/getopt.o - - $(UTILS) : -- -cd ../scripts; make get -+ -cd ../scripts; cp info hostinfo; cp info-template hostinfo-template - - # Do not remove the next line, $(MAKE) depend needs it - # MAKEDEPEND follows -diff --git a/src/memsize.c b/src/memsize.c -index eb25a09..82d7faf 100644 ---- a/src/memsize.c -+++ b/src/memsize.c -@@ -14,9 +14,12 @@ char *id = "$Id$\n"; - - #define CHK(x) if ((x) == -1) { perror("x"); exit(1); } - --#ifndef TOO_LONG --#define TOO_LONG 10 /* usecs */ --#endif -+//#ifndef TOO_LONG -+//#define TOO_LONG 10 /* usecs */ -+//#endif -+ -+#define MEMORY_SIZE_1MB (1024 * 1024) -+#define MEMORY_SIZE_8MB (8 * 1024 * 1024) - - int alarm_triggered = 0; - -@@ -35,10 +38,10 @@ main(int ac, char **av) - size_t delta; - - if (ac == 2) { -- max = size = bytes(av[1]) * 1024 * 1024; -+ max = size = bytes(av[1]) * MEMORY_SIZE_1MB; - } -- if (max < 1024 * 1024) { -- max = size = 1024 * 1024 * 1024; -+ if (max < MEMORY_SIZE_1MB) { -+ max = size = 1024 * MEMORY_SIZE_1MB; - } - /* - * Binary search down and then binary search up -@@ -48,7 +51,7 @@ main(int ac, char **av) - } - /* delta = size / (2 * 1024 * 1024) */ - for (delta = (size >> 21); delta > 0; delta >>= 1) { -- uint64 sz = (uint64)size + (uint64)delta * 1024 * 1024; -+ uint64 sz = (uint64)size + (uint64)delta * MEMORY_SIZE_1MB; - size_t check = sz; - if (max < sz) continue; - if (check < sz || !test_malloc(sz)) break; -@@ -66,41 +69,58 @@ timeit(char *where, size_t size) - { - int sum = 0; - size_t n; -- size_t s_prev; -+ size_t s_prev = MEMORY_SIZE_8MB; - size_t range; -- size_t incr = 1024 * 1024; -+ size_t incr = MEMORY_SIZE_1MB; - size_t pagesize = getpagesize(); -- unsigned long long s; -- -- if (size < 1024*1024 - 16*1024) { -- fprintf(stderr, "Bad size\n"); -- return; -- } -+ size_t time_each_page = 0; -+ size_t too_long = 0; -+ unsigned long long s; -+ -+ if (pagesize < MEMORY_SIZE_1MB) -+ range = MEMORY_SIZE_1MB; -+ else -+ range = MEMORY_SIZE_8MB; -+ -+ incr = MEMORY_SIZE_1MB; -+ -+ if (size < range) { -+ fprintf(stderr, "Bad size\n"); -+ return; -+ } -+ -+ //Touch range of memory, get the average time (usec) of operating each memory page on this system -+ start(0); -+ touchRange(where, range, pagesize); -+ sum = stop(0, 0); -+ -+ if ((time_each_page = sum * pagesize / range) < 1) -+ time_each_page = 1; -+ //Set the uper limit of time spending on one page -+ too_long = 10 * time_each_page; - -- range = 1024 * 1024; -- incr = 1024 * 1024; -- touchRange(where, range, pagesize); - for (range += incr; range <= size; range += incr) { - n = range / pagesize; -- set_alarm(n * TOO_LONG); -+ set_alarm(n * too_long); - touchRange(where + range - incr, incr, pagesize); - clear_alarm(); -- set_alarm(n * TOO_LONG); -+ set_alarm(n * too_long); - start(0); - touchRange(where, range, pagesize); - sum = stop(0, 0); - clear_alarm(); -- if ((sum / n) > TOO_LONG || alarm_triggered) { -+ if ((sum / n) > too_long || alarm_triggered) { - size = range - incr; -+ fprintf(stderr, "Error! Memory testing timeout! Touch one page of memory needs more than %d (usecs)\n ", too_long); - break; - } -- for (s = 8 * 1024 * 1024; s <= range; s_prev = s, s *= 2) -+ for (s = s_prev; s <= range; s_prev = s, s *= 2) - if (s < s_prev) break; - incr = s / 8; - if (range < size && size < range + incr) { - incr = size - range; - } -- fprintf(stderr, "%dMB OK\r", (int)(range/(1024*1024))); -+ fprintf(stderr, "%dMB OK\r", (int)(range/MEMORY_SIZE_1MB)); - } - fprintf(stderr, "\n"); - printf("%d\n", (int)(size>>20)); diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/lmbench_result_html_report.patch b/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/lmbench_result_html_report.patch deleted file mode 100644 index 30708c81db..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/lmbench_result_html_report.patch +++ /dev/null @@ -1,69 +0,0 @@ -From b21ca9f3911628fb66f308c6916485bbbcfb29a4 Mon Sep 17 00:00:00 2001 -From: Lin Yu -Date: Tue, 19 Aug 2014 05:16:16 -0400 -Subject: [PATCH] lmbench: Fix "make html" graph failure - -The html-list perl script cannot parse the first line of the result -files about the lmbench version. - -Additional fixes are to make the result's html pages easier to understand. - -Signed-off-by: Lin Yu -Signed-off-by: Fupan Li - -Reworded patch description. - -Upstream-status: inappropriate [ configuration ] - -Signed-off-by: Mark Hatle - ---- - results/Makefile | 1 + - scripts/html-list | 7 ++----- - 2 files changed, 3 insertions(+), 5 deletions(-) - -diff --git a/results/Makefile b/results/Makefile -index 0935376..1ef9a15 100644 ---- a/results/Makefile -+++ b/results/Makefile -@@ -186,6 +186,7 @@ paper: - # scratch makes you want a Ghz machine. - html: dirs - -make clean -+ make ps - #$(SCRIPTS)bghtml $(BG) - $(SCRIPTS)html-list $(LIST) - $(MK) LIST="$(LIST)" summary > HTML/summary.out 2> HTML/summary.errs -diff --git a/scripts/html-list b/scripts/html-list -index 9850461..6383115 100755 ---- a/scripts/html-list -+++ b/scripts/html-list -@@ -14,7 +14,7 @@ open(H, ">HTML/specific.html"); - print H <LMBENCH System Results -

LMBENCH System Results

--

Summary of results

-+

Summary of results

-
- EOF - -@@ -47,7 +47,7 @@ foreach $os (@os) { - open(F, $file); - $_ = ; - close(F); -- next unless /lmbench1.[01]/; -+ next unless /lmbench[0-9]+.[01]/; - chop; - $title = $_; - #s/.lmbench1.? results for //; -@@ -103,10 +103,7 @@ EOF - if $i < $#os; - print S<$title --Information on this benchmark (Not up to date) -

\n

-- --LMBENCH table of contents - - System results table of contents -

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 deleted file mode 100644 index fa5e6dbda3..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/obey-ranlib.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 182a5d3dba3f440bbf35551da6d21ab1c990eb58 Mon Sep 17 00:00:00 2001 -From: Noor Ahsan -Date: Mon, 29 Aug 2011 16:17:51 +0000 -Subject: [PATCH] lmbench: Add version 3.0-a9 (initial recipe) - -In some cases the host may have too old of a ranlib to work. Since it's -not exactly a great idea to not be using the cross ranlib anyhow, fix the -Makefile so we can override ranlib and then override it - -Upstream-Status: Inappropriate [build system specific change] - ---- - src/Makefile | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/Makefile b/src/Makefile -index 4962815..c7a8c79 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -38,6 +38,7 @@ CC=`../scripts/compiler` - MAKE=`../scripts/make` - AR=ar - ARCREATE=cr -+RANLIB=ranlib - - # base of installation location - BASE=/usr/local -@@ -217,7 +218,7 @@ $O/lmbench : ../scripts/lmbench version.h - $O/lmbench.a: $(LIBOBJS) - /bin/rm -f $O/lmbench.a - $(AR) $(ARCREATE) $O/lmbench.a $(LIBOBJS) -- -ranlib $O/lmbench.a -+ -$(RANLIB) $O/lmbench.a - - $O/lib_timing.o : lib_timing.c $(INCS) - $(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 deleted file mode 100644 index 44bc7bbcde..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-config-script.patch +++ /dev/null @@ -1,22 +0,0 @@ -From aca1a59d888421c1fc553229b8049be47e8b3ddf Mon Sep 17 00:00:00 2001 -From: Chunrong Guo -Date: Fri, 1 Mar 2013 09:50:42 +0000 -Subject: [PATCH] lmbench: update config script - -Upstream-Status: Pending - ---- - scripts/config | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/config b/scripts/config -index b58cb60..25d9d77 100755 ---- a/scripts/config -+++ b/scripts/config -@@ -3,5 +3,5 @@ - UNAME=`uname -n 2>/dev/null` - if [ X$UNAME = X ] - then echo CONFIG --else echo CONFIG.$UNAME -+else echo ../scripts/CONFIG.$UNAME - 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 deleted file mode 100644 index 31c4aecbbe..0000000000 --- a/meta-oe/recipes-benchmark/lmbench/lmbench-3.0-a9/update-results-script.patch +++ /dev/null @@ -1,170 +0,0 @@ -From 4955021bc283be404df62b97b86af3943efd29de Mon Sep 17 00:00:00 2001 -From: Noor Ahsan -Date: Mon, 29 Aug 2011 16:17:51 +0000 -Subject: [PATCH] lmbench: Add version 3.0-a9 (initial recipe) - -Now that we have our binaries in /usr/bin rather than the normal -lmbench hierarchy we need to update the scripts as well to behave well here. - -Upstream-Status: Inappropriate [This is related to the OE-specific behavior -of installing into /usr/bin, etc, rather than dumping everything into -/usr/share/lmbench or similar] - ---- - scripts/config-run | 40 ++++++++++++++++++++-------------------- - scripts/results | 8 +++----- - 2 files changed, 23 insertions(+), 25 deletions(-) - -diff --git a/scripts/config-run b/scripts/config-run -index a2d5ba4..918cbdf 100755 ---- a/scripts/config-run -+++ b/scripts/config-run -@@ -132,20 +132,20 @@ export LMBENCH_SCHED - ############################################################################ - echo $L; echo ""; - echo "Hang on, we are calculating your timing granularity." --../bin/$OS/msleep 250 --ENOUGH=`../bin/$OS/enough` -+msleep 250 -+ENOUGH=`enough` - export ENOUGH - echo "OK, it looks like you can time stuff down to $ENOUGH usec resolution." - echo "" - echo "Hang on, we are calculating your timing overhead." --../bin/$OS/msleep 250 --TIMING_O=`../bin/$OS/timing_o` -+msleep 250 -+TIMING_O=`timing_o` - export TIMING_O - echo "OK, it looks like your gettimeofday() costs $TIMING_O usecs." - echo "" - echo "Hang on, we are calculating your loop overhead." --../bin/$OS/msleep 250 --LOOP_O=`../bin/$OS/loop_o` -+msleep 250 -+LOOP_O=`loop_o` - export LOOP_O - echo "OK, it looks like your benchmark loop costs $LOOP_O usecs." - echo "" -@@ -177,7 +177,7 @@ then - fi - if [ X$MB = X ] - then $ECHON "Probing system for available memory: $ECHOC" -- MB=`../bin/$OS/memsize 4096` -+ MB=`memsize 4096` - fi - TOTAL_MEM=$MB - MB=`echo \( $MB \* 7 \) / 10 | bc 2>/dev/null` -@@ -205,9 +205,9 @@ fi - # Certain machines tend to barf when you try and bcopy 8MB. - # Figure out how much we can use. - echo "Checking to see if you have $MB MB; please wait for a moment..." --MB=`../bin/$OS/memsize $MB` --MB=`../bin/$OS/memsize $MB` --MB=`../bin/$OS/memsize $MB` -+MB=`memsize $MB` -+MB=`memsize $MB` -+MB=`memsize $MB` - if [ `expr $SYNC_MAX \* $MB` -gt `expr $TOTAL_MEM` ] - then - MB=`expr $TOTAL_MEM / $SYNC_MAX` -@@ -223,8 +223,8 @@ then echo Warning: you have only ${MB}MB available memory. - fi - - echo "Hang on, we are calculating your cache line size." --../bin/$OS/msleep 250 --LINE_SIZE=`../bin/$OS/lm_line -M ${MB}M` -+msleep 250 -+LINE_SIZE=`lm_line -M ${MB}M` - export LINE_SIZE - echo "OK, it looks like your cache line is $LINE_SIZE bytes." - echo "" -@@ -479,7 +479,7 @@ EOF - then - for i in $disks - do if [ -r $i ] -- then ../bin/$OS/flushdisk $i -+ then flushdisk $i - if [ $? -eq 1 ] - then echo "Must be root to run disk benchmarks." - echo "Root is needed to flush the buffer cache" -@@ -584,7 +584,7 @@ fi - echo $L - echo "" - echo "Calculating mhz, please wait for a moment..." --MHZ=`../bin/$OS/mhz` -+MHZ=`mhz` - cat< $C - echo DISK_DESC=\"$DISK_DESC\" >> $C - echo OUTPUT=$OUTPUT >> $C -diff --git a/scripts/results b/scripts/results -index cd07c15..d5aa558 100755 ---- a/scripts/results -+++ b/scripts/results -@@ -8,11 +8,11 @@ RESULTS=results/$OS - BASE=../$RESULTS/`uname -n` - EXT=0 - --if [ ! -f "../bin/$OS/$CONFIG" ] -+if [ ! -f "$CONFIG" ] - then echo "No config file?" - exit 1 - fi --. ../bin/$OS/$CONFIG -+. $CONFIG - - if [ ! -d ../$RESULTS ] - then mkdir -p ../$RESULTS -@@ -23,11 +23,9 @@ do EXT=`expr $EXT + 1` - RESULTS=$BASE.$EXT - done - --cd ../bin/$OS --PATH=.:${PATH}; export PATH - export SYNC_MAX - export OUTPUT --lmbench $CONFIG 2>../${RESULTS} -+lmbench $CONFIG 2>${RESULTS} - - if [ X$MAIL = Xyes ] - then echo Mailing results diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0001-Check-for-musl-define-guard-before-redefining-sockle.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-Check-for-musl-define-guard-before-redefining-sockle.patch new file mode 100644 index 0000000000..d7169495fa --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-Check-for-musl-define-guard-before-redefining-sockle.patch @@ -0,0 +1,27 @@ +From ac1657e11cbb0545bdf4d1124def8c013958ed7e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 12 Jul 2017 18:08:51 -0700 +Subject: [PATCH] Check for musl define guard before redefining socklen_t + +musl uses __DEFINED_socklen_t so check for that as well +along with HAVE_socklen_t + +Signed-off-by: Khem Raj + +--- + src/bench.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bench.h b/src/bench.h +index 597d068..2ebdf5a 100644 +--- a/src/bench.h ++++ b/src/bench.h +@@ -77,7 +77,7 @@ typedef long long int64; + #endif /* HAVE_int64_t */ + #endif /* HAVE_int64 */ + +-#ifndef HAVE_socklen_t ++#if !defined(HAVE_socklen_t) && !defined(__DEFINED_socklen_t) + typedef int socklen_t; + #endif + diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0001-bench.h-Fix-typo-in-specifying-string.h.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-bench.h-Fix-typo-in-specifying-string.h.patch new file mode 100644 index 0000000000..e9220ecbdd --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-bench.h-Fix-typo-in-specifying-string.h.patch @@ -0,0 +1,27 @@ +From 4bbedd25e74adb5cb181a9ae589adb2052ade630 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 31 Aug 2022 23:34:48 -0700 +Subject: [PATCH] bench.h: Fix typo in specifying string.h + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + src/bench.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/bench.h b/src/bench.h +index 2ebdf5a..750bebf 100644 +--- a/src/bench.h ++++ b/src/bench.h +@@ -21,7 +21,7 @@ typedef unsigned char bool_t; + #include + #include + #ifndef WIN32 +-#include ++#include + #endif + #include + #ifndef WIN32 +-- +2.37.3 + diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch new file mode 100644 index 0000000000..d49dac5b20 --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch @@ -0,0 +1,30 @@ +From 9bf2b363c5173c03adecf366f116415dbc559017 Mon Sep 17 00:00:00 2001 +From: Yanfei Xu +Date: Tue, 23 Feb 2021 10:54:26 +0800 +Subject: [PATCH 1/2] doc: Fix typos in lat_unix_connect manual page + +Signed-off-by: Yanfei Xu +--- + doc/lat_unix_connect.8 | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/doc/lat_unix_connect.8 b/doc/lat_unix_connect.8 +index b42e9a4..5ab1a51 100644 +--- a/doc/lat_unix_connect.8 ++++ b/doc/lat_unix_connect.8 +@@ -25,9 +25,9 @@ is a client/server program that measures interprocess + connection latencies. The benchmark times the creation and connection of + an AF_UNIX socket to a local server. + .LP +-.B lat_connect +-has three forms of usage: as a server (-s), as a client (lat_connect), +-and as a shutdown (lat_connect -S). ++.B lat_unix_connect ++has three forms of usage: as a server (-s), as a client (lat_unix_connect), ++and as a shutdown (lat_unix_connect -S). + .SH OUTPUT + The reported time is in microseconds per connection. + Output format is like so +-- +2.27.0 + diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0001-doc-Fix-typos-in-manual-pages.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-doc-Fix-typos-in-manual-pages.patch new file mode 100644 index 0000000000..b27e6c9fe0 --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-doc-Fix-typos-in-manual-pages.patch @@ -0,0 +1,100 @@ +From a8d86a2d994a008dab3c3ecad65528c0e5fc2cba Mon Sep 17 00:00:00 2001 +From: He Zhe +Date: Fri, 22 Jan 2021 11:22:48 +0800 +Subject: [PATCH] doc: Fix typos in manual pages + +Signed-off-by: He Zhe +--- + doc/bw_mem.8 | 2 +- + doc/lat_fcntl.8 | 2 +- + doc/lat_fifo.8 | 2 +- + doc/lat_http.8 | 6 +++--- + doc/lat_select.8 | 2 +- + doc/lat_sig.8 | 2 +- + 6 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/doc/bw_mem.8 b/doc/bw_mem.8 +index 33df417..9e84d73 100644 +--- a/doc/bw_mem.8 ++++ b/doc/bw_mem.8 +@@ -3,7 +3,7 @@ + .SH NAME + bw_mem \- time memory bandwidth + .SH SYNOPSIS +-.B bw_mem_cp ++.B bw_mem + [ + .I "-P " + ] +diff --git a/doc/lat_fcntl.8 b/doc/lat_fcntl.8 +index cf3c93e..2e501d6 100644 +--- a/doc/lat_fcntl.8 ++++ b/doc/lat_fcntl.8 +@@ -3,7 +3,7 @@ + .SH NAME + lat_fcntl \- fcntl file locking benchmark + .SH SYNOPSIS +-.B lat_ctx ++.B lat_fcntl + [ + .I "-P " + ] +diff --git a/doc/lat_fifo.8 b/doc/lat_fifo.8 +index 65e5a08..90bc900 100644 +--- a/doc/lat_fifo.8 ++++ b/doc/lat_fifo.8 +@@ -3,7 +3,7 @@ + .SH NAME + lat_fifo \- FIFO benchmark + .SH SYNOPSIS +-.B lat_ctx ++.B lat_fifo + [ + .I "-P " + ] +diff --git a/doc/lat_http.8 b/doc/lat_http.8 +index a4bb459..99c5d4a 100644 +--- a/doc/lat_http.8 ++++ b/doc/lat_http.8 +@@ -1,9 +1,9 @@ + .\" $Id$ +-.TH LAT_FCNTL 8 "$Date$" "(c)1994-2000 Carl Staelin and Larry McVoy" "LMBENCH" ++.TH LAT_HTTP 8 "$Date$" "(c)1994-2000 Carl Staelin and Larry McVoy" "LMBENCH" + .SH NAME +-lat_fcntl \- fcntl file locking benchmark ++lat_http \- http GET request latency + .SH SYNOPSIS +-.B lat_ctx ++.B lat_http + [ + .I "-d" + ] +diff --git a/doc/lat_select.8 b/doc/lat_select.8 +index 03f83bf..e13499f 100644 +--- a/doc/lat_select.8 ++++ b/doc/lat_select.8 +@@ -3,7 +3,7 @@ + .SH NAME + lat_select \- select benchmark + .SH SYNOPSIS +-.B lat_ctx ++.B lat_select + [ + .I "-P " + ] +diff --git a/doc/lat_sig.8 b/doc/lat_sig.8 +index 91baf78..19a8838 100644 +--- a/doc/lat_sig.8 ++++ b/doc/lat_sig.8 +@@ -3,7 +3,7 @@ + .SH NAME + lat_sig \- select benchmark + .SH SYNOPSIS +-.B lat_ctx ++.B lat_sig + [ + .I "-P " + ] +-- +2.17.1 + diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0001-lat_fifo-Fix-cleanup-sequence.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-lat_fifo-Fix-cleanup-sequence.patch new file mode 100644 index 0000000000..42b14cecee --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-lat_fifo-Fix-cleanup-sequence.patch @@ -0,0 +1,42 @@ +From 78912c0ac5e090095a2f2bd6226e02cce949e72e Mon Sep 17 00:00:00 2001 +From: He Zhe +Date: Fri, 22 Jan 2021 10:03:38 +0000 +Subject: [PATCH] lat_fifo: Fix cleanup sequence + +Files should be unlinked after all users exit. + +Signed-off-by: He Zhe +--- + src/lat_fifo.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/lat_fifo.c b/src/lat_fifo.c +index c625161..85bb9d1 100644 +--- a/src/lat_fifo.c ++++ b/src/lat_fifo.c +@@ -120,16 +120,16 @@ cleanup(iter_t iterations, void * cookie) + + if (iterations) return; + +- unlink(state->filename1); +- unlink(state->filename2); +- close(state->wr); +- close(state->rd); +- + if (state->pid > 0) { +- kill(state->pid, 15); ++ kill(state->pid, SIGKILL); + waitpid(state->pid, NULL, 0); + state->pid = 0; + } ++ ++ unlink(state->filename1); ++ unlink(state->filename2); ++ close(state->wr); ++ close(state->rd); + } + + void +-- +2.29.2 + diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0001-lat_http.c-Add-printf-format.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-lat_http.c-Add-printf-format.patch new file mode 100644 index 0000000000..943b3ec889 --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-lat_http.c-Add-printf-format.patch @@ -0,0 +1,24 @@ +From 7c05fa5353ad91acae6e5e8a01f65d54935ef778 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 27 Jun 2017 14:39:10 -0700 +Subject: [PATCH] lat_http.c: Add printf format + +Signed-off-by: Khem Raj + +--- + src/lat_http.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lat_http.c b/src/lat_http.c +index c630d59..28d04f7 100644 +--- a/src/lat_http.c ++++ b/src/lat_http.c +@@ -27,7 +27,7 @@ http(char *server, char *file, int prog) + sock = tcp_connect(server, prog, SOCKOPT_REUSE); + sprintf(buf, "GET /%s HTTP/1.0\r\n\r\n\n", file); + if (debug) { +- printf(buf); ++ printf("%s", buf); + } + write(sock, buf, strlen(buf)); + while ((n = read(sock, buf, XFERSIZE)) > 0) { diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0001-lmbench-Point-webpage-lm-to-target-directory.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-lmbench-Point-webpage-lm-to-target-directory.patch new file mode 100644 index 0000000000..4a26b8ea7a --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-lmbench-Point-webpage-lm-to-target-directory.patch @@ -0,0 +1,77 @@ +From 353e8a62bf3cb5f1b9504efa16b8b974e93cac49 Mon Sep 17 00:00:00 2001 +From: He Zhe +Date: Fri, 22 Jan 2021 10:58:41 +0800 +Subject: [PATCH] lmbench: Point webpage-lm to target directory + +As webpage-lm.tar has been copied to ${datadir}\lmbench. +Plus improve 'hello' copying in lmbench script. + +Signed-off-by: He Zhe +--- + scripts/lmbench | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/scripts/lmbench b/scripts/lmbench +index 7a52cb1..82e36b6 100755 +--- a/scripts/lmbench ++++ b/scripts/lmbench +@@ -167,7 +167,7 @@ if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_UNIX = XYES ]; then + lat_unix -P $SYNC_MAX + fi + if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_PROC = XYES ]; then +- cp hello /tmp/hello ++ cp `which hello` /tmp/hello + for i in fork exec shell + do lat_proc -P $SYNC_MAX $i + done +@@ -237,14 +237,14 @@ fi + + date >> ${OUTPUT} + echo Local networking >> ${OUTPUT} +-if [ ! -d ../../src/webpage-lm ] +-then (cd ../../src && tar xf webpage-lm.tar) ++if [ ! -d /usr/share/lmbench/webpage-lm ] ++then (cd /usr/share/lmbench && tar xf webpage-lm.tar) + sync + sleep 1 + fi + SERVERS="lat_udp lat_tcp lat_rpc lat_connect bw_tcp" + for server in $SERVERS; do $server -s; done +-DOCROOT=../../src/webpage-lm lmhttp 8008 & ++DOCROOT=/usr/share/lmbench/webpage-lm lmhttp 8008 & + sleep 2; + + if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_UDP = XYES ]; then +@@ -280,15 +280,15 @@ bw_tcp -S localhost + + if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_HTTP = XYES ]; then + # I want a hot cache number +- lat_http localhost 8008 < ../../src/webpage-lm/URLS > /dev/null 2>&1 +- lat_http localhost 8008 < ../../src/webpage-lm/URLS ++ lat_http localhost 8008 < /usr/share/lmbench/webpage-lm/URLS > /dev/null 2>&1 ++ lat_http localhost 8008 < /usr/share/lmbench/webpage-lm/URLS + fi + lat_http -S localhost 8008 + + for remote in $REMOTE + do + echo Networking to $remote >> ${OUTPUT} +- $RCP $SERVERS lmhttp ../../src/webpage-lm.tar ${remote}:/tmp ++ $RCP $SERVERS lmhttp /usr/share/lmbench/webpage-lm.tar ${remote}:/tmp + for server in $SERVERS + do $RSH $remote -n /tmp/$server -s & + done +@@ -327,8 +327,8 @@ do + + if [ X$BENCHMARK_OS = XYES -o X$BENCHMARK_HTTP = XYES ]; then + # I want a hot cache number +- lat_http $remote 8008 < ../../src/webpage-lm/URLS > /dev/null 2>&1 +- lat_http $remote 8008 < ../../src/webpage-lm/URLS ++ lat_http $remote 8008 < /usr/share/lmbench/webpage-lm/URLS > /dev/null 2>&1 ++ lat_http $remote 8008 < /usr/share/lmbench/webpage-lm/URLS + fi + lat_http -S $remote 8008 + +-- +2.17.1 + diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch new file mode 100644 index 0000000000..04cef960fc --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch @@ -0,0 +1,34 @@ +From ea683a0dbaa30a0bf101adb09a1a2531c7112c62 Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Mon, 27 Aug 2018 11:02:45 +0800 +Subject: [PATCH] src/Makefile: use libdir instead of hardcoded /lib + +use libdir instead of hardcoded /lib + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Mingli Yu +--- + src/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 4678d54..b73ddb6 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -141,10 +141,10 @@ install-target: + if [ ! -d $(BASE) ]; then mkdir $(BASE); fi + if [ ! -d $(BASE)/bin ]; then mkdir $(BASE)/bin; fi + if [ ! -d $(BASE)/include ]; then mkdir $(BASE)/include; fi +- if [ ! -d $(BASE)/lib ]; then mkdir $(BASE)/lib; fi ++ if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir $(DESTDIR)$(libdir); fi + cp $(EXES) $(BASE)/bin + cp $(INCS) $(BASE)/include +- cp $O/lmbench.a $(BASE)/lib/libmbench.a ++ cp $O/lmbench.a $(DESTDIR)$(libdir)/libmbench.a + cd ../doc; env MAKEFLAGS="$(MAKEFLAGS)" make CC="${CC}" OS="${OS}" BASE="$(BASE)" install + + +-- +2.7.4 + diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch new file mode 100644 index 0000000000..1d5d9c12ab --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch @@ -0,0 +1,73 @@ +From b27c253bfb78fa3c5f416e6caee101098a4b58cc Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 12 Jul 2017 18:09:46 -0700 +Subject: [PATCH] build: Adjust CFLAGS/LDFLAGS to append values passed from env + +For musl we have to pass additional arguments via cflags and ldflags +to link in librirpc, make room for those changes to take effect + +Signed-off-by: Khem Raj + +--- + scripts/build | 2 +- + src/Makefile | 14 +++++++------- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/scripts/build b/scripts/build +index 34a1371..3786741 100755 +--- a/scripts/build ++++ b/scripts/build +@@ -18,7 +18,7 @@ done + + trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BASE}$$.o ${BASE}$$; exit 1' 1 2 15 + +-LDLIBS=-lm ++LDLIBS="$LDLIBS -lm" + + # check for HP-UX's ANSI compiler + echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c +diff --git a/src/Makefile b/src/Makefile +index d9efd54..96467d7 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -112,8 +112,8 @@ LIBOBJS= $O/lib_tcp.o $O/lib_udp.o $O/lib_unix.o $O/lib_timing.o \ + $O/lib_sched.o + + lmbench: $(UTILS) +- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all +- -@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt ++ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all ++ -@env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt + + results: lmbench + @env OS="${OS}" ../scripts/config-run +@@ -137,7 +137,7 @@ os: lmbench + @env OS="${OS}" BENCHMARK_HARDWARE=NO BENCHMARK_OS=YES ../scripts/results + + install: lmbench +- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target ++ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build install-target + + install-target: + if [ ! -d $(BASE) ]; then mkdir $(BASE); fi +@@ -155,16 +155,16 @@ all: $(EXES) $O/lmbench + opt: $(OPT_EXES) + asm: $(ASMS) + $(ASMS): +- $(CC) -S $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ `basename $@ .s`.c ++ $(CC) -S $(CFLAGS) $(CPPFLAGS) -o $@ `basename $@ .s`.c $(LDFLAGS) + + Wall: +- @env CFLAGS="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt ++ @env CFLAGS+="-g -O -Wall" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt + + debug: +- @env CFLAGS="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt ++ @env CFLAGS+="-g -O -DDEBUG" MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build all opt + + assembler: +- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm ++ @env CFLAGS+=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="${CC}" OS="${OS}" ../scripts/build asm + + + tag: diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/fix-lmbench-memory-check-failure.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/fix-lmbench-memory-check-failure.patch new file mode 100644 index 0000000000..cbab5c424e --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/fix-lmbench-memory-check-failure.patch @@ -0,0 +1,215 @@ +From 65180976c9963432d166b47a0b692260a69c0d47 Mon Sep 17 00:00:00 2001 +From: Qingming Su +Date: Tue, 19 Aug 2014 05:16:17 -0400 +Subject: [PATCH] lmbench: Can't proceed on some targets + +lmbench can't proceed on some targets. The memory check fails because the +memory latency of each page is longer then 10us, which is a time limit set +in the original memsize.c. + +The memory latency is very different on different targets due to the +hardware and current system load. The targets with slower memory +chips or heavy system load need much longer time to read or write +the memory. + +This fix changes the fixed time limit of 10us to a specific value calculated +from the runtime target. + +Also set an upper limit of memory size used for lmbench testing. The memory +check sometimes fails if the target has a large amount of memory, for +example more than 4G. + +Signed-off-by: Qingming Su +Signed-off-by: Fupan Li + +Add and reword above comments + +Upstream-status: inappropriate [ configuration ] + +Signed-off-by: Mark Hatle + +--- + scripts/config-run | 12 +++++++--- + src/Makefile | 4 ++-- + src/memsize.c | 66 +++++++++++++++++++++++++++++++++++------------------- + 3 files changed, 54 insertions(+), 28 deletions(-) + +diff --git a/scripts/config-run b/scripts/config-run +index 918cbdf..096ed12 100755 +--- a/scripts/config-run ++++ b/scripts/config-run +@@ -197,6 +197,12 @@ The bigger the range, the more accurate the results, but larger sizes + take somewhat longer to run the benchmark. + + EOF ++ ++# By default, use 512M memory as the upper limit for lmbench test ++if [ $MB -gt 512 ];then ++MB=512 ++fi ++ + echo $ECHON "MB [default $MB]: $ECHOC" + read TMP + if [ X$TMP != X ] +@@ -687,10 +693,10 @@ case $MAIL in + ;; + esac + +-INFO=`../scripts/info` ++INFO=`../scripts/hostinfo` + if [ $MAIL = yes ] + then if [ ! -f $INFO ] +- then cp ../scripts/info-template $INFO ++ then cp ../scripts/hostinfo-template $INFO + chmod +w $INFO + REUSE=no + else +@@ -733,7 +739,7 @@ EOF + then EDITOR=$TMP + fi + if [ X$EDITOR != "none" ] +- then $EDITOR `../scripts/info` ++ then $EDITOR `../scripts/hostinfo` + fi + fi + fi +diff --git a/src/Makefile b/src/Makefile +index c7e4e3c..d9efd54 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -50,7 +50,7 @@ TARGET=`../scripts/target` + BINDIR=../bin/$(OS) + CONFIG=../bin/$(OS)/`../scripts/config` + UTILS=../scripts/target ../scripts/os ../scripts/gnu-os ../scripts/compiler \ +- ../scripts/info ../scripts/info-template ../scripts/version \ ++ ../scripts/hostinfo ../scripts/hostinfo-template ../scripts/version \ + ../scripts/config ../scripts/config-run ../scripts/results \ + ../scripts/lmbench ../scripts/make ../scripts/build + INSTALL=cp +@@ -240,7 +240,7 @@ $O/getopt.o : getopt.c $(INCS) + $(COMPILE) -c getopt.c -o $O/getopt.o + + $(UTILS) : +- -cd ../scripts; make get ++ -cd ../scripts; cp info hostinfo; cp info-template hostinfo-template + + # Do not remove the next line, $(MAKE) depend needs it + # MAKEDEPEND follows +diff --git a/src/memsize.c b/src/memsize.c +index eb25a09..82d7faf 100644 +--- a/src/memsize.c ++++ b/src/memsize.c +@@ -14,9 +14,12 @@ char *id = "$Id$\n"; + + #define CHK(x) if ((x) == -1) { perror("x"); exit(1); } + +-#ifndef TOO_LONG +-#define TOO_LONG 10 /* usecs */ +-#endif ++//#ifndef TOO_LONG ++//#define TOO_LONG 10 /* usecs */ ++//#endif ++ ++#define MEMORY_SIZE_1MB (1024 * 1024) ++#define MEMORY_SIZE_8MB (8 * 1024 * 1024) + + int alarm_triggered = 0; + +@@ -35,10 +38,10 @@ main(int ac, char **av) + size_t delta; + + if (ac == 2) { +- max = size = bytes(av[1]) * 1024 * 1024; ++ max = size = bytes(av[1]) * MEMORY_SIZE_1MB; + } +- if (max < 1024 * 1024) { +- max = size = 1024 * 1024 * 1024; ++ if (max < MEMORY_SIZE_1MB) { ++ max = size = 1024 * MEMORY_SIZE_1MB; + } + /* + * Binary search down and then binary search up +@@ -48,7 +51,7 @@ main(int ac, char **av) + } + /* delta = size / (2 * 1024 * 1024) */ + for (delta = (size >> 21); delta > 0; delta >>= 1) { +- uint64 sz = (uint64)size + (uint64)delta * 1024 * 1024; ++ uint64 sz = (uint64)size + (uint64)delta * MEMORY_SIZE_1MB; + size_t check = sz; + if (max < sz) continue; + if (check < sz || !test_malloc(sz)) break; +@@ -66,41 +69,58 @@ timeit(char *where, size_t size) + { + int sum = 0; + size_t n; +- size_t s_prev; ++ size_t s_prev = MEMORY_SIZE_8MB; + size_t range; +- size_t incr = 1024 * 1024; ++ size_t incr = MEMORY_SIZE_1MB; + size_t pagesize = getpagesize(); +- unsigned long long s; +- +- if (size < 1024*1024 - 16*1024) { +- fprintf(stderr, "Bad size\n"); +- return; +- } ++ size_t time_each_page = 0; ++ size_t too_long = 0; ++ unsigned long long s; ++ ++ if (pagesize < MEMORY_SIZE_1MB) ++ range = MEMORY_SIZE_1MB; ++ else ++ range = MEMORY_SIZE_8MB; ++ ++ incr = MEMORY_SIZE_1MB; ++ ++ if (size < range) { ++ fprintf(stderr, "Bad size\n"); ++ return; ++ } ++ ++ //Touch range of memory, get the average time (usec) of operating each memory page on this system ++ start(0); ++ touchRange(where, range, pagesize); ++ sum = stop(0, 0); ++ ++ if ((time_each_page = sum * pagesize / range) < 1) ++ time_each_page = 1; ++ //Set the uper limit of time spending on one page ++ too_long = 10 * time_each_page; + +- range = 1024 * 1024; +- incr = 1024 * 1024; +- touchRange(where, range, pagesize); + for (range += incr; range <= size; range += incr) { + n = range / pagesize; +- set_alarm(n * TOO_LONG); ++ set_alarm(n * too_long); + touchRange(where + range - incr, incr, pagesize); + clear_alarm(); +- set_alarm(n * TOO_LONG); ++ set_alarm(n * too_long); + start(0); + touchRange(where, range, pagesize); + sum = stop(0, 0); + clear_alarm(); +- if ((sum / n) > TOO_LONG || alarm_triggered) { ++ if ((sum / n) > too_long || alarm_triggered) { + size = range - incr; ++ fprintf(stderr, "Error! Memory testing timeout! Touch one page of memory needs more than %d (usecs)\n ", too_long); + break; + } +- for (s = 8 * 1024 * 1024; s <= range; s_prev = s, s *= 2) ++ for (s = s_prev; s <= range; s_prev = s, s *= 2) + if (s < s_prev) break; + incr = s / 8; + if (range < size && size < range + incr) { + incr = size - range; + } +- fprintf(stderr, "%dMB OK\r", (int)(range/(1024*1024))); ++ fprintf(stderr, "%dMB OK\r", (int)(range/MEMORY_SIZE_1MB)); + } + fprintf(stderr, "\n"); + printf("%d\n", (int)(size>>20)); diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/lmbench_result_html_report.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/lmbench_result_html_report.patch new file mode 100644 index 0000000000..30708c81db --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/lmbench_result_html_report.patch @@ -0,0 +1,69 @@ +From b21ca9f3911628fb66f308c6916485bbbcfb29a4 Mon Sep 17 00:00:00 2001 +From: Lin Yu +Date: Tue, 19 Aug 2014 05:16:16 -0400 +Subject: [PATCH] lmbench: Fix "make html" graph failure + +The html-list perl script cannot parse the first line of the result +files about the lmbench version. + +Additional fixes are to make the result's html pages easier to understand. + +Signed-off-by: Lin Yu +Signed-off-by: Fupan Li + +Reworded patch description. + +Upstream-status: inappropriate [ configuration ] + +Signed-off-by: Mark Hatle + +--- + results/Makefile | 1 + + scripts/html-list | 7 ++----- + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/results/Makefile b/results/Makefile +index 0935376..1ef9a15 100644 +--- a/results/Makefile ++++ b/results/Makefile +@@ -186,6 +186,7 @@ paper: + # scratch makes you want a Ghz machine. + html: dirs + -make clean ++ make ps + #$(SCRIPTS)bghtml $(BG) + $(SCRIPTS)html-list $(LIST) + $(MK) LIST="$(LIST)" summary > HTML/summary.out 2> HTML/summary.errs +diff --git a/scripts/html-list b/scripts/html-list +index 9850461..6383115 100755 +--- a/scripts/html-list ++++ b/scripts/html-list +@@ -14,7 +14,7 @@ open(H, ">HTML/specific.html"); + print H <LMBENCH System Results +

LMBENCH System Results

+-

Summary of results

++

Summary of results

+
+ EOF + +@@ -47,7 +47,7 @@ foreach $os (@os) { + open(F, $file); + $_ = ; + close(F); +- next unless /lmbench1.[01]/; ++ next unless /lmbench[0-9]+.[01]/; + chop; + $title = $_; + #s/.lmbench1.? results for //; +@@ -103,10 +103,7 @@ EOF + if $i < $#os; + print S<$title +-Information on this benchmark (Not up to date) +

\n

+- +-LMBENCH table of contents + + System results table of contents +

diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/obey-ranlib.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/obey-ranlib.patch new file mode 100644 index 0000000000..fa5e6dbda3 --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/obey-ranlib.patch @@ -0,0 +1,36 @@ +From 182a5d3dba3f440bbf35551da6d21ab1c990eb58 Mon Sep 17 00:00:00 2001 +From: Noor Ahsan +Date: Mon, 29 Aug 2011 16:17:51 +0000 +Subject: [PATCH] lmbench: Add version 3.0-a9 (initial recipe) + +In some cases the host may have too old of a ranlib to work. Since it's +not exactly a great idea to not be using the cross ranlib anyhow, fix the +Makefile so we can override ranlib and then override it + +Upstream-Status: Inappropriate [build system specific change] + +--- + src/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/Makefile b/src/Makefile +index 4962815..c7a8c79 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -38,6 +38,7 @@ CC=`../scripts/compiler` + MAKE=`../scripts/make` + AR=ar + ARCREATE=cr ++RANLIB=ranlib + + # base of installation location + BASE=/usr/local +@@ -217,7 +218,7 @@ $O/lmbench : ../scripts/lmbench version.h + $O/lmbench.a: $(LIBOBJS) + /bin/rm -f $O/lmbench.a + $(AR) $(ARCREATE) $O/lmbench.a $(LIBOBJS) +- -ranlib $O/lmbench.a ++ -$(RANLIB) $O/lmbench.a + + $O/lib_timing.o : lib_timing.c $(INCS) + $(COMPILE) -c lib_timing.c -o $O/lib_timing.o diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/update-config-script.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/update-config-script.patch new file mode 100644 index 0000000000..44bc7bbcde --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/update-config-script.patch @@ -0,0 +1,22 @@ +From aca1a59d888421c1fc553229b8049be47e8b3ddf Mon Sep 17 00:00:00 2001 +From: Chunrong Guo +Date: Fri, 1 Mar 2013 09:50:42 +0000 +Subject: [PATCH] lmbench: update config script + +Upstream-Status: Pending + +--- + scripts/config | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/config b/scripts/config +index b58cb60..25d9d77 100755 +--- a/scripts/config ++++ b/scripts/config +@@ -3,5 +3,5 @@ + UNAME=`uname -n 2>/dev/null` + if [ X$UNAME = X ] + then echo CONFIG +-else echo CONFIG.$UNAME ++else echo ../scripts/CONFIG.$UNAME + fi diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/update-results-script.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/update-results-script.patch new file mode 100644 index 0000000000..31c4aecbbe --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/update-results-script.patch @@ -0,0 +1,170 @@ +From 4955021bc283be404df62b97b86af3943efd29de Mon Sep 17 00:00:00 2001 +From: Noor Ahsan +Date: Mon, 29 Aug 2011 16:17:51 +0000 +Subject: [PATCH] lmbench: Add version 3.0-a9 (initial recipe) + +Now that we have our binaries in /usr/bin rather than the normal +lmbench hierarchy we need to update the scripts as well to behave well here. + +Upstream-Status: Inappropriate [This is related to the OE-specific behavior +of installing into /usr/bin, etc, rather than dumping everything into +/usr/share/lmbench or similar] + +--- + scripts/config-run | 40 ++++++++++++++++++++-------------------- + scripts/results | 8 +++----- + 2 files changed, 23 insertions(+), 25 deletions(-) + +diff --git a/scripts/config-run b/scripts/config-run +index a2d5ba4..918cbdf 100755 +--- a/scripts/config-run ++++ b/scripts/config-run +@@ -132,20 +132,20 @@ export LMBENCH_SCHED + ############################################################################ + echo $L; echo ""; + echo "Hang on, we are calculating your timing granularity." +-../bin/$OS/msleep 250 +-ENOUGH=`../bin/$OS/enough` ++msleep 250 ++ENOUGH=`enough` + export ENOUGH + echo "OK, it looks like you can time stuff down to $ENOUGH usec resolution." + echo "" + echo "Hang on, we are calculating your timing overhead." +-../bin/$OS/msleep 250 +-TIMING_O=`../bin/$OS/timing_o` ++msleep 250 ++TIMING_O=`timing_o` + export TIMING_O + echo "OK, it looks like your gettimeofday() costs $TIMING_O usecs." + echo "" + echo "Hang on, we are calculating your loop overhead." +-../bin/$OS/msleep 250 +-LOOP_O=`../bin/$OS/loop_o` ++msleep 250 ++LOOP_O=`loop_o` + export LOOP_O + echo "OK, it looks like your benchmark loop costs $LOOP_O usecs." + echo "" +@@ -177,7 +177,7 @@ then + fi + if [ X$MB = X ] + then $ECHON "Probing system for available memory: $ECHOC" +- MB=`../bin/$OS/memsize 4096` ++ MB=`memsize 4096` + fi + TOTAL_MEM=$MB + MB=`echo \( $MB \* 7 \) / 10 | bc 2>/dev/null` +@@ -205,9 +205,9 @@ fi + # Certain machines tend to barf when you try and bcopy 8MB. + # Figure out how much we can use. + echo "Checking to see if you have $MB MB; please wait for a moment..." +-MB=`../bin/$OS/memsize $MB` +-MB=`../bin/$OS/memsize $MB` +-MB=`../bin/$OS/memsize $MB` ++MB=`memsize $MB` ++MB=`memsize $MB` ++MB=`memsize $MB` + if [ `expr $SYNC_MAX \* $MB` -gt `expr $TOTAL_MEM` ] + then + MB=`expr $TOTAL_MEM / $SYNC_MAX` +@@ -223,8 +223,8 @@ then echo Warning: you have only ${MB}MB available memory. + fi + + echo "Hang on, we are calculating your cache line size." +-../bin/$OS/msleep 250 +-LINE_SIZE=`../bin/$OS/lm_line -M ${MB}M` ++msleep 250 ++LINE_SIZE=`lm_line -M ${MB}M` + export LINE_SIZE + echo "OK, it looks like your cache line is $LINE_SIZE bytes." + echo "" +@@ -479,7 +479,7 @@ EOF + then + for i in $disks + do if [ -r $i ] +- then ../bin/$OS/flushdisk $i ++ then flushdisk $i + if [ $? -eq 1 ] + then echo "Must be root to run disk benchmarks." + echo "Root is needed to flush the buffer cache" +@@ -584,7 +584,7 @@ fi + echo $L + echo "" + echo "Calculating mhz, please wait for a moment..." +-MHZ=`../bin/$OS/mhz` ++MHZ=`mhz` + cat< $C + echo DISK_DESC=\"$DISK_DESC\" >> $C + echo OUTPUT=$OUTPUT >> $C +diff --git a/scripts/results b/scripts/results +index cd07c15..d5aa558 100755 +--- a/scripts/results ++++ b/scripts/results +@@ -8,11 +8,11 @@ RESULTS=results/$OS + BASE=../$RESULTS/`uname -n` + EXT=0 + +-if [ ! -f "../bin/$OS/$CONFIG" ] ++if [ ! -f "$CONFIG" ] + then echo "No config file?" + exit 1 + fi +-. ../bin/$OS/$CONFIG ++. $CONFIG + + if [ ! -d ../$RESULTS ] + then mkdir -p ../$RESULTS +@@ -23,11 +23,9 @@ do EXT=`expr $EXT + 1` + RESULTS=$BASE.$EXT + done + +-cd ../bin/$OS +-PATH=.:${PATH}; export PATH + export SYNC_MAX + export OUTPUT +-lmbench $CONFIG 2>../${RESULTS} ++lmbench $CONFIG 2>${RESULTS} + + if [ X$MAIL = Xyes ] + then echo Mailing results diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb index 2046b13f4b..492ea4b10b 100644 --- a/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb +++ b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb @@ -30,6 +30,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \ file://0001-doc-Fix-typos-in-manual-pages.patch \ file://0001-lat_fifo-Fix-cleanup-sequence.patch \ file://0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch \ + file://0001-bench.h-Fix-typo-in-specifying-string.h.patch \ " SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf" SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551" -- cgit v1.2.3-54-g00ecf