added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,31 @@
SUMMARY = "Tests large file IO and creation/deletion of small files"
HOMEPAGE = "http://www.coker.com.au/bonnie++/"
SECTION = "benchmark/tests"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://copyright.txt;md5=cd4dde95a6b9d122f0a9150ae9cc3ee0"
SRC_URI = "http://www.coker.com.au/bonnie++/${BPN}_${PV}.tgz \
"
SRC_URI[md5sum] = "1414aab86e2db1b4691bd4be82031012"
SRC_URI[sha256sum] = "507bd2ce5360c7c98b91b0fdc2bed5c9320b5c9699f7d4a3d1c86b256896c15e"
inherit autotools-brokensep
SCRIPTS = "bon_csv2html bon_csv2txt"
EXES = "bonnie++ zcav"
TARGET_CC_ARCH += "${LDFLAGS}"
do_install () {
install -d ${D}/${bindir}
install -d ${D}/${sbindir}
install -m 0755 ${EXES} ${D}/${sbindir}
install -m 0755 ${SCRIPTS} ${D}/${bindir}
}
PACKAGES =+ "bonnie-scripts"
FILES:${PN} = "${sbindir}"
FILES:bonnie-scripts = "${bindir}"
RDEPENDS:bonnie-scripts += "perl"

View File

@@ -0,0 +1,69 @@
From 064a63860bf9ee4bf54facb76ca66f9f957d4797 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 29 Jan 2019 11:12:38 -0800
Subject: [PATCH] cpuburn*.S: Remove .func/.endfunc
These are needed to generate stabs debug info which we dont use
and are silently ignored by gnu assembler when unused, clang assembler
however barfs, so remove them
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
cpuburn-a7.S | 2 --
cpuburn-a8.S | 2 --
cpuburn-a9.S | 2 --
3 files changed, 6 deletions(-)
diff --git a/cpuburn-a7.S b/cpuburn-a7.S
index 74e925a..c1e308c 100644
--- a/cpuburn-a7.S
+++ b/cpuburn-a7.S
@@ -42,7 +42,6 @@
.global main
-.func main
.type main, %function
main:
push {r4-r12, lr}
@@ -88,4 +87,3 @@ main:
mov r0, #0
pop {r4-r12, pc}
-.endfunc
diff --git a/cpuburn-a8.S b/cpuburn-a8.S
index c6f93a6..a42f5a5 100644
--- a/cpuburn-a8.S
+++ b/cpuburn-a8.S
@@ -46,7 +46,6 @@
/* 16 seems to be a good choice */
#define STEP 16
-.func main
.thumb_func
main:
mov lr, pc
@@ -70,4 +69,3 @@ main:
subs lr, lr, #(STEP * 4)
.endr
bne 0b
-.endfunc
diff --git a/cpuburn-a9.S b/cpuburn-a9.S
index 0338b00..a1ccae5 100644
--- a/cpuburn-a9.S
+++ b/cpuburn-a9.S
@@ -48,7 +48,6 @@
/* 64 seems to be a good choice */
#define STEP 64
-.func main
.type main, %function
main:
@@ -94,4 +93,3 @@ main:
subsne lr, lr, #(STEP * 4)
.endr
bne 0b
-.endfunc

View File

@@ -0,0 +1,47 @@
From c2adcca93a0075665a8195caad49b89785886e8e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 29 Jan 2019 12:02:22 -0800
Subject: [PATCH] burn.S: Add
This is originally from
https://hardwarebug.org/files/burn.S
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
burn.S | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 burn.S
diff --git a/burn.S b/burn.S
new file mode 100644
index 0000000..c372c87
--- /dev/null
+++ b/burn.S
@@ -0,0 +1,26 @@
+ .arch armv7-a
+ .fpu neon
+
+ .text
+
+ .global main
+ .type main, STT_FUNC
+ .func main
+main:
+ bic sp, sp, #15
+1:
+ vld1.8 {q8}, [sp,:128]
+ smuad r6, r4, r5
+ veor q9, q0, q1
+ add lr, r4, r5
+ ldr ip, [sp]
+ vext.8 q10, q3, q4, #1
+ eor r5, r4, r5
+ vadd.i32 q11, q0, q1
+ smusd r6, r4, r5
+ ldr r2, [sp]
+ vext.8 q12, q1, q2, #3
+ ssub8 lr, r4, r5
+ vmul.u16 q13, q0, q4
+ b 1b
+.endfunc

View File

@@ -0,0 +1,31 @@
From 078df5b25d75578bb0448ca53514c23debe6d920 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 29 Jan 2019 12:03:11 -0800
Subject: [PATCH] burn.S: Remove .func/.endfunc
These are useless on Linux systems where we use dwarf debug info instead
of stabs
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
burn.S | 2 --
1 file changed, 2 deletions(-)
diff --git a/burn.S b/burn.S
index c372c87..4458f51 100644
--- a/burn.S
+++ b/burn.S
@@ -5,7 +5,6 @@
.global main
.type main, STT_FUNC
- .func main
main:
bic sp, sp, #15
1:
@@ -23,4 +22,3 @@ main:
ssub8 lr, r4, r5
vmul.u16 q13, q0, q4
b 1b
-.endfunc

View File

@@ -0,0 +1,52 @@
SUMMARY = "A collection of cpuburn programs tuned for different ARM hardware"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://cpuburn-a53.S;beginline=1;endline=22;md5=3b7ccd70144c16d3fe14ac491c2d4a87"
RPROVIDES:${PN} = "cpuburn-neon"
PROVIDES += "cpuburn-neon"
SRCREV = "ad7e646700d14b81413297bda02fb7fe96613c3f"
PV = "1.0+git${SRCPV}"
SRC_URI = "git://github.com/ssvb/cpuburn-arm.git;branch=master;protocol=https \
file://0001-cpuburn-a8.S-Remove-.func-.endfunc.patch \
file://0002-burn.S-Add.patch \
file://0003-burn.S-Remove-.func-.endfunc.patch \
"
S = "${WORKDIR}/git"
do_compile() {
# If the arch is set to ARM 64-bit - we only produce and ship burn-a53 version.
# In case of ARM 32-bit - we would build all variants, since burn-a53 supports both
# 32 and 64-bit builds
if ${@bb.utils.contains('TUNE_FEATURES', 'aarch64', 'true', 'false', d)}; then
${CC} ${CFLAGS} ${LDFLAGS} cpuburn-a53.S -o burn-a53
else
${CC} ${CFLAGS} ${LDFLAGS} burn.S -o burn
${CC} ${CFLAGS} ${LDFLAGS} cpuburn-a7.S -o burn-a7
${CC} ${CFLAGS} ${LDFLAGS} cpuburn-a8.S -o burn-a8
${CC} ${CFLAGS} ${LDFLAGS} cpuburn-a9.S -o burn-a9
${CC} ${CFLAGS} ${LDFLAGS} cpuburn-a53.S -o burn-a53
${CC} ${CFLAGS} ${LDFLAGS} cpuburn-krait.S -o burn-krait
fi
}
do_install() {
install -d ${D}${bindir}
if ${@bb.utils.contains('TUNE_FEATURES', 'aarch64', 'true', 'false', d)}; then
install -m 0755 burn-a53 ${D}${bindir}
else
for f in burn burn-a7 burn-a8 burn-a9 burn-a53 burn-krait; do
install -m 0755 $f ${D}${bindir}/$f
done
fi
}
COMPATIBLE_MACHINE ?= "(^$)"
COMPATIBLE_MACHINE:armv7a = "(.*)"
COMPATIBLE_MACHINE:armv7ve = "(.*)"
COMPATIBLE_MACHINE:aarch64 = "(.*)"

View File

@@ -0,0 +1,26 @@
SUMMARY = "The dbench (disk) and tbench (TCP) benchmarks"
SUMMARY:dbench = "Filesystem load benchmark"
SUMMARY:tbench = "TCP load benchmark"
HOMEPAGE = "http://samba.org/ftp/tridge/dbench/"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
DEPENDS = "popt"
SRC_URI = "\
http://samba.org/ftp/tridge/dbench/dbench-${PV}.tar.gz \
file://destdir.patch \
file://makefile.patch"
inherit autotools
PACKAGES =+ "tbench"
RPROVIDES:${PN}-dbg += "tbench-dbg"
TARGET_CC_ARCH += "${LDFLAGS}"
FILES:tbench = "${bindir}/tbench* ${prefix}/share/client.txt"
SRC_URI[md5sum] = "1fe56ff71b9a416f8889d7150ac54da4"
SRC_URI[sha256sum] = "6001893f34e68a3cfeb5d424e1f2bfef005df96a22d86f35dc770c5bccf3aa8a"

View File

@@ -0,0 +1,28 @@
Append $(DESTDIR) to all $(bindir), $(datadir) and $(mandir). Got
this patch from OE commit id 709c4d66e0b107ca606941b988bad717c0b45d9b
Upstream-Status: Inappropriate [not author]
Index: dbench-3.04/Makefile.in
===================================================================
--- dbench-3.04.orig/Makefile.in 2006-09-17 20:21:07.000000000 +0200
+++ dbench-3.04/Makefile.in 2006-09-17 20:21:36.000000000 +0200
@@ -32,12 +32,12 @@
# Careful here: don't install client.txt over itself.
install: all
- ${INSTALLCMD} -d $(bindir) $(datadir) $(mandir)
- ${INSTALLCMD} dbench tbench tbench_srv $(bindir)
- ${INSTALLCMD} client.txt $(datadir)
- ${INSTALLCMD} -m644 dbench.1 $(mandir)
- ln -sf dbench.1 $(mandir)/tbench.1
- ln -sf dbench.1 $(mandir)/tbench_srv.1
+ ${INSTALLCMD} -d $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) $(DESTDIR)$(mandir)
+ ${INSTALLCMD} dbench tbench tbench_srv $(DESTDIR)$(bindir)
+ ${INSTALLCMD} @top_srcdir@/client.txt $(DESTDIR)$(datadir)
+ ${INSTALLCMD} -m644 @top_srcdir@/dbench.1 $(DESTDIR)$(mandir)
+ ln -sf dbench.1 $(DESTDIR)$(mandir)/tbench.1
+ ln -sf dbench.1 $(DESTDIR)$(mandir)/tbench_srv.1
clean:
rm -f *.o *~ dbench tbench tbench_srv

View File

@@ -0,0 +1,18 @@
Add space between install -m option and its argument. Got this patch from
OE 709c4d66e0b107ca606941b988bad717c0b45d9b
Upstream-Status: Inappropriate [not author]
Index: dbench-4.0/Makefile.in
===================================================================
--- dbench-4.0.orig/Makefile.in
+++ dbench-4.0/Makefile.in
@@ -35,7 +35,7 @@ install: all
${INSTALLCMD} -d $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) $(DESTDIR)$(mandir)
${INSTALLCMD} dbench tbench tbench_srv $(DESTDIR)$(bindir)
${INSTALLCMD} @top_srcdir@/client.txt $(DESTDIR)$(datadir)
- ${INSTALLCMD} -m644 @top_srcdir@/dbench.1 $(DESTDIR)$(mandir)
+ ${INSTALLCMD} -m 644 @top_srcdir@/dbench.1 $(DESTDIR)$(mandir)
ln -sf dbench.1 $(DESTDIR)$(mandir)/tbench.1
ln -sf dbench.1 $(DESTDIR)$(mandir)/tbench_srv.1

View File

@@ -0,0 +1,81 @@
dhrystone: fix compilation problems
This patch fixes two compilation errors with original
dhrystone sources:
* Redefinition of times() with wrong return type
- Fixed by commenting out the unnecessary redefinition
* Undefined identifier HZ
- Originally HZ was supposed to be the clock frequency
value for times()
- For Linux, the frequency should come from sysconf
- This patch defines global varible HZ and initializes
it from sysconf
Additionally, this patch adds a simple Makefile.
Upstream-Status: Pending
Sign-off-by: Kimmo Surakka <kimmo.surakka@ge.com>
Signed-off-by: Jose Alarcon <jose.alarcon@ge.com>
---
diff -Naur dhry.orig/dhry_1.c dhry/dhry_1.c
--- dhry.orig/dhry_1.c 2015-07-20 14:25:58.059945353 +0300
+++ dhry/dhry_1.c 2015-07-20 12:43:25.318945353 +0300
@@ -45,11 +45,15 @@
#ifdef TIMES
struct tms time_info;
-extern int times ();
+/* extern int times (); */
/* see library function "times" */
#define Too_Small_Time 120
/* Measurements should last at least about 2 seconds */
#endif
+#ifndef HZ
+#include <unistd.h> /* sysconf */
+ long HZ;
+#endif
#ifdef TIME
extern long time();
/* see library function "time" */
@@ -84,6 +88,9 @@
/* Initializations */
+#ifndef HZ
+ HZ = sysconf(_SC_CLK_TCK);
+#endif
Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
diff -Naur dhry.orig/dhry.h dhry/dhry.h
--- dhry.orig/dhry.h 2015-07-20 14:25:58.054945353 +0300
+++ dhry/dhry.h 2015-07-20 12:42:59.903945353 +0300
@@ -420,4 +420,6 @@
} variant;
} Rec_Type, *Rec_Pointer;
-
+#ifndef HZ
+ extern long HZ;
+#endif
diff -Naur dhry.orig/Makefile dhry/Makefile
--- dhry.orig/Makefile 1970-01-01 02:00:00.000000000 +0200
+++ dhry/Makefile 2015-07-20 14:10:45.832945353 +0300
@@ -0,0 +1,15 @@
+CC=gcc
+
+all: dhry
+
+dhry: dhry_1.o dhry_2.o
+ $(CC) $(LDFLAGS) -o $@ $^ $(LOADLIBES) $(LDLIBS)
+
+dhry_1.o: dhry_1.c dhry.h
+
+dhry_2.o: dhry_2.c dhry.h
+
+clean:
+ rm -f *.o *~
+
+.PHONY: all clean

View File

@@ -0,0 +1,27 @@
SUMMARY = "Dhrystone CPU benchmark"
LICENSE = "PD"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/PD;md5=b3597d12946881e13cb3b548d1173851"
SRC_URI = "http://www.netlib.org/benchmark/dhry-c;downloadfilename=dhry-c.shar \
file://dhrystone.patch"
SRC_URI[md5sum] = "75aa5909c174eed98c134be2f56307da"
SRC_URI[sha256sum] = "038a7e9169787125c3451a6c941f3aca5db2d2f3863871afcdce154ef17f4e3e"
# Need to override Makefile variables
EXTRA_OEMAKE = "-e MAKEFLAGS="
do_unpack() {
[ -d ${S} ] || mkdir -p ${S}
cd ${S}
sh ${DL_DIR}/dhry-c.shar
}
do_install() {
install -d ${D}${bindir}
install -m 0755 ${S}/dhry ${D}${bindir}
}
# Prevent procedure merging as required by dhrystone.c:
CFLAGS += "-fno-lto"
CFLAGS:append:toolchain-clang = " -Wno-error=implicit-function-declaration -Wno-error=deprecated-non-prototype -Wno-error=implicit-int"
LDFLAGS += "-fno-lto"

View File

@@ -0,0 +1,44 @@
SUMMARY = "Filesystem and hardware benchmark and stress tool"
DESCRIPTION = "fio is an I/O tool meant to be used both for benchmark and \
stress/hardware verification. It has support for a number of I/O engines, \
I/O priorities (for newer Linux kernels), rate I/O, forked or threaded jobs, \
and much more. It can work on block devices as well as files. fio accepts \
job descriptions in a simple-to-understand text format. Several example job \
files are included. fio displays all sorts of I/O performance information."
HOMEPAGE = "http://freecode.com/projects/fio"
SECTION = "console/tests"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
DEPENDS = "libaio zlib coreutils-native"
DEPENDS += "${@bb.utils.contains('MACHINE_FEATURES', 'pmem', 'pmdk', '', d)}"
RDEPENDS:${PN} = "python3-core bash"
PACKAGECONFIG_NUMA = "numa"
# ARM does not currently support NUMA
PACKAGECONFIG_NUMA:arm = ""
PACKAGECONFIG_NUMA:armeb = ""
PACKAGECONFIG ??= "${PACKAGECONFIG_NUMA}"
PACKAGECONFIG[numa] = ",--disable-numa,numactl"
SRCREV = "db7fc8d864dc4fb607a0379333a0db60431bd649"
SRC_URI = "git://git.kernel.dk/fio.git;branch=master"
S = "${WORKDIR}/git"
# avoids build breaks when using no-static-libs.inc
DISABLE_STATIC = ""
EXTRA_OEMAKE = "CC='${CC}' LDFLAGS='${LDFLAGS}'"
EXTRA_OECONF = "${@bb.utils.contains('MACHINE_FEATURES', 'x86', '--disable-optimizations', '', d)}"
do_configure() {
./configure ${EXTRA_OECONF}
}
do_install() {
oe_runmake install DESTDIR=${D} prefix=${prefix} mandir=${mandir}
install -d ${D}/${docdir}/${PN}
cp -R --no-dereference --preserve=mode,links -v ${S}/examples ${D}/${docdir}/${PN}/
}

View File

@@ -0,0 +1,125 @@
From 56e4959f0bc3e442c813d78e8ab6b3bf64b4ac66 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Wed, 2 Dec 2020 20:27:42 +0000
Subject: [PATCH] fix dispmanx build
For when the user is building "--with-flavors dispmanx-glesv2", fixes a bunch
of "redeclared as different kind of symbol" problems.
This patch is almost entirely from:
https://github.com/glmark2/glmark2/commit/3b1a0f78d03ae126b78ee52a7c434809115e5993
Which was created by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
See:
https://github.com/glmark2/glmark2/issues/80
My contribution is to tweak the wscript to link all the required libraries.
Upstream-Status: Submitted [https://github.com/glmark2/glmark2/pull/135]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
src/native-state-dispmanx.cpp | 22 +++++++++++++++++-----
src/native-state-dispmanx.h | 7 +++----
wscript | 2 +-
3 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/src/native-state-dispmanx.cpp b/src/native-state-dispmanx.cpp
index 2117386..49f74e7 100644
--- a/src/native-state-dispmanx.cpp
+++ b/src/native-state-dispmanx.cpp
@@ -23,13 +23,25 @@
#include "native-state-dispmanx.h"
#include "log.h"
+#include "EGL/egl.h"
+
#include <cstring>
#include <csignal>
+struct NativeStateDispmanx::Private
+{
+ Private()
+ {
+ memset(&egl_dispmanx_window, 0, sizeof(egl_dispmanx_window));
+ }
+
+ EGL_DISPMANX_WINDOW_T egl_dispmanx_window;
+};
+
NativeStateDispmanx::NativeStateDispmanx()
+ : priv{std::make_unique<Private>()}
{
memset(&properties_, 0, sizeof(properties_));
- memset(&egl_dispmanx_window, 0, sizeof(egl_dispmanx_window));
}
NativeStateDispmanx::~NativeStateDispmanx()
@@ -99,9 +111,9 @@ NativeStateDispmanx::create_window(WindowProperties const& properties)
0 /*clamp*/,
DISPMANX_NO_ROTATE);
- egl_dispmanx_window.element = dispmanx_element;
- egl_dispmanx_window.width = dst_rect.width;
- egl_dispmanx_window.height = dst_rect.height;
+ priv->egl_dispmanx_window.element = dispmanx_element;
+ priv->egl_dispmanx_window.width = dst_rect.width;
+ priv->egl_dispmanx_window.height = dst_rect.height;
vc_dispmanx_update_submit_sync(dispmanx_update);
return true;
@@ -111,7 +123,7 @@ void*
NativeStateDispmanx::window(WindowProperties &properties)
{
properties = properties_;
- return &egl_dispmanx_window;
+ return &priv->egl_dispmanx_window;
}
void
diff --git a/src/native-state-dispmanx.h b/src/native-state-dispmanx.h
index a6ed3d4..794b2d3 100644
--- a/src/native-state-dispmanx.h
+++ b/src/native-state-dispmanx.h
@@ -24,10 +24,8 @@
#define GLMARK2_NATIVE_STATE_DISPMANX_H_
#include <vector>
+#include <memory>
#include "bcm_host.h"
-#include "GLES/gl.h"
-#include "EGL/egl.h"
-#include "EGL/eglext.h"
#include "native-state.h"
@@ -46,11 +44,12 @@ public:
void flip();
private:
+ struct Private;
DISPMANX_DISPLAY_HANDLE_T dispmanx_display;
DISPMANX_UPDATE_HANDLE_T dispmanx_update;
DISPMANX_ELEMENT_HANDLE_T dispmanx_element;
- EGL_DISPMANX_WINDOW_T egl_dispmanx_window;
WindowProperties properties_;
+ std::unique_ptr<Private> priv;
};
#endif /* GLMARK2_NATIVE_STATE_DISPMANX_H_ */
diff --git a/wscript b/wscript
index e09fa78..6c3869c 100644
--- a/wscript
+++ b/wscript
@@ -205,7 +205,7 @@ def configure_linux(ctx):
ctx.check_cxx(lib = 'brcmGLESv2', uselib_store = 'glesv2', libpath='/opt/vc/lib')
ctx.check_cxx(lib = ['brcmEGL', 'brcmGLESv2'], uselib_store = 'egl', libpath='/opt/vc/lib')
- ctx.check_cxx(lib = ['bcm_host', 'vcos', 'vchiq_arm'], uselib_store = 'dispmanx', libpath='/opt/vc/lib')
+ ctx.check_cxx(lib = ['brcmEGL', 'brcmGLESv2', 'vchostif', 'bcm_host', 'vcos', 'vchiq_arm'], uselib_store = 'dispmanx', libpath='/opt/vc/lib')
# Check optional packages
opt_pkgs = [('x11', 'x11', None, list_contains(ctx.options.flavors, 'x11')),
--
2.28.0.497.g54e85e7af1

View File

@@ -0,0 +1,32 @@
From 110ef8357ebaf24bc3995e631ec809a2f84c3b87 Mon Sep 17 00:00:00 2001
From: Trevor Woerner <twoerner@gmail.com>
Date: Thu, 3 Dec 2020 07:16:58 -0500
Subject: [PATCH] run dispmanx fullscreen
The dispmanx flavour can only run fullscreen, therefore set the size to
fullscreen when glmark2-es2-dispmanx is run.
Upstream-Status: Submitted [https://github.com/glmark2/glmark2/pull/135]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
src/main.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/main.cpp b/src/main.cpp
index d1077fe..d717cd4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -202,6 +202,11 @@ main(int argc, char *argv[])
Options::size = std::pair<int,int>(800, 600);
}
+#if GLMARK2_USE_DISPMANX
+ /* dispmanx can only run fullscreen */
+ Options::size = std::pair<int,int>(-1, -1);
+#endif
+
// Create the canvas
#if GLMARK2_USE_EGL
GLStateEGL gl_state;
--
2.25.1

View File

@@ -0,0 +1,63 @@
SUMMARY = "OpenGL (ES) 2.0 benchmark"
DESCRIPTION = "glmark2 is a benchmark for OpenGL (ES) 2.0. \
It uses only the subset of the OpenGL 2.0 API that is compatible with OpenGL ES 2.0."
HOMEPAGE = "https://github.com/glmark2/glmark2"
BUGTRACKER = "https://github.com/glmark2/glmark2/issues"
LICENSE = "GPL-3.0-or-later & SGI-1"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://COPYING.SGI;beginline=5;md5=269cdab4af6748677acce51d9aa13552"
DEPENDS = "libpng jpeg udev"
DEPENDS:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland-native wayland-protocols', '', d)}"
PV = "2023.01"
SRC_URI = " \
git://github.com/glmark2/glmark2.git;protocol=https;branch=master \
file://0001-fix-dispmanx-build.patch \
file://0002-run-dispmanx-fullscreen.patch \
"
SRCREV = "42e3d8fe3aa88743ef90348138f643f7b04a9237"
S = "${WORKDIR}/git"
inherit meson pkgconfig features_check
ANY_OF_DISTRO_FEATURES = "opengl dispmanx"
PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11-gles2', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'wayland opengl', 'wayland-gles2', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'dispmanx', 'dispmanx', '', d)} \
drm-gles2 \
"
PACKAGECONFIG[x11-gl] = ",,virtual/libgl virtual/libx11"
PACKAGECONFIG[x11-gles2] = ",,virtual/libgles2 virtual/libx11"
PACKAGECONFIG[drm-gl] = ",,virtual/libgl libdrm virtual/libgbm"
PACKAGECONFIG[drm-gles2] = ",,virtual/libgles2 libdrm virtual/libgbm"
PACKAGECONFIG[wayland-gl] = ",,virtual/libgl wayland"
PACKAGECONFIG[wayland-gles2] = ",,virtual/libgles2 wayland"
PACKAGECONFIG[dispmanx] = ",,virtual/libgles2 virtual/libx11"
python __anonymous() {
packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
flavors = []
if "x11-gles2" in packageconfig:
flavors.append("x11-glesv2")
if "x11-gl" in packageconfig:
flavors.append("x11-gl")
if "wayland-gles2" in packageconfig:
flavors.append("wayland-glesv2")
if "wayland-gl" in packageconfig:
flavors.append("wayland-gl")
if "drm-gles2" in packageconfig:
flavors.append("drm-glesv2")
if "drm-gl" in packageconfig:
flavors.append("drm-gl")
if "dispmanx" in packageconfig:
flavors = ["dispmanx-glesv2"]
if flavors:
d.appendVar("EXTRA_OEMESON", " -Dflavors=%s" % ",".join(flavors))
}

View File

@@ -0,0 +1,34 @@
From 64389a67b93a53b9fb7e9e20e905a5ee4613606b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 15 Jan 2020 17:10:42 -0800
Subject: [PATCH] let system headers provide pread64()
The signature does not match with system headers anyway
Fixes
iozone.c:1270:9: error: redeclaration of 'pread64' must have the 'overloadable' attribute ssize_t pread64(); ^ /mnt/b/yoe/build/tmp/work/core2-64-yoe-linux/iozone3/488-r0/recipe-sysroot/usr/include/bits/unistd.h:83:1: note: previous overload of function is here pread64 (int __fd, void *const __clang_pass_object_size0 __buf, ^
1 error generated.
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
iozone.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/iozone.c b/iozone.c
index 090dd5f..fdea400 100644
--- a/iozone.c
+++ b/iozone.c
@@ -1267,7 +1267,6 @@ int pit_gettimeofday();
#ifdef HAVE_ANSIC_C
#if defined (HAVE_PREAD) && defined(_LARGEFILE64_SOURCE)
ssize_t pwrite64();
-ssize_t pread64();
#endif
#if !defined(linux)
char *getenv();
--
2.25.0

View File

@@ -0,0 +1,62 @@
LICENSE:
Copyright 1991, 1992, 1994, 1998, 1999, 2002 William D. Norcott
License to freely use and distribute this software is hereby granted
by the author, subject to the condition that this copyright notice
remains intact. The author retains the exclusive right to publish
derivative works based on this work, including, but not limited to
revised versions of this work.
Below is author reply to question about distributing iozone3 in
OpenEmbedded:
========================================================================
Marcin,
Re-distribution is permitted as long as the copyright is
maintained and the source code is not changed. I do not
see a problem with your mods to enable fileop for Linux-arm,
as these mods have been returned to the Iozone folks,
and they have been accepted for inclusion in the next
release :-)
Thank you for your contribution,
Don Capps
----- Original Message -----
From: "Marcin Juszkiewicz" <firma@hrw.one.pl>
To: "Don Capps" <don.capps2@verizon.net>; "William D. Norcott"
<wnorcott@us.oracle.com>
Sent: Sunday, October 29, 2006 4:55 PM
Subject: iozone3 263 patch for arm and License question
> Morning
>
> I want to include iozone3 in OpenEmbedded [1] metadata to give it for
> other developers. Currently OE is used to build few distributions for
> misc platforms: ARM, SH3, SH4, x86, PowerPC and different types of
> machines (PDA, settopbox, devboards, desktops, thin clients, routers).
>
> According to your distribution of derivations is forbidden. Packaging
> iozone3 in OpenEmbedded will not involve any source code changes. But
> when I was building it for ARM I discovered that fileop binary was not
> built - so I created patch for it (attached). Not yet tested it on target
> device.
>
> Thus, I seek your written permission via e-mail to distribute a package of
> the unmodified source code and also a package of the pre-compiled binary.
> Your copyright statement will be included in the package.
>
>
> 1. http://www.openembedded.org/
>
> Regards
> --
> JID: hrw-jabber.org
> OpenEmbedded developer/consultant

View File

@@ -0,0 +1,104 @@
remove libasync.o and libbif.o from deps
there are no implicit rules to build them and they get wrong CFLAGS
when compiled with implicit rule.
They are built as part of iozone_linux.o target anyway
Only fixed linux targets for now
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending
---
current/makefile | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git current/makefile current/makefile
index 3a54701..7071427 100644
--- current/makefile
+++ current/makefile
@@ -171,7 +171,7 @@ hpux_no_ansi: iozone_hpux_no.o libbif.o
#
# GNU 'C' compiler Linux build with threads, largefiles, async I/O
#
-linux: iozone_linux.o libasync.o libbif.o fileop_linux.o pit_server.o
+linux: iozone_linux.o fileop_linux.o pit_server.o
$(CC) -O3 $(CFLAGS) iozone_linux.o libasync.o libbif.o -lpthread \
-lrt -o iozone
$(CC) -O3 $(CFLAGS) -Dlinux fileop_linux.o -o fileop
@@ -180,7 +180,7 @@ linux: iozone_linux.o libasync.o libbif.o fileop_linux.o pit_server.o
#
# GNU 'C' compiler Linux build for powerpc chip with threads, largefiles, async I/O
#
-linux-powerpc: iozone_linux-powerpc.o libbif.o libasync.o fileop_linux-ppc.o pit_server.o
+linux-powerpc: iozone_linux-powerpc.o fileop_linux-ppc.o pit_server.o
$(CC) -O3 $(LDFLAGS) iozone_linux-powerpc.o libasync.o \
libbif.o -lpthread -lrt -o iozone
$(CC) -O3 -Dlinux fileop_linux-ppc.o -o fileop
@@ -188,7 +188,7 @@ linux-powerpc: iozone_linux-powerpc.o libbif.o libasync.o fileop_linux-ppc.o pi
#
# GNU 'C' compiler Linux build for sparc chip with threads, largefiles, async I/O
#
-linux-sparc: iozone_linux-sparc.o libbif.o libasync.o fileop_linux.o pit_server.o
+linux-sparc: iozone_linux-sparc.o fileop_linux.o pit_server.o
$(CC) -O3 $(LDFLAGS) iozone_linux-sparc.o libasync.o libbif.o \
-lpthread -lrt -o iozone
$(CC) -O3 -Dlinux fileop_linux.o -o fileop
@@ -197,7 +197,7 @@ linux-sparc: iozone_linux-sparc.o libbif.o libasync.o fileop_linux.o pit_server
#
# GNU 'C' compiler Linux build with threads, largefiles, async I/O
#
-linux-ia64: iozone_linux-ia64.o libbif.o libasync.o fileop_linux-ia64.o pit_server.o
+linux-ia64: iozone_linux-ia64.o fileop_linux-ia64.o pit_server.o
$(CC) -O3 $(LDFLAGS) iozone_linux-ia64.o libbif.o libasync.o \
-lrt -lpthread -o iozone
$(CC) -O3 -Dlinux fileop_linux-ia64.o -o fileop
@@ -206,7 +206,7 @@ linux-ia64: iozone_linux-ia64.o libbif.o libasync.o fileop_linux-ia64.o pit_ser
#
# GNU 'C' compiler Linux build for powerpc chip with threads, largefiles, async I/O
#
-linux-powerpc64: iozone_linux-powerpc64.o libbif.o libasync.o fileop_linux-ppc64.o pit_server-linux-powerpc64.o
+linux-powerpc64: iozone_linux-powerpc64.o fileop_linux-ppc64.o pit_server-linux-powerpc64.o
$(CC) -O3 -Dunix -DHAVE_ANSIC_C -DSHARED_MEM -DASYNC_IO \
-D_LARGEFILE64_SOURCE -Dlinux \
iozone_linux-powerpc64.o libasync.o libbif.o -lpthread \
@@ -217,7 +217,7 @@ linux-powerpc64: iozone_linux-powerpc64.o libbif.o libasync.o fileop_linux-ppc6
#
# GNU 'C' compiler Linux build with threads, largefiles, async I/O
#
-linux-arm: iozone_linux-arm.o libbif.o libasync.o fileop_linux-arm.o pit_server.o
+linux-arm: iozone_linux-arm.o fileop_linux-arm.o pit_server.o
$(CC) -O3 $(LDFLAGS) iozone_linux-arm.o libbif.o libasync.o \
-lrt -lpthread -o iozone
$(CC) -O3 -Dlinux fileop_linux-arm.o -o fileop
@@ -249,7 +249,7 @@ endif
#
# GNU 'C' compiler Linux build with threads, largefiles, async I/O
#
-linux-AMD64: iozone_linux-AMD64.o libbif.o libasync.o fileop_linux-AMD64.o pit_server.o
+linux-AMD64: iozone_linux-AMD64.o fileop_linux-AMD64.o pit_server.o
$(CC) -O3 $(LDFLAGS) iozone_linux-AMD64.o libbif.o libasync.o \
-lrt -lpthread -o iozone
$(CC) -O3 -Dlinux fileop_linux-AMD64.o -o fileop
@@ -258,7 +258,7 @@ linux-AMD64: iozone_linux-AMD64.o libbif.o libasync.o fileop_linux-AMD64.o pit_
#
# GNU 'C' compiler Linux build with S/390, threads, largfiles, async I/O
#
-linux-S390: iozone_linux-s390.o libbif.o libasync.o fileop_linux-s390.o pit_server.o
+linux-S390: iozone_linux-s390.o fileop_linux-s390.o pit_server.o
$(CC) -O2 $(LDFLAGS) -lpthread -lrt iozone_linux-s390.o \
libbif.o libasync.o -o iozone
$(CC) -O3 -Dlinux fileop_linux-s390.o -o fileop
@@ -267,7 +267,7 @@ linux-S390: iozone_linux-s390.o libbif.o libasync.o fileop_linux-s390.o pit_serv
#
# GNU 'C' compiler Linux build with S/390, threads, largfiles, async I/O
#
-linux-S390X: iozone_linux-s390x.o libbif.o libasync.o fileop_linux-s390x.o pit_server.o
+linux-S390X: iozone_linux-s390x.o fileop_linux-s390x.o pit_server.o
$(CC) -O2 $(LDFLAGS) -lpthread -lrt iozone_linux-s390x.o \
libbif.o libasync.o -o iozone
$(CC) -O3 -Dlinux fileop_linux-s390x.o -o fileop
--
2.25.1

View File

@@ -0,0 +1,121 @@
SUMMARY = "Filesystem and Disk Benchmarking Tool"
HOMEPAGE = "http://www.iozone.org/"
AUTHOR = "Don Capps <don.capps2@verizon.net>, William D. Norcott <wnorcott@us.oracle.com>"
SECTION = "console/tests"
LICENSE = "iozone3"
LIC_FILES_CHKSUM = "file://iozone.c;beginline=37;endline=48;md5=7331260091868dcad0f9edea735b5f4b \
file://iozone.c;beginline=276;endline=282;md5=77f9ee51e45b57a7e7519c4fa0b4f00b \
"
SRC_URI = "http://www.iozone.org/src/current/${BPN}_${PV}.tar \
file://parallelism.patch \
file://0001-let-system-headers-provide-pread64.patch \
file://copyright.txt \
"
SRC_URI[md5sum] = "228f54482c01d1c04c571a9414cd20e5"
SRC_URI[sha256sum] = "322981e168f32bd39f54772b82b2906d598d958c37e954e75742e71baf58bb9b"
UPSTREAM_CHECK_REGEX = "iozone3_(?P<pver>\d+).tar"
S = "${WORKDIR}/${BPN}_${PV}/src/current"
#
# All other arches can use the default OEMAKE except those
# explicitly listed below. Another, the iozone3 Makefile
# needs to be told about the cross-compiler explicitly here.
#
EXTRA_OEMAKE:powerpc = "linux-powerpc CC='${CC}' GCC='${CC}'"
EXTRA_OEMAKE:powerpc64 = "linux-powerpc64 CC='${CC}' GCC='${CC}'"
EXTRA_OEMAKE:powerpc64le = "linux-powerpc64 CC='${CC}' GCC='${CC}'"
EXTRA_OEMAKE:x86-64 = "linux-AMD64 CC='${CC}' GCC='${CC}'"
EXTRA_OEMAKE:arm = "linux-arm CC='${CC}' GCC='${CC}'"
EXTRA_OEMAKE = "linux CC='${CC}' GCC='${CC}'"
TARGET_CC_ARCH += "${LDFLAGS}"
do_install() {
install -d ${D}${bindir} \
${D}${mandir}/man1 \
${D}${datadir}/doc/${BPN}/examples
install -m 0755 ${S}/iozone ${D}${bindir}
install -m 0755 ${S}/fileop ${D}${bindir}
install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/iozone.1 ${D}${mandir}/man1/
install -m 0644 ${WORKDIR}/copyright.txt ${D}${datadir}/doc/${BPN}/
install -m 0644 ${S}/*.dem ${D}${datadir}/doc/${BPN}/examples
install -m 0644 ${S}/client_list ${D}${datadir}/doc/${BPN}/examples
install -m 0644 ${S}/Gnuplot.txt ${D}${datadir}/doc/${BPN}/examples
install -m 0755 ${S}/Generate_Graphs ${D}${datadir}/doc/${BPN}/examples
install -m 0755 ${S}/gengnuplot.sh ${D}${datadir}/doc/${BPN}/examples
install -m 0755 ${S}/report.pl ${D}${datadir}/doc/${BPN}/examples
install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/Iozone_ps.gz ${D}${datadir}/doc/${BPN}/
install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/IOzone_msword_98.pdf ${D}${datadir}/doc/${BPN}/
install -m 0644 ${WORKDIR}/${BPN}_${PV}/docs/Run_rules.doc ${D}${datadir}/doc/${BPN}/
}
FILES:${PN} += "${datadir}/doc/${PN}/copyright.txt"
# LICENSE:
#
# Copyright 1991, 1992, 1994, 1998, 1999, 2002 William D. Norcott
#
# License to freely use and distribute this software is hereby granted
# by the author, subject to the condition that this copyright notice
# remains intact. The author retains the exclusive right to publish
# derivative works based on this work, including, but not limited to
# revised versions of this work.
#
#
# Below is author reply to question about distributing iozone3 in
# OpenEmbedded:
#
# ========================================================================
#
# Marcin,
#
# Re-distribution is permitted as long as the copyright is
# maintained and the source code is not changed. I do not
# see a problem with your mods to enable fileop for Linux-arm,
# as these mods have been returned to the Iozone folks,
# and they have been accepted for inclusion in the next
# release :-)
#
# Thank you for your contribution,
# Don Capps
#
# ----- Original Message -----
# From: "Marcin Juszkiewicz" <firma@hrw.one.pl>
# To: "Don Capps" <don.capps2@verizon.net>; "William D. Norcott"
# <wnorcott@us.oracle.com>
# Sent: Sunday, October 29, 2006 4:55 PM
# Subject: iozone3 263 patch for arm and License question
#
#
# > Morning
# >
# > I want to include iozone3 in OpenEmbedded [1] metadata to give it for
# > other developers. Currently OE is used to build few distributions for
# > misc platforms: ARM, SH3, SH4, x86, PowerPC and different types of
# > machines (PDA, settopbox, devboards, desktops, thin clients, routers).
# >
# > According to your distribution of derivations is forbidden. Packaging
# > iozone3 in OpenEmbedded will not involve any source code changes. But
# > when I was building it for ARM I discovered that fileop binary was not
# > built - so I created patch for it (attached). Not yet tested it on target
# > device.
# >
# > Thus, I seek your written permission via e-mail to distribute a package of
# > the unmodified source code and also a package of the pre-compiled binary.
# > Your copyright statement will be included in the package.
# >
# >
# > 1. http://www.openembedded.org/
# >
# > Regards
# > --
# > JID: hrw-jabber.org
# > OpenEmbedded developer/consultant

View File

@@ -0,0 +1,58 @@
From 6df092a4153c6c37cfaddcabf2cd25a910a7f6e1 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 2 Sep 2019 15:40:52 -0700
Subject: [PATCH] Detect bool definition considering stdbool.h being present
This helps in defining the value correctly on different platforms e.g.
clang/libc++ depends on the definition coming from stdbool.h
current builds fail to compile therefore
TMPDIR/work/cortexa7t2hf-neon-vfpv4-yoe-linux-gnueabi/iperf2/2.0.13-r0/recipe-sysroot/usr/include/c++/v1/type_traits:742:29: error: redefinition of '__libcpp_is_integral<int>'
template <> struct __libcpp_is_integral<int> : public true_type {};
^~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
m4/dast.m4 | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/m4/dast.m4
+++ b/m4/dast.m4
@@ -11,7 +11,12 @@ AH_TEMPLATE([false])
AC_DEFUN(DAST_CHECK_BOOL, [
-AC_CHECK_SIZEOF(bool)
+if test "$ac_cv_header_stdbool_h" = yes; then
+ AC_CHECK_SIZEOF(bool,,[#include <stdbool.h>])
+else
+ AC_CHECK_SIZEOF(bool)
+fi
+
if test "$ac_cv_sizeof_bool" = 0 ; then
AC_DEFINE(bool, int)
fi
--- a/configure.ac
+++ b/configure.ac
@@ -113,7 +113,7 @@ AC_SEARCH_LIBS([socket], [socket], [],
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([arpa/inet.h libintl.h net/ethernet.h net/if.h linux/ip.h linux/udp.h linux/if_packet.h linux/filter.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h signal.h ifaddrs.h])
+AC_CHECK_HEADERS([arpa/inet.h libintl.h net/ethernet.h net/if.h linux/ip.h linux/udp.h linux/if_packet.h linux/filter.h netdb.h netinet/in.h stdbool.h stdlib.h string.h strings.h sys/socket.h sys/time.h syslog.h unistd.h signal.h ifaddrs.h])
dnl ===================================================================
dnl Checks for typedefs, structures
--- a/include/util.h
+++ b/include/util.h
@@ -56,7 +56,9 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -0,0 +1,23 @@
DESCRIPTION = "Iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics"
HOMEPAGE = "https://sourceforge.net/projects/iperf2/"
SECTION = "console/network"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=e136a7b2560d80bcbf0d9b3e1356ecff"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/iperf-${PV}.tar.gz \
file://0001-Detect-bool-definition-considering-stdbool.h-being-p.patch \
"
SRC_URI[md5sum] = "31ea1c6d5cbf80b16ff3abe4288dad5e"
SRC_URI[sha256sum] = "c88adec966096a81136dda91b4bd19c27aae06df4d45a7f547a8e50d723778ad"
S = "${WORKDIR}/iperf-${PV}"
inherit autotools pkgconfig
EXTRA_OECONF = "--exec-prefix=${STAGING_DIR_HOST}${layout_exec_prefix}"
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
CVE_PRODUCT = "iperf_project:iperf"

View File

@@ -0,0 +1,29 @@
From 4801363fbff12bf1019aaf90142981702cecff92 Mon Sep 17 00:00:00 2001
From: Andrey Zhizhikin <andrey.z@gmail.com>
Date: Wed, 3 Feb 2021 20:44:34 +0000
Subject: [PATCH] configure.ac: check for CPP prog
Absence of check for CPP_PROG causes following build errors:
| checking TCP_CONGESTION socket option... ../git/configure: line 14427: CPP: command not found
| ../git/configure: line 14553: ac_fn_c_try_cpp: command not found
| ../git/configure: line 14553: ac_fn_c_try_cpp: command not found
Upstream-Status: Pending
Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index 53a4db4..3462b3e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,6 +48,7 @@ AC_CANONICAL_HOST
# Checks for tools: c compiler, ranlib (used for creating static libraries),
# symlinks and libtool
AC_PROG_CC
+AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_LN_S
LT_INIT

View File

@@ -0,0 +1,30 @@
From 155ae12f7809e387a379703d8c09f227e430336d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 14 Jul 2017 13:00:16 -0700
Subject: [PATCH] Remove -pg from profile_CFLAGS
musl fails to link with missing gcrt1.o
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
src/Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 11d3e17..4058cff 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -58,9 +58,9 @@ if ENABLE_PROFILING
iperf3_profile_SOURCES = main.c \
$(libiperf_la_SOURCES)
-iperf3_profile_CFLAGS = -pg -g
+iperf3_profile_CFLAGS = -g
iperf3_profile_LDADD = libiperf.la
-iperf3_profile_LDFLAGS = -pg -g
+iperf3_profile_LDFLAGS = -g
endif
# Specify the sources and various flags for the test cases

View File

@@ -0,0 +1,34 @@
SUMMARY = "Network benchmark tool"
DESCRIPTION = "\
iperf is a tool for active measurements of the maximum achievable bandwidth \
on IP networks. It supports tuning of various parameters related to timing, \
protocols, and buffers. For each test it reports the bandwidth, loss, and \
other parameters."
HOMEPAGE = "http://software.es.net/iperf/"
SECTION = "console/network"
BUGTRACKER = "https://github.com/esnet/iperf/issues"
AUTHOR = "ESNET <info@es.net>, Lawrence Berkeley National Laboratory <websupport@lbl.gov>"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=dc6301c8256ceb8f71c9e3c2ae9096b9"
SRC_URI = "git://github.com/esnet/iperf.git;branch=master;protocol=https \
file://0002-Remove-pg-from-profile_CFLAGS.patch \
file://0001-configure.ac-check-for-CPP-prog.patch \
"
SRCREV = "f48e7fa92b8932814f3d92f36986d51be9efe6e0"
S = "${WORKDIR}/git"
inherit autotools
PACKAGECONFIG ?= "openssl"
PACKAGECONFIG[lksctp] = "ac_cv_header_netinet_sctp_h=yes,ac_cv_header_netinet_sctp_h=no,lksctp-tools"
PACKAGECONFIG[openssl] = "--with-openssl=${RECIPE_SYSROOT}${prefix},--without-openssl,openssl"
CFLAGS += "-D_GNU_SOURCE"
CVE_PRODUCT = "iperf_project:iperf"

View File

@@ -0,0 +1,30 @@
From 419dac71dd524a39ad2333e91334b4650e277a78 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 25 Jun 2021 09:43:00 -0700
Subject: [PATCH] build: Do not override ldflags from environment
bitbake passed LDFLAGS contain important information e.g. which compiler
runtime to link etc. Therefore append -static to LDFLAGS instead
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index efda5c0..a867876 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ SRCS = $(sort $(wildcard *.c))
OBJS = $(SRCS:.c=.o)
CFLAGS = -Os -D_XOPEN_SOURCE=700
-LDFLAGS = -static
+LDFLAGS += -static
LIBS = -lpthread -lrt -lpthread
--
2.32.0

View File

@@ -0,0 +1,22 @@
SUMMARY = "Tests to compare standard functions of different libc implementations"
DESCRIPTION = "libc-bench is a set of time- and memory-efficiency tests to compare \
implementations of various C/POSIX standard library functions."
HOMEPAGE = "http://www.etalabs.net/libc-bench.html"
SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=9a825c63897c53f487ef900598c31527"
SRCREV = "b6b2ce5f9f87a09b14499cb00c600c601f022634"
PV = "20110206+git${SRCPV}"
SRC_URI = "git://git.musl-libc.org/libc-bench;branch=master \
file://0001-build-Do-not-override-ldflags-from-environment.patch \
"
S = "${WORKDIR}/git"
do_install () {
install -d ${D}${bindir}
install -m 0755 ${B}/libc-bench ${D}${bindir}
}

View File

@@ -0,0 +1,210 @@
From 0a163f60b4a316c4b6f1726a71c84755f3bd85e7 Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa@lge.com>
Date: Wed, 16 Sep 2020 04:36:04 -0700
Subject: [PATCH] Revert "ld.hugetlbfs: fix -Ttext-segment argument on AArch64"
This reverts commit 852dcc963ce44861ed7c4e225aa92ff2b5b43579.
* works around
ERROR: libhugetlbfs-1_2.23-r0 do_populate_sysroot: Fatal errors occurred in subprocesses:
Command '['arm-oe-linux-gnueabi-strip', '--remove-section=.comment', '--remove-section=.note', 'libhugetlbfs/1_2.23-r0/sysroot-destdir/usr/lib/libhugetlbfs/tests/obj32/linkhuge_rw']' returned non-zero exit status 1.
Subprocess output:arm-oe-linux-gnueabi-strip:
libhugetlbfs/1_2.23-r0/sysroot-destdir/usr/lib/libhugetlbfs/tests/obj32/stmuFa58: error: PHDR segment not covered by LOAD segment
arm-oe-linux-gnueabi-strip: libhugetlbfs/1_2.23-r0/sysroot-destdir/usr/lib/libhugetlbfs/tests/obj32/stmuFa58[.interp]: file format not recognized
I don't see anything suspicious in the build (the same cmdline as in 2.22
version), but it uses
libhugetlbfs/1_2.22-r0-old/temp/log.do_compile:arm-oe-linux-gnueabi-gcc
-mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -Wl,-O1
-Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security -Werror=return-type
--sysroot=/jenkins/mjansa/build/ros/oe-melodic-gatesgarth/libhugetlbfs/1_2.22-r0/recipe-sysroot
-I.. -O2 -Wall -g -o obj32/linkhuge_rw.o -c linkhuge_rw.c
libhugetlbfs/1_2.22-r0-old/temp/log.do_compile:arm-oe-linux-gnueabi-gcc
-mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -Wl,-O1
-Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security -Werror=return-type
--sysroot=/jenkins/mjansa/build/ros/oe-melodic-gatesgarth/libhugetlbfs/1_2.22-r0/recipe-sysroot
-B./obj32 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now
-ldl -L../obj32 -o obj32/linkhuge_rw -Wl,--no-as-needed -lpthread -ldl
-lhugetlbfs_privutils -Wl,--hugetlbfs-align obj32/linkhuge_rw.o
obj32/testutils.o
libhugetlbfs/1_2.23-r0-new/temp/log.do_compile:arm-oe-linux-gnueabi-gcc
-mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -Wl,-O1
-Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security -Werror=return-type
--sysroot=/jenkins/mjansa/build/ros/oe-melodic-gatesgarth/libhugetlbfs/1_2.23-r0/recipe-sysroot
-I.. -O2 -Wall -g -o obj32/linkhuge_rw.o -c linkhuge_rw.c
libhugetlbfs/1_2.23-r0-new/temp/log.do_compile:arm-oe-linux-gnueabi-gcc
-mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -Wl,-O1
-Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
-Werror=format-security -Werror=return-type
--sysroot=/jenkins/mjansa/build/ros/oe-melodic-gatesgarth/libhugetlbfs/1_2.23-r0/recipe-sysroot
-B./obj32 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now
-ldl -L../obj32 -o obj32/linkhuge_rw -Wl,--no-as-needed -lpthread -ldl
-lhugetlbfs_privutils -Wl,--hugetlbfs-align obj32/linkhuge_rw.o
obj32/testutils.o
And the git log between 2.22 and 2.23 is also very short and looks
reasonable.
https://github.com/libhugetlbfs/libhugetlbfs/compare/2.22...2.23
When checking with readelf -l it also shows the error about PHDR segment:
arm-oe-linux-gnueabi-readelf -l
./1_2.22-r0-old/sysroot-destdir/usr/lib/libhugetlbfs/tests/obj32/linkhuge_rw
Elf file type is DYN (Shared object file)
Entry point 0x201105
There are 10 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000034 0x00200034 0x00200034 0x00140 0x00140 R 0x4
INTERP 0x000174 0x00200174 0x00200174 0x0001d 0x0001d R 0x1
[Requesting program interpreter: /usr/lib/ld-linux-armhf.so.3]
LOAD 0x000000 0x00200000 0x00200000 0x1222c 0x1222c R E 0x200000
LOAD 0x1ffdf0 0x005ffdf0 0x005ffdf0 0x102e0 0x202ec RW 0x200000
DYNAMIC 0x1ffdf8 0x005ffdf8 0x005ffdf8 0x00128 0x00128 RW 0x4
NOTE 0x000194 0x00200194 0x00200194 0x00044 0x00044 R 0x4
GNU_EH_FRAME 0x012224 0x00212224 0x00212224 0x00008 0x00008 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10
EXIDX 0x001c5c 0x00201c5c 0x00201c5c 0x00008 0x00008 R 0x4
GNU_RELRO 0x1ffdf0 0x005ffdf0 0x005ffdf0 0x00210 0x00210 RW 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.ABI-tag .note.gnu.build-id .dynsym .dynstr
.gnu.hash .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text
.fini .ARM.extab .ARM.exidx .rodata .eh_frame .eh_frame_hdr
03 .fini_array .init_array .dynamic .got .data .bss
04 .dynamic
05 .note.ABI-tag .note.gnu.build-id
06 .eh_frame_hdr
07
08 .ARM.extab .ARM.exidx
09 .fini_array .init_array .dynamic .got
arm-oe-linux-gnueabi-readelf -l
./1_2.23-r0-new/sysroot-destdir/usr/lib/libhugetlbfs/tests/obj32/linkhuge_rw
Elf file type is DYN (Shared object file)
Entry point 0x31cd1
There are 10 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000000 0x00000000 0x00000000 0x00000 0x00000 R 0
readelf: Error: the PHDR segment is not covered by a LOAD segment
INTERP 0x030d40 0x00030d40 0x00030d40 0x0001d 0x0001d R 0x1
[Requesting program interpreter: /usr/lib/ld-linux-armhf.so.3]
LOAD 0x030d40 0x00030d40 0x00030d40 0x120b8 0x120b8 R E 0x200000
LOAD 0x1ffdf0 0x003ffdf0 0x003ffdf0 0x102e0 0x202ec RW 0x200000
DYNAMIC 0x1ffdf8 0x003ffdf8 0x003ffdf8 0x00128 0x00128 RW 0x4
NOTE 0x030d60 0x00030d60 0x00030d60 0x00044 0x00044 R 0x4
GNU_EH_FRAME 0x042df0 0x00042df0 0x00042df0 0x00008 0x00008 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10
EXIDX 0x032828 0x00032828 0x00032828 0x00008 0x00008 R 0x4
GNU_RELRO 0x1ffdf0 0x003ffdf0 0x003ffdf0 0x00210 0x00210 RW 0x4
Section to Segment mapping:
Segment Sections...
00
01 .interp
02 .interp .note.ABI-tag .note.gnu.build-id .dynsym .dynstr
.gnu.hash .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text
.fini .ARM.extab .ARM.exidx .rodata .eh_frame .eh_frame_hdr
03 .fini_array .init_array .dynamic .got .data .bss
04 .dynamic
05 .note.ABI-tag .note.gnu.build-id
06 .eh_frame_hdr
07
08 .ARM.extab .ARM.exidx
09 .fini_array .init_array .dynamic .got
And the diff between these 2:
1_2.22-r0-old/sysroot-destdir/usr/lib/libhugetlbfs/tests/obj32/linkhuge_rw.readelf
1_2.23-r0-new/sysroot-destdir/usr/lib/libhugetlbfs/tests/obj32/linkhuge_rw.readelf
Elf file type is DYN (Shared object file)
-Entry point 0x201105
+Entry point 0x31cd1
There are 10 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
- PHDR 0x000034 0x00200034 0x00200034 0x00140 0x00140 R 0x4
- INTERP 0x000174 0x00200174 0x00200174 0x0001d 0x0001d R 0x1
+ PHDR 0x000000 0x00000000 0x00000000 0x00000 0x00000 R 0
+readelf: Error: the PHDR segment is not covered by a LOAD segment
+ INTERP 0x030d40 0x00030d40 0x00030d40 0x0001d 0x0001d R 0x1
[Requesting program interpreter: /usr/lib/ld-linux-armhf.so.3]
- LOAD 0x000000 0x00200000 0x00200000 0x1222c 0x1222c R E 0x200000
- LOAD 0x1ffdf0 0x005ffdf0 0x005ffdf0 0x102e0 0x202ec RW 0x200000
- DYNAMIC 0x1ffdf8 0x005ffdf8 0x005ffdf8 0x00128 0x00128 RW 0x4
- NOTE 0x000194 0x00200194 0x00200194 0x00044 0x00044 R 0x4
- GNU_EH_FRAME 0x012224 0x00212224 0x00212224 0x00008 0x00008 R 0x4
+ LOAD 0x030d40 0x00030d40 0x00030d40 0x120b8 0x120b8 R E 0x200000
+ LOAD 0x1ffdf0 0x003ffdf0 0x003ffdf0 0x102e0 0x202ec RW 0x200000
+ DYNAMIC 0x1ffdf8 0x003ffdf8 0x003ffdf8 0x00128 0x00128 RW 0x4
+ NOTE 0x030d60 0x00030d60 0x00030d60 0x00044 0x00044 R 0x4
+ GNU_EH_FRAME 0x042df0 0x00042df0 0x00042df0 0x00008 0x00008 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10
- EXIDX 0x001c5c 0x00201c5c 0x00201c5c 0x00008 0x00008 R 0x4
- GNU_RELRO 0x1ffdf0 0x005ffdf0 0x005ffdf0 0x00210 0x00210 RW 0x4
+ EXIDX 0x032828 0x00032828 0x00032828 0x00008 0x00008 R 0x4
+ GNU_RELRO 0x1ffdf0 0x003ffdf0 0x003ffdf0 0x00210 0x00210 RW 0x4
Section to Segment mapping:
Revert fixes this build issue, but I still don't see why it fails this way.
Upstream-Status: Pending
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date: Wed Sep 16 13:43:09 2020 +0200
#
# On branch jansa/master
# Changes to be committed:
# new file: meta-oe/recipes-benchmark/libhugetlbfs/files/0001-Revert-ld.hugetlbfs-fix-Ttext-segment-argument-on-AA.patch
# modified: meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_git.bb
#
# Untracked files:
# counts.txt
# diff
# log.svn
# log.svn2
# wip/
#
---
ld.hugetlbfs | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/ld.hugetlbfs b/ld.hugetlbfs
index 5e4e497..6ee8238 100755
--- a/ld.hugetlbfs
+++ b/ld.hugetlbfs
@@ -130,9 +130,7 @@ if [ "$HTLB_ALIGN" == "slice" ]; then
# targeting the ARM platform one needs to explicitly set the text segment offset
# otherwise it will be NULL.
case "$EMU" in
- armelf*_linux_eabi|aarch64elf*|aarch64linux*)
- printf -v TEXTADDR "%x" "$SLICE_SIZE"
- HTLBOPTS="$HTLBOPTS -Ttext-segment=$TEXTADDR" ;;
+ armelf*_linux_eabi|aarch64elf*|aarch64linux*) HTLBOPTS="$HTLBOPTS -Ttext-segment=$SLICE_SIZE" ;;
elf_i386) HTLBOPTS="$HTLBOPTS -Ttext-segment=0x08000000" ;;
elf64ppc|elf64lppc)
if [ "$MMU_TYPE" == "Hash" ] ; then
--
2.17.1

View File

@@ -0,0 +1,29 @@
From b77c61de4d88d2c6e5d31f4f5a5877cc4c61272e Mon Sep 17 00:00:00 2001
From: Andrey Zhizhikin <andrey.z@gmail.com>
Date: Mon, 27 Jan 2020 17:27:55 +0000
Subject: [PATCH] huge_page_setup_helper: use python3 interpreter
Setup helper script is already prepared to be used with python3, use the
interpreter explicitly. This removes dependency to python2 and will not
fail the QA check.
Upstream-Status: Inappropriate [OE-specific]
Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
---
huge_page_setup_helper.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/huge_page_setup_helper.py b/huge_page_setup_helper.py
index a9ba2bf..7ba0c92 100755
--- a/huge_page_setup_helper.py
+++ b/huge_page_setup_helper.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
#
# Tool to set up Linux large page support with minimal effort
--
2.17.1

View File

@@ -0,0 +1,23 @@
From 351d1de09dd80049b7a2cb02c5750635d0389873 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 21 Jun 2018 19:25:57 -0700
Subject: [PATCH] include stddef.h for ptrdiff_t
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
morecore.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/morecore.c b/morecore.c
index 6563bbd..0eef782 100644
--- a/morecore.c
+++ b/morecore.c
@@ -19,6 +19,7 @@
#define _GNU_SOURCE
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>

View File

@@ -0,0 +1,49 @@
From 0077532b07e268347cb8557be6d70148d5f0e840 Mon Sep 17 00:00:00 2001
From: Ting Liu <b28495@freescale.com>
Date: Wed, 21 Aug 2013 15:44:57 +0800
Subject: [PATCH] run_test.py: not use hard coded path ../obj/hugeadm
Hard coded path makes the script impossible to run out of source tree.
After 'make install', we can use hugeadm utility under DESTDIR.
Upstream-Status: Submitted
Signed-off-by: Ting Liu <b28495@freescale.com>
Update for 2.22.
Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
Update to work for python3
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
tests/run_tests.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/run_tests.py b/tests/run_tests.py
index 018264d..0aabcd1 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -245,9 +245,19 @@ def get_pagesizes():
Use libhugetlbfs' hugeadm utility to get a list of page sizes that have
active mount points and at least one huge page allocated to the pool.
"""
+ local_env = os.environ.copy()
+ local_env["PATH"] = "../obj:%s" % local_env.get("PATH", "")
sizes = set()
out = ""
- (rc, out) = bash("../obj/hugeadm --page-sizes")
+ try:
+ p = subprocess.Popen("hugeadm --page-sizes", shell=True, env=local_env, stdout=subprocess.PIPE)
+ rc = p.wait()
+ except KeyboardInterrupt:
+ return sizes
+ except OSError:
+ return sizes
+ out = p.stdout.read().decode().strip()
+
if rc != 0 or out == "":
return sizes
--
2.7.4

View File

@@ -0,0 +1,31 @@
From b6dba773491bbb7b4664dacdd87a12af860f1bd8 Mon Sep 17 00:00:00 2001
From: Oleksiy Obitotskyy <oobitots@cisco.com>
Date: Thu, 28 Jan 2021 05:43:33 -0800
Subject: [PATCH] tests/makefile: Append CPPFLAGS rather then override
CPPFLAGS overrided and we could miss some options needed.
Upstream-Status: Submitted
Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
---
tests/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile b/tests/Makefile
index 0ca3716..d262932 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -33,8 +33,8 @@ HELPERS = get_hugetlbfs_path compare_kvers
HELPER_LIBS = libheapshrink.so
BADTOOLCHAIN = bad-toolchain.sh
-CFLAGS = -O2 -Wall -g
-CPPFLAGS = -I..
+CFLAGS += -O2 -Wall -g
+CPPFLAGS += -I..
STATIC_LIBHUGE = -Wl,--whole-archive -lhugetlbfs -Wl,--no-whole-archive
STATIC_LDLIBS = -Wl,--no-as-needed -lpthread
LDLIBS = $(STATIC_LDLIBS) -ldl -lhugetlbfs_privutils
--
2.26.2.Cisco

View File

@@ -0,0 +1,37 @@
From 0f548286848c70aa325c6748d80e8651389b4938 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 21 Jun 2018 19:32:59 -0700
Subject: [PATCH] Mark glibc specific code so
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
morecore.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/morecore.c b/morecore.c
index 0eef782..d48509c 100644
--- a/morecore.c
+++ b/morecore.c
@@ -364,6 +364,7 @@ void hugetlbfs_setup_morecore(void)
INFO("setup_morecore(): heapaddr = 0x%lx\n", heapaddr);
+#ifdef __GLIBC__
heaptop = heapbase = (void *)heapaddr;
if (__hugetlb_opts.thp_morecore)
__morecore = &thp_morecore;
@@ -371,7 +372,6 @@ void hugetlbfs_setup_morecore(void)
__morecore = &hugetlbfs_morecore;
/* Set some allocator options more appropriate for hugepages */
-
if (__hugetlb_opts.shrink_ok)
mallopt(M_TRIM_THRESHOLD, hpage_size + hpage_size / 2);
else
@@ -381,4 +381,5 @@ void hugetlbfs_setup_morecore(void)
* This doesn't appear to prohibit malloc() from falling back
* to mmap() if we run out of hugepages. */
mallopt(M_MMAP_MAX, 0);
+#endif
}

View File

@@ -0,0 +1,46 @@
From 9ff04d7acc700387e3837f8ab11a41efea5ee8b0 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 21 Jun 2018 19:44:26 -0700
Subject: [PATCH] alloc.c: Avoid sysconf(_SC_LEVEL2_CACHE_LINESIZE) on linux
musl does not have it
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
alloc.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/alloc.c b/alloc.c
index bce9464..cf7eb40 100644
--- a/alloc.c
+++ b/alloc.c
@@ -245,6 +245,19 @@ void free_huge_pages(void *ptr)
__free_huge_pages(ptr, 1);
}
+static size_t get_cacheline_size() {
+#if defined(__linux__)
+ FILE * fp = fopen("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", "r");
+ unsigned int line_size = 0;
+ if (fp) {
+ fscanf(fp, "%d", &line_size);
+ fclose(fp);
+ }
+ return line_size;
+#else
+ return sysconf(_SC_LEVEL2_CACHE_LINESIZE);
+#endif
+}
/*
* Offset the buffer using bytes wasted due to alignment to avoid using the
* same cache lines for the start of every buffer returned by
@@ -261,7 +274,7 @@ void *cachecolor(void *buf, size_t len, size_t color_bytes)
/* Lookup our cacheline size once */
if (cacheline_size == 0) {
- cacheline_size = sysconf(_SC_LEVEL2_CACHE_LINESIZE);
+ cacheline_size = get_cacheline_size();
linemod = time(NULL);
}

View File

@@ -0,0 +1,28 @@
From 9ce323432a7f4d99f617970c7e35b607b9bbf843 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 21 Jun 2018 19:48:04 -0700
Subject: [PATCH] shm.c: Mark glibc specific changes so
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
shm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/shm.c b/shm.c
index 1f82cab..9447b63 100644
--- a/shm.c
+++ b/shm.c
@@ -48,10 +48,11 @@
* system shmget() may be performed without worry as there is no dynamic
* call chain.
*/
+#ifdef __GLIBC__
extern void *dlsym (void *__restrict __handle, __const char *__restrict __name)
__attribute__((weak)) __THROW __nonnull ((2));
extern char *dlerror (void) __attribute__((weak)) __THROW;
-
+#endif
/* call syscall shmget through the generic syscall mechanism */
static int syscall_shmget(key_t key, size_t size, int shmflg)

View File

@@ -0,0 +1,31 @@
From bb8c370aaaf25b1fe1fbf984e73177018026cb91 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 21 Jun 2018 19:51:02 -0700
Subject: [PATCH] Include dirent.h for ino_t
Fixes
error: unknown type name 'ino_t'; did you mean 'int'?
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Update for 2.22.
Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
---
tests/hugetests.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/hugetests.h b/tests/hugetests.h
index bc4e16a..fbe4dc0 100644
--- a/tests/hugetests.h
+++ b/tests/hugetests.h
@@ -22,6 +22,7 @@
#include <errno.h>
#include <string.h>
+#include <dirent.h>
#include <unistd.h>
#include "libhugetlbfs_privutils.h"
--
2.7.4

View File

@@ -0,0 +1,40 @@
From 5f64aa8c47c2d3a155a97e262f89cc47394a69eb Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 21 Jun 2018 19:58:53 -0700
Subject: [PATCH] include limits.h for PATH_MAX
Fixes
error: 'PATH_MAX' undeclared
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
hugeadm.c | 1 +
tests/gethugepagesizes.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/hugeadm.c b/hugeadm.c
index fe4211d..8db274c 100644
--- a/hugeadm.c
+++ b/hugeadm.c
@@ -33,6 +33,7 @@
#include <grp.h>
#include <pwd.h>
#include <fcntl.h>
+#include <limits.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/tests/gethugepagesizes.c b/tests/gethugepagesizes.c
index 9551b38..2645e3f 100644
--- a/tests/gethugepagesizes.c
+++ b/tests/gethugepagesizes.c
@@ -29,6 +29,7 @@
#include <fcntl.h>
#include <stdarg.h>
#include <hugetlbfs.h>
+#include <limits.h>
#include "hugetests.h"

View File

@@ -0,0 +1,97 @@
From 82a4f60ab24dff121f5f9d3bbcd9a8a28bb7caef Mon Sep 17 00:00:00 2001
From: Chunrong Guo <B40290@freescale.com>
Date: Sun, 8 Sep 2013 23:21:49 -0500
Subject: [PATCH] libhugetlbfs: avoid search host library path for cross
compilation
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Chunrong Guo <B40290@freescale.com>
---
ldscripts/elf32ppclinux.xB | 2 +-
ldscripts/elf32ppclinux.xBDT | 2 +-
ldscripts/elf64ppc.xB | 2 +-
ldscripts/elf64ppc.xBDT | 2 +-
ldscripts/elf_x86_64.xB | 2 +-
ldscripts/elf_x86_64.xBDT | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/ldscripts/elf32ppclinux.xB b/ldscripts/elf32ppclinux.xB
index 28ad88d..33d482d 100644
--- a/ldscripts/elf32ppclinux.xB
+++ b/ldscripts/elf32ppclinux.xB
@@ -3,7 +3,7 @@ OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
"elf32-powerpc")
OUTPUT_ARCH(powerpc:common)
ENTRY(_start)
-SEARCH_DIR("/usr/powerpc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
+/*SEARCH_DIR("/usr/powerpc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");*/
INPUT(-lhugetlbfs);
PHDRS
{
diff --git a/ldscripts/elf32ppclinux.xBDT b/ldscripts/elf32ppclinux.xBDT
index 497882b..823475e 100644
--- a/ldscripts/elf32ppclinux.xBDT
+++ b/ldscripts/elf32ppclinux.xBDT
@@ -3,7 +3,7 @@ OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
"elf32-powerpc")
OUTPUT_ARCH(powerpc:common)
ENTRY(_start)
-SEARCH_DIR("/usr/powerpc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
+/*SEARCH_DIR("/usr/powerpc-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");*/
INPUT(-lhugetlbfs);
PHDRS
{
diff --git a/ldscripts/elf64ppc.xB b/ldscripts/elf64ppc.xB
index 1a9c1ab..8cc557d 100644
--- a/ldscripts/elf64ppc.xB
+++ b/ldscripts/elf64ppc.xB
@@ -3,7 +3,7 @@ OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc",
"elf64-powerpc")
OUTPUT_ARCH(powerpc:common64)
ENTRY(_start)
-SEARCH_DIR("/usr/powerpc64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/powerpc64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
+/*SEARCH_DIR("/usr/powerpc64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/powerpc64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");*/
INPUT(-lhugetlbfs);
PHDRS
{
diff --git a/ldscripts/elf64ppc.xBDT b/ldscripts/elf64ppc.xBDT
index 5477294..53e0749 100644
--- a/ldscripts/elf64ppc.xBDT
+++ b/ldscripts/elf64ppc.xBDT
@@ -3,7 +3,7 @@ OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc",
"elf64-powerpc")
OUTPUT_ARCH(powerpc:common64)
ENTRY(_start)
-SEARCH_DIR("/usr/powerpc64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/powerpc64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
+/*SEARCH_DIR("/usr/powerpc64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/powerpc64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");*/
INPUT( -lhugetlbfs );
PHDRS
{
diff --git a/ldscripts/elf_x86_64.xB b/ldscripts/elf_x86_64.xB
index ed21a2c..ba50e9f 100644
--- a/ldscripts/elf_x86_64.xB
+++ b/ldscripts/elf_x86_64.xB
@@ -3,7 +3,7 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
"elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
-SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/x86_64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
+/*SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/x86_64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");*/
INPUT(-lhugetlbfs);
/* Do we need any of these for elf?
__DYNAMIC = 0; */
diff --git a/ldscripts/elf_x86_64.xBDT b/ldscripts/elf_x86_64.xBDT
index 1855202..c62d245 100644
--- a/ldscripts/elf_x86_64.xBDT
+++ b/ldscripts/elf_x86_64.xBDT
@@ -3,7 +3,7 @@ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
"elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
-SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/x86_64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
+/*SEARCH_DIR("/usr/x86_64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/x86_64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");*/
INPUT(-lhugetlbfs);
/* Do we need any of these for elf?
__DYNAMIC = 0; */

View File

@@ -0,0 +1,39 @@
From b5887693d90c430291b644c2f5713b5fdd1777ce Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Tue, 4 Nov 2014 00:49:11 -0800
Subject: [PATCH] libhugetlbfs/elf_i386: avoid search host library path for
cross compilation
Upstream-Status: Inappropriate [cross compile specific]
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
ldscripts/elf_i386.xB | 1 -
ldscripts/elf_i386.xBDT | 1 -
2 files changed, 2 deletions(-)
diff --git a/ldscripts/elf_i386.xB b/ldscripts/elf_i386.xB
index 43fe51c..eae0fa8 100644
--- a/ldscripts/elf_i386.xB
+++ b/ldscripts/elf_i386.xB
@@ -3,7 +3,6 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386",
"elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
-SEARCH_DIR("/usr/i486-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
INPUT(-lhugetlbfs);
/* Do we need any of these for elf?
__DYNAMIC = 0; */
diff --git a/ldscripts/elf_i386.xBDT b/ldscripts/elf_i386.xBDT
index d72aebe..3bac1b1 100644
--- a/ldscripts/elf_i386.xBDT
+++ b/ldscripts/elf_i386.xBDT
@@ -3,7 +3,6 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386",
"elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
-SEARCH_DIR("/usr/i486-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
INPUT(-lhugetlbfs);
/* Do we need any of these for elf?
__DYNAMIC = 0; */

View File

@@ -0,0 +1,24 @@
From 183a4dafe141197de5840f2e48c266ef209307aa Mon Sep 17 00:00:00 2001
From: Ting Liu <b28495@freescale.com>
Date: Mon, 18 Jun 2012 16:37:05 +0800
Subject: [PATCH] skip checking LIB32 and LIB64 if they point to the same place
Upstream-Status: Inappropriate [oe-core specific]
Signed-off-by: Ting Liu <b28495@freescale.com>
---
Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/Makefile b/Makefile
index 51e41f0..373df3c 100644
--- a/Makefile
+++ b/Makefile
@@ -177,7 +177,6 @@ REALLIB32 = $(realpath $(PREFIX)/$(LIB32))
REALLIB64 = $(realpath $(PREFIX)/$(LIB64))
ifneq ($(realpath $(PREFIX)),)
ifeq ($(REALLIB32),$(REALLIB64))
-$(error LIB32 ($(PREFIX)/$(LIB32) to $(REALLIB32)) and LIB64 ($(PREFIX)/$(LIB64) to $(REALLIB64)) are resolving to the same place. Manually specify LIB32 and LIB64. e.g. make PREFIX=$(PREFIX) LIB32=lib32 LIB64=lib64)
endif
endif

View File

@@ -0,0 +1,28 @@
From f1ad8ff887f16daee8d06eca3df0f2541bfdaac0 Mon Sep 17 00:00:00 2001
From: Ting Liu <b28495@freescale.com>
Date: Mon, 23 Sep 2013 08:00:55 +0000
Subject: [PATCH] libhugetlbfs: add recipe
Upstream-Status: Submitted
TESTS_64 is empty, install will fail due to missing file operand
Signed-off-by: Ting Liu <b28495@freescale.com>
---
tests/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/Makefile b/tests/Makefile
index 073df96..0ca3716 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -295,7 +295,7 @@ obj64/install:
$(INSTALL) -m 755 wrapper-utils.sh $(DESTDIR)$(INST_TESTSDIR64)/obj64
$(INSTALL) -m 755 $(HELPERS:%=obj64/%) $(DESTDIR)$(INST_TESTSDIR64)/obj64
$(INSTALL) -m 755 $(HELPER_LIBS:%=obj64/%) $(DESTDIR)$(INST_TESTSDIR64)/obj64
- $(INSTALL) -m 755 $(TESTS_64:%=obj64/%) $(DESTDIR)$(INST_TESTSDIR64)/obj64
+ $(INSTALL) -m 755 $(TESTS_64_STATIC:%=obj64/%_static) $(DESTDIR)$(INST_TESTSDIR64)/obj64
$(INSTALL) -m 755 run_tests.py $(DESTDIR)$(INST_TESTSDIR64)
install: $(OBJDIRS:%=%/install)

View File

@@ -0,0 +1,79 @@
SUMMARY = "A library which provides easy access to huge pages of memory"
HOMEPAGE = "https://github.com/libhugetlbfs/libhugetlbfs"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://LGPL-2.1;md5=2d5025d4aa3495befef8f17206a5b0a1"
DEPENDS = "sysfsutils"
RDEPENDS:${PN} += "bash python3-core"
RDEPENDS:${PN}-tests += "bash python3-core"
PV = "2.23"
PE = "1"
SRCREV = "6b126a4d7da9490fa40fe7e1b962edcb939feddc"
SRC_URI = " \
git://github.com/libhugetlbfs/libhugetlbfs.git;protocol=https;branch=master \
file://skip-checking-LIB32-and-LIB64-if-they-point-to-the-s.patch \
file://libhugetlbfs-avoid-search-host-library-path-for-cros.patch \
file://tests-Makefile-install-static-4G-edge-testcases.patch \
file://0001-run_test.py-not-use-hard-coded-path-.-obj-hugeadm.patch \
file://libhugetlbfs-elf_i386-avoid-search-host-library-path.patch \
file://0001-include-stddef.h-for-ptrdiff_t.patch \
file://0002-Mark-glibc-specific-code-so.patch \
file://0003-alloc.c-Avoid-sysconf-_SC_LEVEL2_CACHE_LINESIZE-on-l.patch \
file://0004-shm.c-Mark-glibc-specific-changes-so.patch \
file://0005-Include-dirent.h-for-ino_t.patch \
file://0006-include-limits.h-for-PATH_MAX.patch \
file://0001-huge_page_setup_helper-use-python3-interpreter.patch \
file://0001-Revert-ld.hugetlbfs-fix-Ttext-segment-argument-on-AA.patch \
file://0001-tests-makefile-Append-CPPFLAGS-rather-then-override.patch \
"
UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
S = "${WORKDIR}/git"
COMPATIBLE_HOST = "(i.86|x86_64|powerpc|powerpc64|aarch64|arm).*-linux*"
LIBARGS = "LIB32=${baselib} LIB64=${baselib}"
LIBHUGETLBFS_ARCH = "${TARGET_ARCH}"
LIBHUGETLBFS_ARCH:powerpc = "ppc"
LIBHUGETLBFS_ARCH:powerpc64 = "ppc64"
LIBHUGETLBFS_ARCH:powerpc64le = "ppc64le"
EXTRA_OEMAKE = "'ARCH=${LIBHUGETLBFS_ARCH}' 'OPT=${CFLAGS}' 'CC=${CC}' ${LIBARGS} BUILDTYPE=NATIVEONLY V=2"
PARALLEL_MAKE = ""
CFLAGS += "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -g0"
export HUGETLB_LDSCRIPT_PATH="${S}/ldscripts"
TARGET_CC_ARCH += "${LDFLAGS}"
#The CUSTOM_LDSCRIPTS doesn't work with the gold linker
inherit cpan-base
do_configure() {
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
sed -i 's/CUSTOM_LDSCRIPTS = yes/CUSTOM_LDSCRIPTS = no/' Makefile
fi
}
do_install() {
oe_runmake PREFIX=${prefix} DESTDIR=${D} \
INST_TESTSDIR32=${libdir}/libhugetlbfs/tests \
INST_TESTSDIR64=${libdir}/libhugetlbfs/tests \
install-tests
}
PACKAGES =+ "${PN}-tests "
FILES:${PN} += "${libdir}/*.so"
FILES:${PN}-dev = "${includedir}"
FILES:${PN}-dbg += "${libdir}/libhugetlbfs/tests/obj32/.debug ${libdir}/libhugetlbfs/tests/obj64/.debug"
FILES:${PN}-tests += "${libdir}/libhugetlbfs/tests"
INSANE_SKIP:${PN} = "dev-so"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
# see https://github.com/libhugetlbfs/libhugetlbfs/issues/52
SKIP_RECIPE[libhugetlbfs] ?= "Needs porting to glibc 2.34+"

View File

@@ -0,0 +1,32 @@
From f092d4be22acd09e791187b8e9bff6d312721ce4 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 10 Nov 2021 11:36:31 -0800
Subject: [PATCH] linpack: Define DP only when SP is not defined
This helps compiling two versions ( SP/FP ) of the benchmark just by
passing -DSP on compile cmdline
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
linpacknew.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/linpacknew.c b/linpacknew.c
index 17b2824..c656082 100644
--- a/linpacknew.c
+++ b/linpacknew.c
@@ -28,7 +28,9 @@
#include <time.h>
#include <float.h>
+#ifndef SP
#define DP
+#endif
#ifdef SP
#define ZERO 0.0
--
2.33.1

View File

@@ -0,0 +1,24 @@
DESCRIPTION = "LINPACK Benchmarks are a measure of a system's floating point computing power"
SUMMARY = "LINPACK is a software library for performing numerical linear algebra on digital computers"
LICENSE = "PD"
LIC_FILES_CHKSUM ="file://${WORKDIR}/linpacknew.c;beginline=1;endline=23;md5=aa025e3bc44190c71e4c5e3b084fed87"
SRC_URI = "http://www.netlib.org/benchmark/linpackc.new;downloadfilename=linpacknew.c \
file://0001-linpack-Define-DP-only-when-SP-is-not-defined.patch \
"
SRC_URI[md5sum] = "1c5d0b6a31264685d2e651c920e3cdf4"
SRC_URI[sha256sum] = "a63f2ec86512959f1fd926bfafb85905b2d7b7402942ffae3af374d48745e97e"
S = "${WORKDIR}"
do_compile () {
${CC} ${CFLAGS} ${LDFLAGS} -DDP -o linpack_dp linpacknew.c -lm
${CC} ${CFLAGS} ${LDFLAGS} -DSP -o linpack_sp linpacknew.c -lm
}
do_install () {
install -Dm 0755 linpack_dp ${D}${bindir}/linpack_dp
install -Dm 0755 linpack_sp ${D}${bindir}/linpack_sp
}

View File

@@ -0,0 +1,80 @@
From 25738bb9c75f94b451201acfd6bcab13bdeee512 Mon Sep 17 00:00:00 2001
From: Roy Li <rongqing.li@windriver.com>
Date: Thu, 5 May 2016 09:52:01 +0800
Subject: [PATCH] [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);
}

View File

@@ -0,0 +1,27 @@
From 4bbedd25e74adb5cb181a9ae589adb2052ade630 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
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 <raj.khem@gmail.com>
---
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 <signal.h>
#include <errno.h>
#ifndef WIN32
-#include <strings.h>
+#include <string.h>
#endif
#include <sys/types.h>
#ifndef WIN32
--
2.37.3

View File

@@ -0,0 +1,30 @@
From 9bf2b363c5173c03adecf366f116415dbc559017 Mon Sep 17 00:00:00 2001
From: Yanfei Xu <yanfei.xu@windriver.com>
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 <yanfei.xu@windriver.com>
---
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

View File

@@ -0,0 +1,100 @@
From a8d86a2d994a008dab3c3ecad65528c0e5fc2cba Mon Sep 17 00:00:00 2001
From: He Zhe <zhe.he@windriver.com>
Date: Fri, 22 Jan 2021 11:22:48 +0800
Subject: [PATCH] doc: Fix typos in manual pages
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
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 <parallelism>"
]
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 <parallelism>"
]
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 <parallelism>"
]
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 <parallelism>"
]
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 <parallelism>"
]
--
2.17.1

View File

@@ -0,0 +1,42 @@
From 78912c0ac5e090095a2f2bd6226e02cce949e72e Mon Sep 17 00:00:00 2001
From: He Zhe <zhe.he@windriver.com>
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 <zhe.he@windriver.com>
---
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

View File

@@ -0,0 +1,24 @@
From 7c05fa5353ad91acae6e5e8a01f65d54935ef778 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 27 Jun 2017 14:39:10 -0700
Subject: [PATCH] lat_http.c: Add printf format
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
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) {

View File

@@ -0,0 +1,77 @@
From 353e8a62bf3cb5f1b9504efa16b8b974e93cac49 Mon Sep 17 00:00:00 2001
From: He Zhe <zhe.he@windriver.com>
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 <zhe.he@windriver.com>
---
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

View File

@@ -0,0 +1,239 @@
From bcc6816b92ecf409357865589069a82883d589f7 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 6 Sep 2022 22:53:51 -0700
Subject: [PATCH] scripts/build: Fix the tests to build with clang15
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
scripts/build | 50 +++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
--- a/scripts/build
+++ b/scripts/build
@@ -21,7 +21,7 @@ trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BA
LDLIBS="$LDLIBS -lm"
# check for HP-UX's ANSI compiler
-echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c
+echo "int main(int ac, char *av[]) { int i; }" > ${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL}
then
true;
@@ -39,7 +39,7 @@ arch=`echo $OS | awk -F- '{print $1;}'`
if [ "X$CC" = "Xcc" -a "X$arch" = "Xia64" ]
then
echo "#include <stdlib.h>" > ${BASE}$$.c
- echo "main(int ac, char *av[])" >> ${BASE}$$.c
+ echo "int main(int ac, char *av[])" >> ${BASE}$$.c
echo "{ long* p = (long*)malloc(sizeof(long));" >> ${BASE}$$.c
echo "*p = 0; exit((int)*p); }" >> ${BASE}$$.c
${CC} ${CFLAGS} +DD64 -o ${BASE}$$ ${BASE}$$.c 1>${NULL} 2>${NULL} \
@@ -51,14 +51,14 @@ fi
# check for bcopy (optionally set the SYS5 flag)
echo "#include <string.h>" > ${BASE}$$.c
-echo "main() { char a[256], b[256]; bcopy(a, b, 256); }" >> ${BASE}$$.c
+echo "int main() { char a[256], b[256]; bcopy(a, b, 256); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
|| CFLAGS="${CFLAGS} -DSYS5"
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
# check for valloc
echo "#include <stdlib.h>" > ${BASE}$$.c
-echo "main() { char* buf = valloc(123); }" >> ${BASE}$$.c
+echo "int main() { char* buf = valloc(123); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
|| CFLAGS="${CFLAGS} -Dvalloc=malloc"
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -67,7 +67,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <unistd.h>" >> ${BASE}$$.c
-echo "main() { off64_t off; }" >> ${BASE}$$.c
+echo "int main() { off64_t off; }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_off64_t"
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -76,7 +76,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <unistd.h>" >> ${BASE}$$.c
-echo "main() { int fd = 0; off64_t off = 0; off = lseek64(fd, off, SEEK_SET); }" >> ${BASE}$$.c
+echo "int main() { int fd = 0; off64_t off = 0; off = lseek64(fd, off, SEEK_SET); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_lseek64"
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -88,7 +88,7 @@ echo "#include <sys/resource.h>" >> ${BA
echo "#ifndef RUSAGE_SELF" >> ${BASE}$$.c
echo "#define RUSAGE_SELF 0" >> ${BASE}$$.c
echo "#endif /* RUSAGE_SELF */" >> ${BASE}$$.c
-echo "main() { struct rusage ru; getrusage(RUSAGE_SELF, &ru); }" >> ${BASE}$$.c
+echo "int main() { struct rusage ru; getrusage(RUSAGE_SELF, &ru); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DRUSAGE"
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -125,24 +125,24 @@ fi
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
# check for -lrpc (cygwin/Windows)
-echo "extern int pmap_set(); main() { pmap_set(); }" >${BASE}$$.c
+echo "extern int pmap_set(void); int main() { pmap_set(); }" >${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL}; then
true;
-else
- ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} -lrpc 1>${NULL} 2>${NULL} \
- && LDLIBS="${LDLIBS} -lrpc"
+elif ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} -lrpc 1>${NULL} 2>${NULL}; then
+ LDLIBS="${LDLIBS} -lrpc"
+else ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} -ltirpc 1>${NULL} 2>${NULL} && LDLIBS="${LDLIBS} -ltirpc"
fi
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
# check for OSs that have S_IFFIFO instead of S_IFIFO
echo "#include <sys/stat.h>" > ${BASE}$$.c
-echo "main() { return (S_IFIFO); }" >> ${BASE}$$.c
+echo "int main() { return (S_IFIFO); }" >> ${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL}; then
true;
else
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
echo "#include <sys/stat.h>" > ${BASE}$$.c
- echo "main() { return (S_IFFIFO); }" >> ${BASE}$$.c
+ echo "int main() { return (S_IFFIFO); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
|| CFLAGS="${CFLAGS} -DS_IFIFO=S_IFFIFO"
fi
@@ -151,7 +151,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
# check that we have uint
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
-echo "main() { uint i = 0; return (i); }" >> ${BASE}$$.c
+echo "int main() { uint i = 0; return (i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_uint=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -161,7 +161,7 @@ HAVE_uint64=0
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <rpc/types.h>" >> ${BASE}$$.c
-echo "main() { uint64 i = 0; return (int)(i); }" >> ${BASE}$$.c
+echo "int main() { uint64 i = 0; return (int)(i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_uint64=1" && HAVE_uint64=1;
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -170,7 +170,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
if [ ${HAVE_uint64} = 0 ]; then
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
- echo "main() { uint64_t i = 0; return (int)(i); }" >> ${BASE}$$.c
+ echo "int main() { uint64_t i = 0; return (int)(i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_uint64_t=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -181,7 +181,7 @@ HAVE_int64=0
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <rpc/types.h>" >> ${BASE}$$.c
-echo "main() { int64 i = 0; return (int)(i); }" >> ${BASE}$$.c
+echo "int main() { int64 i = 0; return (int)(i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_int64=1" && HAVE_int64=1;
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -190,7 +190,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
if [ ${HAVE_int64} = 0 ]; then
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
- echo "main() { int64_t i = 0; return (int)(i); }" >> ${BASE}$$.c
+ echo "int main() { int64_t i = 0; return (int)(i); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_int64_t=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -209,7 +209,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <sys/socket.h>" >> ${BASE}$$.c
-echo "main() { int s; struct sockaddr dest; socklen_t len; getsockname(s, &dest, &len); }" >> ${BASE}$$.c
+echo "int main() { int s; struct sockaddr dest; socklen_t len; getsockname(s, &dest, &len); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_socklen_t"
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -217,7 +217,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
# check that we have drand48 and srand48
HAVE_RANDOM=0
echo "#include <stdlib.h>" > ${BASE}$$.c
-echo "main() { srand48(973); return (int)(1.0E9 * drand48()); }" >> ${BASE}$$.c
+echo "int main() { srand48(973); return (int)(1.0E9 * drand48()); }" >> ${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL}; then
CFLAGS="${CFLAGS} -DHAVE_DRAND48"
HAVE_RANDOM=1
@@ -226,7 +226,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
if [ ${HAVE_RANDOM} -eq 0 ]; then
echo "#include <stdlib.h>" > ${BASE}$$.c
- echo "main() { srand(973); return (10 * rand()) / RAND_MAX; }" >> ${BASE}$$.c
+ echo "int main() { srand(973); return (10 * rand()) / RAND_MAX; }" >> ${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL}; then
CFLAGS="${CFLAGS} -DHAVE_RAND"
HAVE_RANDOM=1
@@ -236,7 +236,7 @@ fi
if [ ${HAVE_RANDOM} -eq 0 ]; then
echo "#include <stdlib.h>" > ${BASE}$$.c
- echo "main() { srandom(973); return (10 * random()) / RAND_MAX; }" >> ${BASE}$$.c
+ echo "int main() { srandom(973); return (10 * random()) / RAND_MAX; }" >> ${BASE}$$.c
if ${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL}; then
CFLAGS="${CFLAGS} -DHAVE_RANDOM"
HAVE_RANDOM=1
@@ -247,7 +247,7 @@ fi
# check that we have sysmp
echo "#include <sys/types.h>" > ${BASE}$$.c
echo "#include <sys/sysmp.h>" >> ${BASE}$$.c
-echo "main() { return (int)sysmp(MP_NPROCS); }" >> ${BASE}$$.c
+echo "int main() { return (int)sysmp(MP_NPROCS); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_SYSMP=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -257,7 +257,7 @@ echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <unistd.h>" >> ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <sys/processor.h>" >> ${BASE}$$.c
-echo "main() { return bindprocessor(BINDPROCESS, getpid(), 0); }" >> ${BASE}$$.c
+echo "int main() { return bindprocessor(BINDPROCESS, getpid(), 0); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_BINDPROCESSOR=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -267,16 +267,17 @@ echo "#include <stdlib.h>" > ${BASE}$$.c
echo "#include <sys/types.h>" >> ${BASE}$$.c
echo "#include <sys/processor.h>" >> ${BASE}$$.c
echo "#include <sys/procset.h>" >> ${BASE}$$.c
-echo "main() { return processor(P_PID, P_MYPID, 0, NULL); }" >> ${BASE}$$.c
+echo "int main() { return processor(P_PID, P_MYPID, 0, NULL); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_BINDPROCESSOR=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
# check that we have sched_setaffinity
-echo "#include <stdlib.h>" > ${BASE}$$.c
+echo "#define _GNU_SOURCE" > ${BASE}$$.c
+echo "#include <stdlib.h>" >> ${BASE}$$.c
echo "#include <unistd.h>" >> ${BASE}$$.c
echo "#include <sched.h>" >> ${BASE}$$.c
-echo "main() { unsigned long mask = 1; return sched_setaffinity(0, sizeof(unsigned long), &mask); }" >> ${BASE}$$.c
+echo "int main() { unsigned long mask = 1; return sched_setaffinity(0, sizeof(unsigned long), &mask); }" >> ${BASE}$$.c
${CC} ${CFLAGS} -o ${BASE}$$ ${BASE}$$.c ${LDLIBS} 1>${NULL} 2>${NULL} \
&& CFLAGS="${CFLAGS} -DHAVE_SCHED_SETAFFINITY=1";
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
@@ -285,4 +286,4 @@ rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
if [ ! -d ${BINDIR} ]; then mkdir -p ${BINDIR}; fi
# now go ahead and build everything!
-${MAKE} OS="${OS}" CC="${CC}" CFLAGS="${CFLAGS}" LDLIBS="${LDLIBS}" O="${BINDIR}" $*
+${MAKE} OS="${OS}" CC="${CC}" CFLAGS="${CFLAGS}" LDLIBS="${LDLIBS}" O="${BINDIR}" ${EXTRA_OEMAKE} $*
--- a/src/lib_sched.c
+++ b/src/lib_sched.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
#include "bench.h"
/* #define _DEBUG */

View File

@@ -0,0 +1,34 @@
From ea683a0dbaa30a0bf101adb09a1a2531c7112c62 Mon Sep 17 00:00:00 2001
From: Mingli Yu <Mingli.Yu@windriver.com>
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 <Mingli.Yu@windriver.com>
---
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

View File

@@ -0,0 +1,73 @@
From b27c253bfb78fa3c5f416e6caee101098a4b58cc Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
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 <raj.khem@gmail.com>
---
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:

View File

@@ -0,0 +1,215 @@
From 65180976c9963432d166b47a0b692260a69c0d47 Mon Sep 17 00:00:00 2001
From: Qingming Su <qingming.su@windriver.com>
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 <qingming.su@windriver.com>
Signed-off-by: Fupan Li <fupan.li@windriver.com>
Add and reword above comments
Upstream-Status: Inappropriate [ configuration ]
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
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));

View File

@@ -0,0 +1,22 @@
#!/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/
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"

View File

@@ -0,0 +1,69 @@
From b21ca9f3911628fb66f308c6916485bbbcfb29a4 Mon Sep 17 00:00:00 2001
From: Lin Yu <lin.yu@windriver.com>
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 <lin.yu@windriver.com>
Signed-off-by: Fupan Li <fupan.li@windriver.com>
Reworded patch description.
Upstream-Status: Inappropriate [ configuration ]
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
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 <<EOF;
<title>LMBENCH System Results</title>
<h1>LMBENCH System Results</h1>
-<h2><a href=summary>Summary of results</a></h2>
+<h2><a href=summary.out>Summary of results</a></h2>
<hr>
EOF
@@ -47,7 +47,7 @@ foreach $os (@os) {
open(F, $file);
$_ = <F>;
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<<EOF;
<h4>$title</h4>
-<a href=../$doc{$what}>Information on this benchmark</a> (Not up to date)
<p><IMG SRC="${what}${scale}$N.gif">\n<p>
-<a href=../lmbench.html>
-<img align=middle src="../gifs/arrows/b_arrow.gif">LMBENCH table of contents</a>
<a href=specific.html>
<img align=middle src=\"../gifs/graph.gif\">System results table of contents</a>
<p>

View File

@@ -0,0 +1,36 @@
From 182a5d3dba3f440bbf35551da6d21ab1c990eb58 Mon Sep 17 00:00:00 2001
From: Noor Ahsan <noor_ahsan@mentor.com>
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

View File

@@ -0,0 +1,30 @@
From 16823f5c3d3d5adad0b70e9055c08cb4e18d255b Mon Sep 17 00:00:00 2001
From: Noor Ahsan <noor_ahsan@mentor.com>
Date: Mon, 29 Aug 2011 16:17:51 +0000
Subject: [PATCH] lmbench: Add version 3.0-a9 (initial recipe)
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]
---
scripts/config-run | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/config-run b/scripts/config-run
index f620c15..a2d5ba4 100755
--- a/scripts/config-run
+++ b/scripts/config-run
@@ -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 ""

View File

@@ -0,0 +1,22 @@
From aca1a59d888421c1fc553229b8049be47e8b3ddf Mon Sep 17 00:00:00 2001
From: Chunrong Guo <b40290@freescale.com>
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

View File

@@ -0,0 +1,170 @@
From 4955021bc283be404df62b97b86af3943efd29de Mon Sep 17 00:00:00 2001
From: Noor Ahsan <noor_ahsan@mentor.com>
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<<EOF
I think your CPU mhz is
@@ -689,9 +689,9 @@ esac
INFO=`../scripts/info`
if [ $MAIL = yes ]
-then if [ ! -f ../bin/$OS/$INFO ]
- then cp ../scripts/info-template ../bin/$OS/$INFO
- chmod +w ../bin/$OS/$INFO
+then if [ ! -f $INFO ]
+ then cp ../scripts/info-template $INFO
+ chmod +w $INFO
REUSE=no
else
REUSE=view
@@ -705,7 +705,7 @@ then if [ ! -f ../bin/$OS/$INFO ]
;;
[Vv]*) REUSE=view
echo $L
- more ../bin/$OS/$INFO
+ more $INFO
echo $L
;;
*) REUSE=yes
@@ -733,7 +733,7 @@ EOF
then EDITOR=$TMP
fi
if [ X$EDITOR != "none" ]
- then $EDITOR ../bin/$OS/`../scripts/info`
+ then $EDITOR `../scripts/info`
fi
fi
fi
@@ -750,7 +750,7 @@ EOF
VERSION=`../scripts/version`
-C=../bin/$OS/`../scripts/config`
+C=`../scripts/config`
echo DISKS=\"$DISKS\" > $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

View File

@@ -0,0 +1,104 @@
SUMMARY = "Tools for performance analysis"
HOMEPAGE = "http://lmbench.sourceforge.net/"
SECTION = "console/utils"
LICENSE = "GPL-2.0-only & GPL-2.0-with-lmbench-restriction"
LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
file://COPYING-2;md5=8e9aee2ccc75d61d107e43794a25cdf9"
inherit autotools-brokensep update-alternatives
DEPENDS += "libtirpc"
CFLAGS += "-I${STAGING_INCDIR}/tirpc"
PR = "r2"
SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
file://lmbench-run \
file://rename-line-binary.patch \
file://update-results-script.patch \
file://obey-ranlib.patch \
file://update-config-script.patch \
file://lmbench_result_html_report.patch \
file://fix-lmbench-memory-check-failure.patch \
file://0001-avoid-gcc-optimize-away-the-loops.patch \
file://0001-lat_http.c-Add-printf-format.patch \
file://0002-build-Adjust-CFLAGS-LDFLAGS-to-append-values-passed-.patch \
file://0001-src-Makefile-use-libdir-instead-of-hardcoded-lib.patch \
file://0001-lmbench-Point-webpage-lm-to-target-directory.patch \
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 \
file://0001-scripts-build-Fix-the-tests-to-build-with-clang15.patch \
"
SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/lmbench/files/development/"
UPSTREAM_CHECK_REGEX = "lmbench-(?P<pver>\d+(\.\d+)+-[a-z]+\d+)"
export OS = "${TARGET_SYS}"
export TARGET = "${TARGET_OS}"
EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
LDFLAGS="${LDFLAGS}" LD="${LD}" OS="${TARGET_SYS}" \
TARGET="${TARGET_OS}" BASE="${prefix}" MANDIR="${mandir}"'
do_configure() {
:
}
do_compile () {
for CONFIG_SITE_ITEM in $CONFIG_SITE; do
. $CONFIG_SITE_ITEM
done
if [ X"$ac_cv_uint" = X"yes" ]; then
CFLAGS="${CFLAGS} -DHAVE_uint"
fi
install -d ${S}/bin/${TARGET_SYS}
${S}/scripts/build
}
do_install () {
install -d ${D}${sysconfdir}/default/volatiles \
${D}${bindir} ${D}${mandir} \
${D}${datadir}/lmbench/scripts
echo "d root root 0755 ${localstatedir}/run/${BPN} none" \
> ${D}${sysconfdir}/default/volatiles/99_lmbench
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/tmpfiles.d
echo "d /run/${BPN} - - - -" \
> ${D}${sysconfdir}/tmpfiles.d/lmbench.conf
fi
oe_runmake BASE="${D}${prefix}" MANDIR="${D}${mandir}" \
DESTDIR="${D}" \
-C src install
mv ${D}${bindir}/line ${D}${bindir}/lm_line
install -m 0755 ${WORKDIR}/lmbench-run ${D}${bindir}/
install -m 0755 ${S}/bin/${TARGET_SYS}/cache ${D}${bindir}/
sed -i -e 's,^SHAREDIR=.*$,SHAREDIR=${datadir}/${BPN},;' \
-e 's,^CONFIG=.*$,CONFIG=`$SCRIPTSDIR/config`,;' \
${D}${bindir}/lmbench-run
install -m 0755 ${S}/scripts/lmbench ${D}${bindir}
install -m 0755 ${S}/scripts/* ${D}${datadir}/lmbench/scripts
install -m 0644 ${S}/src/webpage-lm.tar ${D}${datadir}/lmbench
}
pkg_postinst:${PN} () {
if [ -z "$D" ]; then
if command -v systemd-tmpfiles >/dev/null; then
systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/lmbench.conf
elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
${sysconfdir}/init.d/populate-volatile.sh update
fi
fi
}
RDEPENDS:${PN} = "perl"
FILES:${PN} += "${datadir}/lmbench"
ALTERNATIVE:${PN} = "stream hello"
ALTERNATIVE_LINK_NAME[stream] = "${bindir}/stream"
ALTERNATIVE_LINK_NAME[hello] = "${bindir}/hello"

View File

@@ -0,0 +1,18 @@
SUMMARY = "MBW determines the copy memory bandwidth available to userspace programs"
HOMEPAGE = "http://github.com/raas/mbw"
SECTION = "console/tests"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://mbw.spec;beginline=1;endline=10;md5=34d71e08e6337a8411d82d7dd0c54fe2"
SRC_URI = "git://github.com/raas/${BPN}.git;branch=master;protocol=https"
SRCREV = "d2cd3d36c353fee578f752c4e65a8c1efcee002c"
PV = "1.5"
S = "${WORKDIR}/git"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${B}/mbw ${D}${bindir}
}

View File

@@ -0,0 +1,28 @@
From 9a950b14b9f7767d83e5faac2e1e8203c500e2c2 Mon Sep 17 00:00:00 2001
From: Rod Whitby <rod@whitby.id.au>
Date: Tue, 25 Oct 2011 18:43:50 -0500
Subject: [PATCH] memtester: Added patch to Makefile to change no-longer-supported 'head -1' syntax to 'head -n 1'.
Signed-off-by: Joel A Fernandes <joelagnel@ti.com>
---
Makefile | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index a271bf5..6bccff3 100644
--- a/Makefile
+++ b/Makefile
@@ -32,8 +32,8 @@ install: all
auto-ccld.sh: \
conf-cc conf-ld warn-auto.sh
( cat warn-auto.sh; \
- echo CC=\'`head -1 conf-cc`\'; \
- echo LD=\'`head -1 conf-ld`\' \
+ echo CC=\'`head -n 1 conf-cc`\'; \
+ echo LD=\'`head -n 1 conf-ld`\' \
) > auto-ccld.sh
compile: \
--
1.7.0.4

View File

@@ -0,0 +1,24 @@
SUMMARY = "Utility to test for faulty memory subsystem"
HOMEPAGE = "http://pyropus.ca/software/memtester/"
SECTION = "console/utils"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
SRC_URI = "http://pyropus.ca/software/memtester/old-versions/${BP}.tar.gz \
file://Makefile.patch \
"
SRC_URI[sha256sum] = "c9fe4eb7e80c8cef5202f9065c4c0682f5616647c0455e916a5700f98e3dbb2e"
do_compile () {
echo '${CC} ${CFLAGS} -DPOSIX -c' > conf-cc
echo '${CC} ${LDFLAGS}' > conf-ld
oe_runmake
}
do_install () {
install -d ${D}${bindir}
install -d ${D}${mandir}/man8
install -m 0755 memtester ${D}${bindir}/
install -m 0755 memtester.8 ${D}${mandir}/man8/
}

View File

@@ -0,0 +1,23 @@
Makefile: add more dependencies to pointer.h
Upstream-Status: Inappropriate [no upstream]
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 915866d..edd9ea2 100644
--- a/Makefile
+++ b/Makefile
@@ -122,7 +122,7 @@ emfloat.o: emfloat.h emfloat.c nmglobal.h pointer.h Makefile
pointer.h: Makefile
touch pointer.h ;
-misc.o: misc.h misc.c Makefile
+misc.o: misc.h misc.c nmglobal.h pointer.h Makefile
$(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
-c misc.c

View File

@@ -0,0 +1,46 @@
From 81f4043a6787060029ef20eed21cdcf3e50337df Mon Sep 17 00:00:00 2001
From: Chase Maupin <Chase.Maupin@ti.com>
Date: Tue, 28 Feb 2012 14:58:35 -0600
Subject: [PATCH] nbench: modify Makefile for 32bit
* Patch taken from OE classic git repository as of commit id
ad42bf9065928b2902d7d9534709d3ccea7ec956 and was added by:
* Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
* Notes from original patch were:
BYTE Magazine's native benchmarks (also called BYTEmark) designed to
expose the capabilities of a system's CPU, FPU and memory system.
http://www.tux.org/~mayer/linux/
Recipe from old Atmel overlay.
Upstream-Status: Inappropriate [no upstream]
Signed-off-by: Chase Maupin <chase.maupin@ti.com>
---
Makefile | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 5045c77..915866d 100644
--- a/Makefile
+++ b/Makefile
@@ -119,12 +119,8 @@ emfloat.o: emfloat.h emfloat.c nmglobal.h pointer.h Makefile
$(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
-c emfloat.c
-pointer.h: pointer Makefile
- $(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
- -o pointer pointer.c
- rm -f pointer.h
- if [ "4" = `./pointer` ] ; then touch pointer.h ;\
- else echo "#define LONG64" >pointer.h ; fi
+pointer.h: Makefile
+ touch pointer.h ;
misc.o: misc.h misc.c Makefile
$(CC) $(MACHINE) $(DEFINES) $(CFLAGS)\
--
1.7.0.4

View File

@@ -0,0 +1,28 @@
SUMMARY = "A CPU benchmark utility"
DESCRIPTION = "BYTE Magazine's native benchmarks (also called BYTEmark) \
designed to expose the capabilities of a system's CPU, FPU, \
and memory system."
HOMEPAGE = "http://www.tux.org/~mayer/linux/"
LICENSE = "nbench-byte"
LIC_FILES_CHKSUM = "file://README;beginline=57;endline=66;md5=020ef579f8fa5746b7e307a54707834f"
SECTION = "console/utils"
SRC_URI = "https://fossies.org/linux/misc/old/${BP}.tar.gz \
file://nbench_32bits.patch \
file://Makefile-add-more-dependencies-to-pointer.h.patch"
SRC_URI[md5sum] = "285dfab361080759d477ea1fe7d3093a"
SRC_URI[sha256sum] = "723dd073f80e9969639eb577d2af4b540fc29716b6eafdac488d8f5aed9101ac"
EXTRA_OEMAKE = "-e MAKEFLAGS="
TARGET_CC_ARCH += "${LDFLAGS}"
do_compile() {
oe_runmake
}
do_install () {
install -d ${D}${bindir}
install -m 0644 NNET.DAT ${D}${bindir}/
install -m 0755 nbench ${D}${bindir}/
}

View File

@@ -0,0 +1,46 @@
From d3880d9d3ba795138444da83f1153c3c3ac27640 Mon Sep 17 00:00:00 2001
From: Michael Larabel <michael@phoronix.com>
Date: Sat, 23 Jul 2022 07:32:43 -0500
Subject: [PATCH] phoromatic: Explicitly check both $_GET abd $_POST in
phoromatic_quit_if_invalid_input_found()
Fixes: https://github.com/phoronix-test-suite/phoronix-test-suite/issues/650#issuecomment-1193116678
Upstream-Status: Backport
CVE: CVE-2022-40704
Reference to upstream patch:
https://github.com/phoronix-test-suite/phoronix-test-suite/commit/d3880d9d3ba795138444da83f1153c3c3ac27640
Signed-off-by: Li Wang <li.wang@windriver.com>
---
pts-core/phoromatic/phoromatic_functions.php | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/pts-core/phoromatic/phoromatic_functions.php b/pts-core/phoromatic/phoromatic_functions.php
index 74ccc5444c..c2313dcdea 100644
--- a/pts-core/phoromatic/phoromatic_functions.php
+++ b/pts-core/phoromatic/phoromatic_functions.php
@@ -37,9 +37,20 @@ function phoromatic_quit_if_invalid_input_found($input_keys = null)
{
foreach($input_keys as $key)
{
- if(isset($_REQUEST[$key]) && !empty($_REQUEST[$key]))
+ if(isset($_GET[$key]) && !empty($_GET[$key]))
{
- foreach(pts_arrays::to_array($_REQUEST[$key]) as $val_to_check)
+ foreach(pts_arrays::to_array($_GET[$key]) as $val_to_check)
+ {
+ if(stripos($val_to_check, $invalid_string) !== false)
+ {
+ echo '<strong>Exited due to invalid input ( ' . $invalid_string . ') attempted:</strong> ' . htmlspecialchars($val_to_check);
+ exit;
+ }
+ }
+ }
+ if(isset($_POST[$key]) && !empty($_POST[$key]))
+ {
+ foreach(pts_arrays::to_array($_POST[$key]) as $val_to_check)
{
if(stripos($val_to_check, $invalid_string) !== false)
{

View File

@@ -0,0 +1,43 @@
SUMMARY = "Phoronix Test Suite"
DESCRIPTION = "The Phoronix Test Suite is designed to carry out both qualitative \
and quantitative benchmarks in a clean, reproducible, and easy-to-use manner."
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SECTION = "console/tests"
SRC_URI = "http://www.phoronix-test-suite.com/releases/${BP}.tar.gz \
file://CVE-2022-40704.patch \
"
SRC_URI[sha256sum] = "1f2092d536c0a3193efc53e4a50f3cee65c0ef1a78d31e5404f1c663fff7b7f4"
S = "${WORKDIR}/phoronix-test-suite"
inherit systemd allarch mime mime-xdg
do_install() {
DESTDIR=${D} ./install-sh ${exec_prefix}
if [ "${systemd_unitdir}" != "/usr/lib/systemd" ]; then
install -d ${D}/${systemd_unitdir}/system/
mv ${D}/usr/lib/systemd/system/* ${D}/${systemd_unitdir}/system/
rm -rf ${D}/usr/lib/
fi
}
# It is not advisable to enable these services by default since they can cause
# continual target reboots if they encounter network problems.
#
SYSTEMD_AUTO_ENABLE = "disable"
SYSTEMD_SERVICE:${PN} = "phoromatic-client.service phoromatic-server.service"
RDEPENDS:${PN} += "bash python3-core php-cli util-linux-lscpu os-release lsb-release"
FILES:${PN} += " \
${datadir}/phoronix-test-suite \
${datadir}/appdata/phoronix-test-suite.appdata.xml \
${datadir}/icons/hicolor/48x48/apps/phoronix-test-suite.png \
${datadir}/icons/hicolor/64x64/mimetypes/application-x-openbenchmarking.png \
${datadir}/mime/packages/openbenchmarking-mime.xml \
${systemd_unitdir}/* \
"

View File

@@ -0,0 +1,19 @@
SUMMARY = "Measure socket and RDMA performance"
DESCRIPTION = "qperf measures bandwidth and latency between two nodes."
HOMEPAGE = "https://github.com/linux-rdma/qperf"
AUTHOR = "Johann George"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
inherit autotools-brokensep
SRCREV = "c706363815a38ff2c5cbc07b73e2cfaaa59bae0f"
SRC_URI = "git://github.com/linux-rdma/qperf.git;protocol=https;branch=master"
S = "${WORKDIR}/git"
do_configure() {
./cleanup
./autogen.sh
oe_runconf
}

View File

@@ -0,0 +1,33 @@
SUMMARY = "Small collection of benchmarks for storage I/O"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b529aaa6a0c50f15d29f89609b5c22f3"
SRCREV = "f97f1ae321d1fb8111a2c638075702ed2512ff07"
PV = "3.6"
SRC_URI = "git://github.com/Algodev-github/S.git;protocol=https;branch=master"
S = "${WORKDIR}/git"
# installing in /opt/S-suite since the package has
# dependencies to the directory structure.
do_install() {
install -d ${D}/opt/S-suite
for i in $(find ${S}/* -type d); do
install -d ${D}/opt/S-suite/$(basename $i)
install -m0755 -p ${S}/$(basename $i)/* ${D}/opt/S-suite/$(basename $i)
done
install -m0755 ${S}/def_config.sh ${D}/opt/S-suite
install -m0755 ${S}/config_params.sh ${D}/opt/S-suite
install -m0755 ${S}/create_config.sh ${D}/opt/S-suite
install -m0755 ${S}/process_config.sh ${D}/opt/S-suite
}
RDEPENDS:${PN} = "bash bc coreutils gawk g++ gcc fio libaio libaio-dev sysstat \
git"
FILES:${PN} = "/opt/S-suite/"
# added to INSANE_SKIP since s-suite have an runtime
# dependency (RDEPENDS) on libaio-dev.
INSANE_SKIP:${PN} += "dev-deps"

View File

@@ -0,0 +1,37 @@
From 73049e5a9e3698cc6d51471d70ac5e06bed803cc Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 17 Dec 2022 10:24:48 -0800
Subject: [PATCH] configure: Add --with-cpu
Some cross build systems e.g. yocto may use architectures different from cross compiler target tuple
arm-yoe-gnueabi but build for armv7a, AC_CANONICAL_HOST will fail in
this case even though target will be armv7a it will detect it as arm and
disable armv7a specific optimization paths. This option provides the
needed knob so it can be set explicitly e.g. --with-cpu=armv7a etc. if needed.
Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index c839c87..403728c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,7 +11,14 @@ else
AC_MSG_NOTICE([Compiling with dynamically linked libraries.])
fi
-AC_CANONICAL_HOST
+AC_ARG_WITH(cpu, [ --with-cpu define host cpu])
+
+if test -z "$with_cpu"
+then
+ AC_CANONICAL_HOST
+else
+ host_cpu=$with_cpu
+fi
# Checking for target cpu and setting custom configuration
# for the different platforms
AS_CASE(["$host_cpu"],

View File

@@ -0,0 +1,103 @@
From 9ab360fd018d267fe174713d7e14454408b26043 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 17 Dec 2022 10:33:01 -0800
Subject: [PATCH] Replace lfs64 functions and defines
AC_SYS_LARGEFILE is already in use in configure.ac which detects
enabling lfs64 functions as needed, it will define _FILE_OFFSET_BITS=64
which should make lseek same as lseek64 since off_t is 64bit on most of
current 32bit linux platforms
Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/os.cc | 18 ++++++------------
src/worker.cc | 6 +++---
2 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/src/os.cc b/src/os.cc
index 1928e0a..faa6068 100644
--- a/src/os.cc
+++ b/src/os.cc
@@ -142,7 +142,7 @@ int OsLayer::AddressMode() {
uint64 OsLayer::VirtualToPhysical(void *vaddr) {
uint64 frame, paddr, pfnmask, pagemask;
int pagesize = sysconf(_SC_PAGESIZE);
- off64_t off = ((uintptr_t)vaddr) / pagesize * 8;
+ off_t off = ((uintptr_t)vaddr) / pagesize * 8;
int fd = open(kPagemapPath, O_RDONLY);
/*
@@ -154,7 +154,7 @@ uint64 OsLayer::VirtualToPhysical(void *vaddr) {
if (fd < 0)
return 0;
- if (lseek64(fd, off, SEEK_SET) != off || read(fd, &frame, 8) != 8) {
+ if (lseek(fd, off, SEEK_SET) != off || read(fd, &frame, 8) != 8) {
int err = errno;
string errtxt = ErrorString(err);
logprintf(0, "Process Error: failed to access %s with errno %d (%s)\n",
@@ -607,9 +607,9 @@ bool OsLayer::AllocateTestMem(int64 length, uint64 paddr_base) {
dynamic_mapped_shmem_ = true;
} else {
// Do a full mapping here otherwise.
- shmaddr = mmap64(NULL, length, PROT_READ | PROT_WRITE,
- MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
- shm_object, 0);
+ shmaddr = mmap(NULL, length, PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
+ shm_object, 0);
if (shmaddr == reinterpret_cast<void*>(-1)) {
int err = errno;
string errtxt = ErrorString(err);
@@ -704,18 +704,12 @@ void *OsLayer::PrepareTestMem(uint64 offset, uint64 length) {
if (dynamic_mapped_shmem_) {
// TODO(nsanders): Check if we can support MAP_NONBLOCK,
// and evaluate performance hit from not using it.
-#ifdef HAVE_MMAP64
- void * mapping = mmap64(NULL, length, PROT_READ | PROT_WRITE,
- MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
- shmid_, offset);
-#else
void * mapping = mmap(NULL, length, PROT_READ | PROT_WRITE,
MAP_SHARED | MAP_NORESERVE | MAP_LOCKED | MAP_POPULATE,
shmid_, offset);
-#endif
if (mapping == MAP_FAILED) {
string errtxt = ErrorString(errno);
- logprintf(0, "Process Error: PrepareTestMem mmap64(%llx, %llx) failed. "
+ logprintf(0, "Process Error: PrepareTestMem mmap(%llx, %llx) failed. "
"error: %s.\n",
offset, length, errtxt.c_str());
sat_assert(0);
diff --git a/src/worker.cc b/src/worker.cc
index 745a816..41e93a0 100644
--- a/src/worker.cc
+++ b/src/worker.cc
@@ -1705,7 +1705,7 @@ bool FileThread::WritePages(int fd) {
int strict = sat_->strict();
// Start fresh at beginning of file for each batch of pages.
- lseek64(fd, 0, SEEK_SET);
+ lseek(fd, 0, SEEK_SET);
for (int i = 0; i < sat_->disk_pages(); i++) {
struct page_entry src;
if (!GetValidPage(&src))
@@ -1943,7 +1943,7 @@ bool FileThread::ReadPages(int fd) {
bool result = true;
// Read our data back out of the file, into it's new location.
- lseek64(fd, 0, SEEK_SET);
+ lseek(fd, 0, SEEK_SET);
for (int i = 0; i < sat_->disk_pages(); i++) {
struct page_entry dst;
if (!GetEmptyPage(&dst))
@@ -3153,7 +3153,7 @@ bool DiskThread::ValidateBlockOnDisk(int fd, BlockData *block) {
// Read block from disk and time the read. If it takes longer than the
// threshold, complain.
- if (lseek64(fd, address * kSectorSize, SEEK_SET) == -1) {
+ if (lseek(fd, address * kSectorSize, SEEK_SET) == -1) {
logprintf(0, "Process Error: Unable to seek to sector %lld in "
"DiskThread::ValidateSectorsOnDisk on disk %s "
"(thread %d).\n", address, device_name_.c_str(), thread_num_);

View File

@@ -0,0 +1,43 @@
From d64a282b57352dde5f5b007947c005e504dc9a6b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 17 Dec 2022 10:46:31 -0800
Subject: [PATCH] configure: Check for pthread_rwlockattr_setkind_np before use
musl does not implement this therefore detect this non-posix API before
using it
Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 1 +
src/worker.cc | 2 ++
2 files changed, 3 insertions(+)
diff --git a/configure.ac b/configure.ac
index 403728c..47968cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,6 +157,7 @@ AC_FUNC_STRERROR_R
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([ftruncate gettimeofday memset munmap select socket strtol strtoull])
AC_CHECK_FUNCS([mmap64 posix_memalign rand_r sched_getaffinity])
+AC_CHECK_FUNCS([pthread_rwlockattr_setkind_np])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
diff --git a/src/worker.cc b/src/worker.cc
index 41e93a0..c4abc87 100644
--- a/src/worker.cc
+++ b/src/worker.cc
@@ -133,9 +133,11 @@ void WorkerStatus::Initialize() {
pthread_rwlockattr_t attrs;
sat_assert(0 == pthread_rwlockattr_init(&attrs));
+#ifdef HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP
// Avoid writer lock starvation.
sat_assert(0 == pthread_rwlockattr_setkind_np(
&attrs, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP));
+#endif
sat_assert(0 == pthread_rwlock_init(&status_rwlock_, &attrs));
#ifdef HAVE_PTHREAD_BARRIERS

View File

@@ -0,0 +1,28 @@
Fix compile on sytems using libc++ instead of libstdc++
libc++ does not really implement __gnu_cxx namespace and it
compiles fine without this namespace, therefore detect libc++
and if it is used them exclude this namespace
See https://github.com/stressapptest/stressapptest/issues/47
Fixes
./sattypes.h:33:17: error: expected namespace name
using namespace __gnu_cxx; //NOLINT
Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- stressapptest-1.0.9.orig/src/sattypes.h
+++ stressapptest-1.0.9/src/sattypes.h
@@ -30,7 +30,9 @@
#include "stressapptest_config_android.h" // NOLINT
#else
#include "stressapptest_config.h" // NOLINT
+#ifndef _LIBCPP_VERSION
using namespace __gnu_cxx; //NOLINT
+#endif // _LIBCPP_VERSION
#endif // __ANDROID__
using namespace std;

View File

@@ -0,0 +1,72 @@
sysconf params like _SC_LEVEL1_DCACHE_LINESIZE are not universally
implemented, therefore check for them being available, if not there
then read the sysfs directly to get the value
Upstream-Status: Submitted [https://github.com/stressapptest/stressapptest/pull/100]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/src/sat.cc
+++ b/src/sat.cc
@@ -1482,15 +1482,47 @@ int Sat::CpuCount() {
return sysconf(_SC_NPROCESSORS_CONF);
}
+int Sat::ReadInt(const char *filename, int *value) {
+ char line[64];
+ int fd = open(filename, O_RDONLY), err = -1;
+
+ if (fd < 0)
+ return -1;
+ if (read(fd, line, sizeof(line)) > 0) {
+ *value = atoi(line);
+ err = 0;
+ }
+
+ close(fd);
+ return err;
+}
+
// Return the worst case (largest) cache line size of the various levels of
// cache actually prsent in the machine.
int Sat::CacheLineSize() {
- int max_linesize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
- int linesize = sysconf(_SC_LEVEL2_CACHE_LINESIZE);
+ int max_linesize, linesize;
+#ifdef _SC_LEVEL1_DCACHE_LINESIZE
+ max_linesize = sysconf(_SC_LEVEL1_DCACHE_LINESIZE);
+#else
+ ReadInt("/sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size", &max_linesize);
+#endif
+#ifdef _SC_LEVEL2_DCACHE_LINESIZE
+ linesize = sysconf(_SC_LEVEL2_DCACHE_LINESIZE);
+#else
+ ReadInt("/sys/devices/system/cpu/cpu0/cache/index1/coherency_line_size", &linesize);
+#endif
if (linesize > max_linesize) max_linesize = linesize;
- linesize = sysconf(_SC_LEVEL3_CACHE_LINESIZE);
+#ifdef _SC_LEVEL3_DCACHE_LINESIZE
+ linesize = sysconf(_SC_LEVEL3_DCACHE_LINESIZE);
+#else
+ ReadInt("/sys/devices/system/cpu/cpu0/cache/index2/coherency_line_size", &linesize);
+#endif
if (linesize > max_linesize) max_linesize = linesize;
- linesize = sysconf(_SC_LEVEL4_CACHE_LINESIZE);
+#ifdef _SC_LEVEL4_DCACHE_LINESIZE
+ linesize = sysconf(_SC_LEVEL4_DCACHE_LINESIZE);
+#else
+ ReadInt("/sys/devices/system/cpu/cpu0/cache/index3/coherency_line_size", &linesize);
+#endif
if (linesize > max_linesize) max_linesize = linesize;
return max_linesize;
}
--- a/src/sat.h
+++ b/src/sat.h
@@ -136,7 +136,8 @@ class Sat {
int CpuCount();
// Return the worst-case (largest) cache line size of the system.
int CacheLineSize();
-
+ // Read int values from kernel file system e.g. sysfs
+ int ReadInt(const char *filename, int *value);
// Collect error counts from threads.
int64 GetTotalErrorCount();

View File

@@ -0,0 +1,31 @@
SUMMARY = "Stressful Application Test"
DESCRIPTION = "Stressful Application Test (or stressapptest, its unix name) \
is a memory interface test. It tries to maximize randomized traffic to memory \
from processor and I/O, with the intent of creating a realistic high load \
situation in order to test the existing hardware devices in a computer. \
"
HOMEPAGE = "https://github.com/stressapptest/stressapptest"
SECTION = "benchmark"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://COPYING;md5=55ea9d559f985fb4834317d8ed6b9e58"
SRCREV = "9146a8bfe3e3daefa95f7a61b75183e5fc64af2c"
PV .= "+1.0.10git${SRCPV}"
EXTRA_AUTOCONF:append:armv7a = " --with-cpu=armv7a"
EXTRA_AUTOCONF:append:armv7ve = " --with-cpu=armv7a"
GI_DATA_ENABLED:libc-musl:armv7a = "False"
GI_DATA_ENABLED:libc-musl:armv7ve = "False"
SRC_URI = "git://github.com/stressapptest/stressapptest;branch=master;protocol=https \
file://libcplusplus-compat.patch \
file://read_sysfs_for_cachesize.patch \
file://0001-configure-Add-with-cpu.patch \
file://0002-Replace-lfs64-functions-and-defines.patch \
file://0003-configure-Check-for-pthread_rwlockattr_setkind_np-be.patch \
"
S = "${WORKDIR}/git"
inherit autotools

View File

@@ -0,0 +1,30 @@
SUMMARY = "System performance benchmark"
HOMEPAGE = "http://github.com/akopytov/sysbench"
SECTION = "console/tests"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
DEPENDS = "libtool libaio luajit concurrencykit"
inherit autotools-brokensep pkgconfig
# The project has moved from Sourceforge to Launchpad, to Github. Use the source tarball from
# Launchpad until the next release is available from Github.
SRC_URI = "git://github.com/akopytov/sysbench.git;protocol=https;branch=master"
SRCREV = "ebf1c90da05dea94648165e4f149abc20c979557"
S = "${WORKDIR}/git"
COMPATIBLE_HOST = "(arm|aarch64|i.86|x86_64).*-linux*"
EXTRA_OECONF += "--enable-largefile --with-system-luajit --with-system-ck --without-gcc-arch"
PACKAGECONFIG ??= ""
PACKAGECONFIG[aio] = "--enable-aio,--disable-aio,libaio,"
PACKAGECONFIG[mysql] = "--with-mysql \
--with-mysql-includes=${STAGING_INCDIR}/mysql \
--with-mysql-libs=${STAGING_LIBDIR}, \
--without-mysql,mysql5"
do_configure:prepend() {
touch ${S}/NEWS ${S}/AUTHORS
}

View File

@@ -0,0 +1,444 @@
From b0a64ddebb517a1678c44d9baf24d8bbe39d02cd Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 29 Jan 2019 13:15:07 -0800
Subject: [PATCH] asm: Delete .func/.endfunc directives
These are useful only with stabs debug format, which is not used on
linux systems, gas ignores them silently, but clang assembler does not
and rightly so.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
aarch64-asm.S | 14 +-------------
arm-neon.S | 24 ------------------------
mips-32.S | 5 ++---
x86-sse2.S | 21 ++++++++++-----------
4 files changed, 13 insertions(+), 51 deletions(-)
diff --git a/aarch64-asm.S b/aarch64-asm.S
index 842b9e2..165c8ac 100644
--- a/aarch64-asm.S
+++ b/aarch64-asm.S
@@ -31,8 +31,7 @@
.macro asm_function function_name
.global \function_name
- .type \function_name,%function
-.func \function_name
+ .type \function_name,%function
\function_name:
DST .req x0
SRC .req x1
@@ -54,7 +53,6 @@ asm_function aligned_block_copy_ldpstp_x_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_copy_ldpstp_q_aarch64
0:
@@ -67,7 +65,6 @@ asm_function aligned_block_copy_ldpstp_q_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_copy_ldpstp_q_pf32_l2strm_aarch64
0:
@@ -82,7 +79,6 @@ asm_function aligned_block_copy_ldpstp_q_pf32_l2strm_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_copy_ldpstp_q_pf64_l2strm_aarch64
0:
@@ -96,7 +92,6 @@ asm_function aligned_block_copy_ldpstp_q_pf64_l2strm_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_copy_ldpstp_q_pf32_l1keep_aarch64
0:
@@ -111,7 +106,6 @@ asm_function aligned_block_copy_ldpstp_q_pf32_l1keep_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_copy_ldpstp_q_pf64_l1keep_aarch64
0:
@@ -125,7 +119,6 @@ asm_function aligned_block_copy_ldpstp_q_pf64_l1keep_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_fill_stp_x_aarch64
0:
@@ -137,7 +130,6 @@ asm_function aligned_block_fill_stp_x_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_fill_stp_q_aarch64
0:
@@ -147,7 +139,6 @@ asm_function aligned_block_fill_stp_q_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_fill_stnp_x_aarch64
0:
@@ -159,7 +150,6 @@ asm_function aligned_block_fill_stnp_x_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_fill_stnp_q_aarch64
0:
@@ -169,7 +159,6 @@ asm_function aligned_block_fill_stnp_q_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
asm_function aligned_block_copy_ld1st1_aarch64
0:
@@ -180,6 +169,5 @@ asm_function aligned_block_copy_ld1st1_aarch64
subs SIZE, SIZE, #64
bgt 0b
ret
-.endfunc
#endif
diff --git a/arm-neon.S b/arm-neon.S
index 4db78ce..9631d82 100644
--- a/arm-neon.S
+++ b/arm-neon.S
@@ -32,7 +32,6 @@
.macro asm_function function_name
.global \function_name
-.func \function_name
\function_name:
DST .req r0
SRC .req r1
@@ -66,7 +65,6 @@ asm_function aligned_block_read_neon
vpadd.u32 d31, d31, d31
vmov.u32 r0, d31[0]
bx lr
-.endfunc
/* Actually this calculates a sum of 32-bit values */
asm_function aligned_block_read_pf32_neon
@@ -97,7 +95,6 @@ asm_function aligned_block_read_pf32_neon
vpadd.u32 d31, d31, d31
vmov.u32 r0, d31[0]
bx lr
-.endfunc
/* Actually this calculates a sum of 32-bit values */
asm_function aligned_block_read_pf64_neon
@@ -127,7 +124,6 @@ asm_function aligned_block_read_pf64_neon
vpadd.u32 d31, d31, d31
vmov.u32 r0, d31[0]
bx lr
-.endfunc
/* Actually this calculates a sum of 32-bit values */
asm_function aligned_block_read2_neon
@@ -156,7 +152,6 @@ asm_function aligned_block_read2_neon
vpadd.u32 d31, d31, d31
vmov.u32 r0, d31[0]
bx lr
-.endfunc
/* Actually this calculates a sum of 32-bit values */
asm_function aligned_block_read2_pf32_neon
@@ -187,7 +182,6 @@ asm_function aligned_block_read2_pf32_neon
vpadd.u32 d31, d31, d31
vmov.u32 r0, d31[0]
bx lr
-.endfunc
/* Actually this calculates a sum of 32-bit values */
asm_function aligned_block_read2_pf64_neon
@@ -217,7 +211,6 @@ asm_function aligned_block_read2_pf64_neon
vpadd.u32 d31, d31, d31
vmov.u32 r0, d31[0]
bx lr
-.endfunc
asm_function aligned_block_copy_neon
0:
@@ -226,7 +219,6 @@ asm_function aligned_block_copy_neon
subs SIZE, SIZE, #32
bgt 0b
bx lr
-.endfunc
asm_function aligned_block_copy_unrolled_neon
vpush {d8-d15}
@@ -244,7 +236,6 @@ asm_function aligned_block_copy_unrolled_neon
bgt 0b
vpop {d8-d15}
bx lr
-.endfunc
asm_function aligned_block_copy_pf32_neon
0:
@@ -254,7 +245,6 @@ asm_function aligned_block_copy_pf32_neon
subs SIZE, SIZE, #32
bgt 0b
bx lr
-.endfunc
asm_function aligned_block_copy_unrolled_pf32_neon
vpush {d8-d15}
@@ -280,7 +270,6 @@ asm_function aligned_block_copy_unrolled_pf32_neon
bgt 0b
vpop {d8-d15}
bx lr
-.endfunc
asm_function aligned_block_copy_pf64_neon
0:
@@ -292,7 +281,6 @@ asm_function aligned_block_copy_pf64_neon
subs SIZE, SIZE, #64
bgt 0b
bx lr
-.endfunc
asm_function aligned_block_copy_unrolled_pf64_neon
vpush {d8-d15}
@@ -314,7 +302,6 @@ asm_function aligned_block_copy_unrolled_pf64_neon
bgt 0b
vpop {d8-d15}
bx lr
-.endfunc
asm_function aligned_block_copy_backwards_neon
add SRC, SRC, SIZE
@@ -328,7 +315,6 @@ asm_function aligned_block_copy_backwards_neon
subs SIZE, SIZE, #32
bgt 0b
bx lr
-.endfunc
asm_function aligned_block_copy_backwards_pf32_neon
add SRC, SRC, SIZE
@@ -343,7 +329,6 @@ asm_function aligned_block_copy_backwards_pf32_neon
subs SIZE, SIZE, #32
bgt 0b
bx lr
-.endfunc
asm_function aligned_block_copy_backwards_pf64_neon
add SRC, SRC, SIZE
@@ -360,7 +345,6 @@ asm_function aligned_block_copy_backwards_pf64_neon
subs SIZE, SIZE, #64
bgt 0b
bx lr
-.endfunc
asm_function aligned_block_fill_neon
vld1.8 {d0, d1, d2, d3}, [SRC]!
@@ -370,7 +354,6 @@ asm_function aligned_block_fill_neon
subs SIZE, SIZE, #64
bgt 0b
bx lr
-.endfunc
asm_function aligned_block_fill_backwards_neon
add SRC, SRC, SIZE
@@ -383,7 +366,6 @@ asm_function aligned_block_fill_backwards_neon
subs SIZE, SIZE, #32
bgt 0b
bx lr
-.endfunc
/* some code for older ARM processors */
@@ -398,7 +380,6 @@ asm_function aligned_block_fill_stm4_armv4
subs SIZE, SIZE, #64
bgt 0b
pop {r4-r12, pc}
-.endfunc
asm_function aligned_block_fill_stm8_armv4
push {r4-r12, lr}
@@ -409,7 +390,6 @@ asm_function aligned_block_fill_stm8_armv4
subs SIZE, SIZE, #64
bgt 0b
pop {r4-r12, pc}
-.endfunc
asm_function aligned_block_fill_strd_armv5te
push {r4-r12, lr}
@@ -426,7 +406,6 @@ asm_function aligned_block_fill_strd_armv5te
subs SIZE, SIZE, #64
bgt 0b
pop {r4-r12, pc}
-.endfunc
asm_function aligned_block_copy_incr_armv5te
push {r4-r12, lr}
@@ -442,7 +421,6 @@ asm_function aligned_block_copy_incr_armv5te
stmia DST!, {r8-r11}
bgt 0b
pop {r4-r12, pc}
-.endfunc
asm_function aligned_block_copy_wrap_armv5te
push {r4-r12, lr}
@@ -458,7 +436,6 @@ asm_function aligned_block_copy_wrap_armv5te
stmia DST!, {r8-r11}
bgt 0b
pop {r4-r12, pc}
-.endfunc
asm_function aligned_block_copy_vfp
push {r4-r12, lr}
@@ -470,6 +447,5 @@ asm_function aligned_block_copy_vfp
bgt 0b
vpop {d8-d15}
pop {r4-r12, pc}
-.endfunc
#endif
diff --git a/mips-32.S b/mips-32.S
index 17b2b7f..4f7ddae 100644
--- a/mips-32.S
+++ b/mips-32.S
@@ -32,7 +32,6 @@
.macro asm_function function_name
.global \function_name
.type \function_name, @function
- .func \function_name
\function_name:
.endm
@@ -93,7 +92,7 @@ asm_function aligned_block_fill_pf32_mips32
2:
jr $ra
nop
-.endfunc
+
/*
* void aligned_block_copy_pf32_mips32(int64_t *dst, int64_t *src, int size)
@@ -178,6 +177,6 @@ asm_function aligned_block_copy_pf32_mips32
lw $s7, 28($sp)
jr $ra
addi $sp, $sp, 32
-.endfunc
+
#endif
diff --git a/x86-sse2.S b/x86-sse2.S
index d8840e4..409031b 100644
--- a/x86-sse2.S
+++ b/x86-sse2.S
@@ -30,7 +30,6 @@
.macro asm_function_helper function_name
.global \function_name
-.func \function_name
\function_name:
#ifdef __amd64__
#ifdef _WIN64
@@ -90,7 +89,7 @@ asm_function aligned_block_copy_movsb
pop3 edi esi ecx
#endif
ret
-.endfunc
+
asm_function aligned_block_copy_movsd
0:
@@ -110,7 +109,7 @@ asm_function aligned_block_copy_movsd
pop3 edi esi ecx
#endif
ret
-.endfunc
+
asm_function aligned_block_copy_sse2
0:
@@ -127,7 +126,7 @@ asm_function aligned_block_copy_sse2
sub SIZE, 64
jg 0b
ret
-.endfunc
+
asm_function aligned_block_copy_nt_sse2
0:
@@ -144,7 +143,7 @@ asm_function aligned_block_copy_nt_sse2
sub SIZE, 64
jg 0b
ret
-.endfunc
+
asm_function aligned_block_copy_pf32_sse2
0:
@@ -163,7 +162,7 @@ asm_function aligned_block_copy_pf32_sse2
sub SIZE, 64
jg 0b
ret
-.endfunc
+
asm_function aligned_block_copy_nt_pf32_sse2
0:
@@ -182,7 +181,7 @@ asm_function aligned_block_copy_nt_pf32_sse2
sub SIZE, 64
jg 0b
ret
-.endfunc
+
asm_function aligned_block_copy_pf64_sse2
0:
@@ -200,7 +199,7 @@ asm_function aligned_block_copy_pf64_sse2
sub SIZE, 64
jg 0b
ret
-.endfunc
+
asm_function aligned_block_copy_nt_pf64_sse2
0:
@@ -218,7 +217,7 @@ asm_function aligned_block_copy_nt_pf64_sse2
sub SIZE, 64
jg 0b
ret
-.endfunc
+
asm_function aligned_block_fill_sse2
movdqa xmm0, [SRC + 0]
@@ -231,7 +230,7 @@ asm_function aligned_block_fill_sse2
sub SIZE, 64
jg 0b
ret
-.endfunc
+
asm_function aligned_block_fill_nt_sse2
movdqa xmm0, [SRC + 0]
@@ -244,7 +243,7 @@ asm_function aligned_block_fill_nt_sse2
sub SIZE, 64
jg 0b
ret
-.endfunc
+
/*****************************************************************************/

View File

@@ -0,0 +1,35 @@
DESCRIPTION = "A simple memory benchmark program, which tries to measure the \
peak bandwidth of sequential memory accesses and the latency of random memory \
accesses. Bandwidth is measured by running different assembly code for the \
aligned memory blocks and attempting different prefetch strategies"
HOMEPAGE = "https://github.com/ssvb/tinymembench/wiki"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://main.c;endline=22;md5=879b9bbb60851454885b5fa47eb6b345"
PV = "0.4.9+git${SRCPV}"
SRCREV = "a2cf6d7e382e3aea1eb39173174d9fa28cad15f3"
SRC_URI = "git://github.com/ssvb/tinymembench.git;branch=master;protocol=https \
file://0001-asm-Delete-.func-.endfunc-directives.patch \
"
S = "${WORKDIR}/git"
TARGET_CC_ARCH += "${LDFLAGS}"
do_install() {
install -d ${D}${bindir}
install -m755 tinymembench ${D}${bindir}/
}
# Fails to build with thumb-1 (qemuarm)
#| {standard input}: Assembler messages:
#| {standard input}:66: Error: instruction not supported in Thumb16 mode -- `subs r1,r1,#16'
#| {standard input}:69: Error: instruction not supported in Thumb16 mode -- `subs r1,r1,#16'
#| {standard input}:82: Error: selected processor does not support Thumb mode `mla r3,r4,r3,r5'
#| {standard input}:82: Error: unshifted register required -- `and r8,r7,r3,lsr#16'
ARM_INSTRUCTION_SET = "arm"
#
# Does not work for 64bit mips.
#
COMPATIBLE_HOST = "^(?!mips64).*"

View File

@@ -0,0 +1,30 @@
From 5429ab90eb33eb243fa7b9cd247e0490d72b9da5 Mon Sep 17 00:00:00 2001
From: Otavio Salvador <otavio@ossystems.com.br>
Date: Wed, 9 Sep 2015 15:04:45 +0000
Subject: [PATCH] Drop 'inline' of crc32 function to fix build using GCC 5.2
Organization: O.S. Systems Software LTDA.
Upstream-Status: Pending
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
crc32.h | 1 -
crc32.o | Bin 748 -> 2056 bytes
2 files changed, 1 deletion(-)
diff --git a/crc32.h b/crc32.h
index 62b3433..8fc62b6 100644
--- a/crc32.h
+++ b/crc32.h
@@ -18,7 +18,6 @@
#ifndef CRC32_H
#define CRC32_H
-inline
unsigned long crc32( const void* const buffer,
unsigned long length,
unsigned long crc);
--
2.1.4

View File

@@ -0,0 +1,49 @@
From b08e61ef64eece23ce8ffa2784cd3c4f70b6169e Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 17 Jun 2017 08:08:56 -0700
Subject: [PATCH] Specify printf formats
Fixes
tiotest.c:555:4: error: format not a string literal and no format arguments [-Werror=format-security]
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tiotest.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tiotest.c b/tiotest.c
index 6b3d0c3..3e6166a 100644
--- a/tiotest.c
+++ b/tiotest.c
@@ -91,7 +91,7 @@ inline void checkIntZero(int value, char *mess)
{
if (value <= 0)
{
- printf(mess);
+ printf("%s",mess);
printf("Try 'tiotest -h' for more information.\n");
exit(1);
}
@@ -101,7 +101,7 @@ inline void checkLong(long value, char *mess)
{
if (value < 0)
{
- printf(mess);
+ printf("%s", mess);
printf("Try 'tiotest -h' for more information\n");
exit(1);
}
@@ -552,7 +552,7 @@ void do_test( ThreadTest *test, int testCase, int sequential,
if(args.debugLevel > 4)
{
printf("Created %d threads\n", i);
- fprintf(stderr, debugMessage);
+ fprintf(stderr, "%s", debugMessage);
fflush(stderr);
}
--
2.13.1

View File

@@ -0,0 +1,57 @@
From: Otavio Salvador <otavio@ossystems.com.br>
Subject: [PATCH] Avoid aligned allocation function name clashes
glibc added new methods for aligned allocation and it clashes with the
local version used by 'tiobench'. To fix it, we prefix the methods
with '_'.
Upstream-Status: Pending
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
tiotest.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tiotest.c b/tiotest.c
index 38f54e7..6b3d0c3 100644
--- a/tiotest.c
+++ b/tiotest.c
@@ -31,7 +31,7 @@ static const char* versionStr = "tiotest v0.3.3 (C) 1999-2000 Mika Kuoppala <mik
*/
ArgumentOptions args;
-static void * aligned_alloc(ssize_t size)
+static void * _aligned_alloc(ssize_t size)
{
caddr_t a;
a = mmap((caddr_t )0, size,
@@ -41,7 +41,7 @@ static void * aligned_alloc(ssize_t size)
return a;
}
-static int aligned_free(caddr_t a, ssize_t size)
+static int _aligned_free(caddr_t a, ssize_t size)
{
return munmap(a, size);
}
@@ -281,7 +281,7 @@ void initialize_test( ThreadTest *d )
pthread_attr_setscope(&(d->threads[i].thread_attr),
PTHREAD_SCOPE_SYSTEM);
- d->threads[i].buffer = aligned_alloc( d->threads[i].blockSize );
+ d->threads[i].buffer = _aligned_alloc( d->threads[i].blockSize );
if( d->threads[i].buffer == NULL )
{
perror("Error allocating memory");
@@ -383,7 +383,7 @@ void cleanup_test( ThreadTest *d )
{
if (!args.rawDrives)
unlink(d->threads[i].fileName);
- aligned_free( d->threads[i].buffer, d->threads[i].blockSize );
+ _aligned_free( d->threads[i].buffer, d->threads[i].blockSize );
d->threads[i].buffer = 0;
pthread_attr_destroy( &(d->threads[i].thread_attr) );
--
1.7.7

View File

@@ -0,0 +1,49 @@
Adapt tiobench to OE
Author: Ludovic Desroches <ludovic.desroches@atmel.com>
Upstream-Status: Inappropriate [not author]
Index: Makefile
===================================================================
--- a/Makefile 2011-05-26 07:48:46.341400974 +0200
+++ b/Makefile 2011-05-30 06:32:38.091401358 +0200
@@ -1,8 +1,9 @@
# Makefile for tiotest
-CC=gcc
+CC?=gcc
#CFLAGS=-O3 -fomit-frame-pointer -Wall
CFLAGS=-O2 -Wall
+LDFLAGS?=
#DEFINES=-DUSE_MMAP
#-DUSE_MADVISE
@@ -14,16 +15,16 @@
#DEFINES=
-LINK=gcc
+LINK?=$(CC)
EXE=tiotest
PROJECT=tiobench
# do it once instead of each time referenced
VERSION=$(shell egrep "tiotest v[0-9]+.[0-9]+" tiotest.c | cut -d " " -f 7 | sed "s/v//g")
DISTNAME=$(PROJECT)-$(VERSION)
INSTALL=install
-PREFIX=/usr/local
+PREFIX?=/usr/local
BINDIR=$(PREFIX)/bin
-DOCDIR=/usr/local/doc/$(DISTNAME)
+DOCDIR=$(PREFIX)/share/doc/$(DISTNAME)
all: $(EXE)
@@ -34,7 +35,7 @@
$(CC) -c $(CFLAGS) $(DEFINES) tiotest.c -o tiotest.o
$(EXE): tiotest.o crc32.o
- $(LINK) -o $(EXE) tiotest.o crc32.o -lpthread
+ $(LINK) -o $(EXE) tiotest.o crc32.o -lpthread $(LDFLAGS)
@echo
@echo "./tiobench.pl --help for usage options"
@echo

View File

@@ -0,0 +1,30 @@
SUMMARY = "Threaded I/O tester"
HOMEPAGE = "http://sourceforge.net/projects/tiobench/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
PR = "r1"
SRC_URI = "\
http://sourceforge.net/projects/tiobench/files/tiobench/${PV}/${BP}.tar.gz \
file://tiobench-makefile.patch \
file://avoid-glibc-clashes.patch \
file://0001-Drop-inline-of-crc32-function-to-fix-build-using-GCC.patch \
file://0001-Specify-printf-formats.patch \
"
SRC_URI[md5sum] = "bf485bf820e693c79e6bd2a38702a128"
SRC_URI[sha256sum] = "8ad011059a35ac70cdb5e3d3999ceee44a8e8e9078926844b0685b7ea9db2bcc"
EXTRA_OEMAKE = "PREFIX=${D}/usr"
do_install() {
oe_runmake install
}
RDEPENDS:${PN} = "\
perl \
perl-module-exporter-heavy \
perl-module-getopt-long \
perl-module-overload \
perl-module-strict \
"

View File

@@ -0,0 +1,20 @@
DESCRIPTION = "Whetstone benchmark is a synthetic benchmark for evaluating the performance of computers"
SUMMARY = "CPU benchmark to measure floating point performance"
LICENSE = "PD"
LIC_FILES_CHKSUM ="file://${WORKDIR}/whetstone.c;beginline=1;endline=52;md5=c795edc15e7e1d92ca8f88ad718449f5"
SRC_URI = "http://www.netlib.org/benchmark/whetstone.c"
SRC_URI[md5sum] = "d8eb2cd7104bb5a12d614ac6d3f1f9fb"
SRC_URI[sha256sum] = "333e4ceca042c146f63eec605573d16ae8b07166cbc44a17bec1ea97c6f1efbf"
S = "${WORKDIR}"
do_compile () {
${CC} ${CFLAGS} ${LDFLAGS} -Ofast -o whetstone whetstone.c -lm
}
do_install () {
install -Dm 0755 whetstone ${D}${bindir}/whetstone
}