Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
From 02a538c2b4b54b41d23dbd7668714ea4d2016131 Mon Sep 17 00:00:00 2001
|
||||
From: Markus Mayer <mmayer@broadcom.com>
|
||||
Date: Thu, 13 Jun 2019 12:27:04 -0700
|
||||
Subject: [PATCH] scripts/build: use /bin/bash as shell
|
||||
|
||||
scripts/build makes use of the "+=" operator which is not supported by
|
||||
/bin/sh. We switch to /bin/bash in order to avoid errors of the form
|
||||
|
||||
../scripts/build: 21: ../scripts/build: LDLIBS+= -lm: not found
|
||||
|
||||
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
|
||||
---
|
||||
scripts/build | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/build b/scripts/build
|
||||
index 34a1371d0056..60b755cd2320 100755
|
||||
--- a/scripts/build
|
||||
+++ b/scripts/build
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/sh
|
||||
+#!/bin/bash
|
||||
|
||||
CC=${CC-`../scripts/compiler`}
|
||||
MAKE=${MAKE-`../scripts/make`}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
From c158a02561c64d0cd236f86db24cc20d0378eb72 Mon Sep 17 00:00:00 2001
|
||||
From: Markus Mayer <mmayer@broadcom.com>
|
||||
Date: Thu, 13 Jun 2019 12:28:54 -0700
|
||||
Subject: [PATCH] src/Makefile: add lmbench to list of executables
|
||||
|
||||
We want to install the lmbench script along with the other executables,
|
||||
so we add it to the appropriate list.
|
||||
|
||||
Signed-off-by: Markus Mayer <mmayer@broadcom.com>
|
||||
---
|
||||
src/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 4962815b5fe7..70dbc6794898 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -98,7 +98,7 @@ EXES = $O/bw_file_rd $O/bw_mem $O/bw_mmap_rd $O/bw_pipe $O/bw_tcp \
|
||||
$O/lat_select $O/lat_pipe $O/lat_rpc $O/lat_syscall $O/lat_tcp \
|
||||
$O/lat_udp $O/lat_mmap $O/mhz $O/lat_proc $O/lat_pagefault \
|
||||
$O/lat_connect $O/lat_fs $O/lat_sig $O/lat_mem_rd $O/lat_ctx \
|
||||
- $O/lat_sem \
|
||||
+ $O/lat_sem $O/lmbench \
|
||||
$O/memsize $O/lat_unix $O/lmdd $O/timing_o $O/enough \
|
||||
$O/msleep $O/loop_o $O/lat_fifo $O/lmhttp $O/lat_http \
|
||||
$O/lat_fcntl $O/disk $O/lat_unix_connect $O/flushdisk \
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From d85b61666aa2728f68b69d02bfb162c432df709f Mon Sep 17 00:00:00 2001
|
||||
From: vgupta <vgupta@4eed8e25-bc12-0410-818a-f70ee6866280>
|
||||
Date: Sat, 3 Mar 2012 10:02:24 +0000
|
||||
Subject: [PATCH] TOO_LONG 100 usec to prevent memsize from timing out @80Mhz
|
||||
|
||||
git-svn-id: http://sjvm-subversion02.internal.synopsys.com/svn/OSS/ARC_Linux/tests/lmbench-3.0-a9@157318 4eed8e25-bc12-0410-818a-f70ee6866280
|
||||
|
||||
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
|
||||
---
|
||||
src/memsize.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/memsize.c b/src/memsize.c
|
||||
index eb25a0924872..b333cf8cbd32 100644
|
||||
--- a/src/memsize.c
|
||||
+++ b/src/memsize.c
|
||||
@@ -15,7 +15,7 @@ char *id = "$Id$\n";
|
||||
#define CHK(x) if ((x) == -1) { perror("x"); exit(1); }
|
||||
|
||||
#ifndef TOO_LONG
|
||||
-#define TOO_LONG 10 /* usecs */
|
||||
+#define TOO_LONG 100 /* usecs */
|
||||
#endif
|
||||
|
||||
int alarm_triggered = 0;
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
From 3830453a06269912d2772fe8c31bae44f27bb131 Mon Sep 17 00:00:00 2001
|
||||
From: Vineet Gupta <vgupta@synopsys.com>
|
||||
Date: Fri, 8 May 2015 11:35:58 +0530
|
||||
Subject: [PATCH] Fix garbage pointer for lat_rpc -S localhost
|
||||
|
||||
Upstream: https://github.com/intel/lmbench/pull/45
|
||||
|
||||
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
|
||||
---
|
||||
src/lat_rpc.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/lat_rpc.c b/src/lat_rpc.c
|
||||
index 9c021926d761..ff4380ff38f3 100644
|
||||
--- a/src/lat_rpc.c
|
||||
+++ b/src/lat_rpc.c
|
||||
@@ -101,6 +101,7 @@ main(int ac, char **av)
|
||||
char *usage = "-s\n OR [-p <tcp|udp>] [-P parallel] [-W <warmup>] [-N <repetitions>] serverhost\n OR -S serverhost\n";
|
||||
|
||||
state.msize = 1;
|
||||
+ state.server = NULL;
|
||||
|
||||
while (( c = getopt(ac, av, "sS:m:p:P:W:N:")) != EOF) {
|
||||
switch(c) {
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 2c7ff6989bc6161d8a2cc823d3aa7c9cb1deca80 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Date: Wed, 4 Dec 2024 22:59:31 +0100
|
||||
Subject: [PATCH] scripts/build: make it possible to set LDLIBS
|
||||
|
||||
LDLIBS is currently unconditionnally set to '-lm', but doesn't allow
|
||||
the user to provide additional libraries to link with.
|
||||
|
||||
Upstream: https://github.com/intel/lmbench/pull/44
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
scripts/build | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/scripts/build b/scripts/build
|
||||
index 60b755c..4820d80 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
|
||||
--
|
||||
2.47.0
|
||||
|
||||
131
package/lmbench/0006-Add-signum-param-to-signal-handlers.patch
Normal file
131
package/lmbench/0006-Add-signum-param-to-signal-handlers.patch
Normal file
@@ -0,0 +1,131 @@
|
||||
From ed4f31bb09bc6355b2b642a89a1f1017de46f26e Mon Sep 17 00:00:00 2001
|
||||
From: Charlie Jenkins <charlie@rivosinc.com>
|
||||
Date: Fri, 4 Apr 2025 15:35:08 -0700
|
||||
Subject: [PATCH] Add signum param to signal handlers
|
||||
|
||||
A signal handler is required to have a signum parameter that is an
|
||||
integer.
|
||||
|
||||
Upstream: https://github.com/intel/lmbench/pull/43
|
||||
|
||||
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
|
||||
---
|
||||
src/lat_udp.c | 4 ++--
|
||||
src/lmdd.c | 14 +++++++-------
|
||||
src/lmhttp.c | 4 ++--
|
||||
3 files changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/lat_udp.c b/src/lat_udp.c
|
||||
index cdd2e9b..4b4441b 100644
|
||||
--- a/src/lat_udp.c
|
||||
+++ b/src/lat_udp.c
|
||||
@@ -19,7 +19,7 @@ char *id = "$Id$\n";
|
||||
|
||||
void client_main(int ac, char **av);
|
||||
void server_main();
|
||||
-void timeout();
|
||||
+void timeout(int signum);
|
||||
void init(iter_t iterations, void* cookie);
|
||||
void cleanup(iter_t iterations, void* cookie);
|
||||
void doit(iter_t iterations, void* cookie);
|
||||
@@ -164,7 +164,7 @@ cleanup(iter_t iterations, void* cookie)
|
||||
}
|
||||
|
||||
void
|
||||
-timeout()
|
||||
+timeout(int signum)
|
||||
{
|
||||
fprintf(stderr, "Recv timed out\n");
|
||||
exit(1);
|
||||
diff --git a/src/lmdd.c b/src/lmdd.c
|
||||
index dee37b4..529ae21 100644
|
||||
--- a/src/lmdd.c
|
||||
+++ b/src/lmdd.c
|
||||
@@ -148,7 +148,7 @@ char *cmds[] = {
|
||||
|
||||
|
||||
void error(char *);
|
||||
-void done();
|
||||
+void done(int signum);
|
||||
#ifdef DBG
|
||||
extern int dbg;
|
||||
#endif
|
||||
@@ -332,7 +332,7 @@ main(int ac, char **av)
|
||||
register int moved;
|
||||
|
||||
if (gotcnt && count-- <= 0) {
|
||||
- done();
|
||||
+ done(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -445,7 +445,7 @@ main(int ac, char **av)
|
||||
perror("read");
|
||||
}
|
||||
if (moved <= 0) {
|
||||
- done();
|
||||
+ done(0);
|
||||
}
|
||||
if (inpat != -1) {
|
||||
register int foo, cnt;
|
||||
@@ -458,7 +458,7 @@ main(int ac, char **av)
|
||||
(uint)(off + foo*sizeof(int)),
|
||||
buf[foo]);
|
||||
if (mismatch != -1 && --misses == 0) {
|
||||
- done();
|
||||
+ done(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -523,7 +523,7 @@ main(int ac, char **av)
|
||||
if (moved2 != moved) {
|
||||
fprintf(stderr, "write: wanted=%d got=%d\n",
|
||||
moved, moved2);
|
||||
- done();
|
||||
+ done(0);
|
||||
}
|
||||
if ((Wtmax != -1) || (Wtmin != -1)) {
|
||||
int mics = stop(&start_tv, &stop_tv);
|
||||
@@ -560,7 +560,7 @@ main(int ac, char **av)
|
||||
perror("write");
|
||||
}
|
||||
if (moved2 != moved) {
|
||||
- done();
|
||||
+ done(0);
|
||||
}
|
||||
|
||||
if (touch) {
|
||||
@@ -626,7 +626,7 @@ chkarg(char *arg)
|
||||
}
|
||||
|
||||
void
|
||||
-done(void)
|
||||
+done(int signum)
|
||||
{
|
||||
int i;
|
||||
int step;
|
||||
diff --git a/src/lmhttp.c b/src/lmhttp.c
|
||||
index 41d9949..9b5d665 100644
|
||||
--- a/src/lmhttp.c
|
||||
+++ b/src/lmhttp.c
|
||||
@@ -26,7 +26,7 @@ char *buf;
|
||||
char *bufs[3];
|
||||
int Dflg, dflg, nflg, lflg, fflg, zflg;
|
||||
int data, logfile;
|
||||
-void die();
|
||||
+void die(int signum);
|
||||
void worker();
|
||||
char *http_time(void);
|
||||
char *date(time_t *tt);
|
||||
@@ -387,7 +387,7 @@ logit(int sock, char *name, int size)
|
||||
nbytes += len;
|
||||
}
|
||||
|
||||
-void die()
|
||||
+void die(int signum)
|
||||
{
|
||||
if (nbytes) {
|
||||
write(logfile, logbuf, nbytes);
|
||||
--
|
||||
2.43.0
|
||||
|
||||
177
package/lmbench/0007-scripts-build-int-return-type-main.patch
Normal file
177
package/lmbench/0007-scripts-build-int-return-type-main.patch
Normal file
@@ -0,0 +1,177 @@
|
||||
From 3340c9552cc6e7d77adf39becbc6be52233d80c0 Mon Sep 17 00:00:00 2001
|
||||
From: Charlie Jenkins <charlie@rivosinc.com>
|
||||
Date: Thu, 10 Apr 2025 13:25:07 -0700
|
||||
Subject: [PATCH] scripts/build: int return type main()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Some compilers (such as the bootlin riscv64-lp64d glibc bleeding-edge
|
||||
2024.05-1 toolchain) fail to run the dependency checking scripts and
|
||||
error at "return type defaults to ‘int’ [-Wimplicit-int]". Add types
|
||||
to these main() functions to allow this dependency tracking to work.
|
||||
|
||||
Upstream: https://github.com/intel/lmbench/pull/43
|
||||
|
||||
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
|
||||
---
|
||||
scripts/build | 42 +++++++++++++++++++++---------------------
|
||||
1 file changed, 21 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/scripts/build b/scripts/build
|
||||
index b2c4274..7f28c82 100755
|
||||
--- a/scripts/build
|
||||
+++ b/scripts/build
|
||||
@@ -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 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 1>${NULL} 2>${NULL} \
|
||||
|| CFLAGS="${CFLAGS} -Dvalloc=malloc"
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -70,7 +70,7 @@ echo "#include <sys/resource.h>" >> ${BASE}$$.c
|
||||
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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DRUSAGE"
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -118,13 +118,13 @@ 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 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 1>${NULL} 2>${NULL} \
|
||||
|| CFLAGS="${CFLAGS} -DS_IFIFO=S_IFFIFO"
|
||||
fi
|
||||
@@ -133,7 +133,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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DHAVE_uint=1";
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -143,7 +143,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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DHAVE_uint64=1" && HAVE_uint64=1;
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -152,7 +152,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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DHAVE_uint64_t=1";
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -163,7 +163,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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DHAVE_int64=1" && HAVE_int64=1;
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -172,7 +172,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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DHAVE_int64_t=1";
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -181,7 +181,7 @@ fi
|
||||
# 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 1>${NULL} 2>${NULL}; then
|
||||
CFLAGS="${CFLAGS} -DHAVE_DRAND48"
|
||||
HAVE_RANDOM=1
|
||||
@@ -190,7 +190,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 1>${NULL} 2>${NULL}; then
|
||||
CFLAGS="${CFLAGS} -DHAVE_RAND"
|
||||
HAVE_RANDOM=1
|
||||
@@ -200,7 +200,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 1>${NULL} 2>${NULL}; then
|
||||
CFLAGS="${CFLAGS} -DHAVE_RANDOM"
|
||||
HAVE_RANDOM=1
|
||||
@@ -211,7 +211,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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DHAVE_SYSMP=1";
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -221,7 +221,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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DHAVE_BINDPROCESSOR=1";
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -231,7 +231,7 @@ 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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DHAVE_BINDPROCESSOR=1";
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
@@ -240,7 +240,7 @@ rm -f ${BASE}$$ ${BASE}$$.o ${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 1>${NULL} 2>${NULL} \
|
||||
&& CFLAGS="${CFLAGS} -DHAVE_SCHED_SETAFFINITY=1";
|
||||
rm -f ${BASE}$$ ${BASE}$$.o ${BASE}$$.c
|
||||
--
|
||||
2.43.0
|
||||
|
||||
117
package/lmbench/0008-Fixup-function-declarations.patch
Normal file
117
package/lmbench/0008-Fixup-function-declarations.patch
Normal file
@@ -0,0 +1,117 @@
|
||||
From 6255495abf4ea516aad3b447cc32d1b244229878 Mon Sep 17 00:00:00 2001
|
||||
From: Charlie Jenkins <charlie@rivosinc.com>
|
||||
Date: Fri, 4 Apr 2025 15:48:07 -0700
|
||||
Subject: [PATCH] Fixup function declarations
|
||||
|
||||
GCC-15 requires function declarations to be properly typed.
|
||||
|
||||
Upstream: https://github.com/intel/lmbench/pull/43
|
||||
|
||||
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
|
||||
---
|
||||
src/bench.h | 4 ++--
|
||||
src/lat_rpc.c | 18 +++++++-----------
|
||||
src/lmdd.c | 4 ++--
|
||||
3 files changed, 11 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/bench.h b/src/bench.h
|
||||
index 597d068..b1624c5 100644
|
||||
--- a/src/bench.h
|
||||
+++ b/src/bench.h
|
||||
@@ -325,8 +325,8 @@ extern int handle_scheduler(int childno, int benchproc, int nbenchprocs);
|
||||
#define XACT_VERS ((u_long)1)
|
||||
#define RPC_XACT ((u_long)1)
|
||||
#define RPC_EXIT ((u_long)2)
|
||||
-extern char *rpc_xact_1();
|
||||
-extern char *client_rpc_xact_1();
|
||||
+extern char *rpc_xact_1(char *msg, register SVCXPRT *transp);
|
||||
+extern char *client_rpc_xact_1(char *argp, CLIENT *clnt);
|
||||
|
||||
void lmbench_usage(int argc, char *argv[], char* usage);
|
||||
|
||||
diff --git a/src/lat_rpc.c b/src/lat_rpc.c
|
||||
index ff4380f..dcc24df 100644
|
||||
--- a/src/lat_rpc.c
|
||||
+++ b/src/lat_rpc.c
|
||||
@@ -187,16 +187,14 @@ client_rpc_xact_1(char *argp, CLIENT *clnt)
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
char *
|
||||
-rpc_xact_1(msg, transp)
|
||||
- char *msg;
|
||||
- register SVCXPRT *transp;
|
||||
+rpc_xact_1(char *msg, register SVCXPRT *transp)
|
||||
{
|
||||
static char r = 123;
|
||||
|
||||
return &r;
|
||||
}
|
||||
|
||||
-static void xact_prog_1();
|
||||
+static void xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp);
|
||||
|
||||
void
|
||||
server_main()
|
||||
@@ -234,16 +232,14 @@ server_main()
|
||||
}
|
||||
|
||||
static void
|
||||
-xact_prog_1(rqstp, transp)
|
||||
- struct svc_req *rqstp;
|
||||
- register SVCXPRT *transp;
|
||||
+xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp)
|
||||
{
|
||||
union {
|
||||
char rpc_xact_1_arg;
|
||||
} argument;
|
||||
char *result;
|
||||
- bool_t (*xdr_argument)(), (*xdr_result)();
|
||||
- char *(*local)();
|
||||
+ bool_t (*xdr_argument)(XDR *, char *), (*xdr_result)(XDR *, char *);
|
||||
+ char *(*local)(char *, struct svc_req *);
|
||||
|
||||
switch (rqstp->rq_proc) {
|
||||
case NULLPROC:
|
||||
@@ -253,7 +249,7 @@ xact_prog_1(rqstp, transp)
|
||||
case RPC_XACT:
|
||||
xdr_argument = xdr_char;
|
||||
xdr_result = xdr_char;
|
||||
- local = (char *(*)()) rpc_xact_1;
|
||||
+ local = (char *(*)(char *, struct svc_req *)) rpc_xact_1;
|
||||
break;
|
||||
|
||||
case RPC_EXIT:
|
||||
@@ -270,7 +266,7 @@ xact_prog_1(rqstp, transp)
|
||||
svcerr_decode(transp);
|
||||
return;
|
||||
}
|
||||
- result = (*local)(&argument, rqstp);
|
||||
+ result = (*local)((char *)&argument, rqstp);
|
||||
if (result != NULL && !svc_sendreply(transp, (xdrproc_t)xdr_result, result)) {
|
||||
svcerr_systemerr(transp);
|
||||
}
|
||||
diff --git a/src/lmdd.c b/src/lmdd.c
|
||||
index 529ae21..197ac46 100644
|
||||
--- a/src/lmdd.c
|
||||
+++ b/src/lmdd.c
|
||||
@@ -76,7 +76,7 @@ int norepeats = -1;
|
||||
bds_msg *m1, *m2;
|
||||
#endif
|
||||
|
||||
-uint64 getarg();
|
||||
+uint64 getarg(char *s, int ac, char **av);
|
||||
int been_there(uint64 off);
|
||||
int getfile(char *s, int ac, char **av);
|
||||
|
||||
@@ -162,7 +162,7 @@ main(int ac, char **av)
|
||||
int Fork, misses, mismatch, outpat, inpat, in, timeopen, gotcnt;
|
||||
int slp;
|
||||
uint64 skip, size, count;
|
||||
- void chkarg();
|
||||
+ void chkarg(char *arg);
|
||||
int i;
|
||||
uint64 off = 0;
|
||||
int touch;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
49
package/lmbench/0009-src-lat_sig.c-fix-build.patch
Normal file
49
package/lmbench/0009-src-lat_sig.c-fix-build.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 868256b43ee7ab597319982645ca1e5e00502224 Mon Sep 17 00:00:00 2001
|
||||
From: Bernd Kuhls <bernd@kuhls.net>
|
||||
Date: Fri, 5 Dec 2025 17:59:00 +0100
|
||||
Subject: [PATCH] src/lat_sig.c: fix build
|
||||
|
||||
lat_sig.c:42:31: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
|
||||
42 | sa.sa_handler = handler;
|
||||
| ^
|
||||
lat_sig.c:23:9: note: 'handler' declared here
|
||||
23 | void handler() { }
|
||||
|
||||
lat_sig.c:95:23: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
|
||||
95 | sa.sa_handler = prot;
|
||||
| ^
|
||||
lat_sig.c:72:1: note: 'prot' declared here
|
||||
72 | prot() {
|
||||
|
||||
Upstream: https://github.com/intel/lmbench/pull/43
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
---
|
||||
src/lat_sig.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/lat_sig.c b/src/lat_sig.c
|
||||
index 46aef0e..5913c48 100644
|
||||
--- a/src/lat_sig.c
|
||||
+++ b/src/lat_sig.c
|
||||
@@ -20,7 +20,7 @@ char *id = "$Id$\n";
|
||||
|
||||
uint64 caught, n;
|
||||
double adj;
|
||||
-void handler() { }
|
||||
+void handler(int) { }
|
||||
jmp_buf prot_env;
|
||||
|
||||
void
|
||||
@@ -69,7 +69,7 @@ struct _state {
|
||||
};
|
||||
|
||||
void
|
||||
-prot() {
|
||||
+prot(int) {
|
||||
if (++caught == n) {
|
||||
caught = 0;
|
||||
n = benchmp_interval(benchmp_getstate());
|
||||
--
|
||||
2.47.3
|
||||
|
||||
34
package/lmbench/0010-src-memsize.c-fix-build.patch
Normal file
34
package/lmbench/0010-src-memsize.c-fix-build.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From 7dad44effa3e3456bede6c5c2325bfdf4dec94d3 Mon Sep 17 00:00:00 2001
|
||||
From: Bernd Kuhls <bernd@kuhls.net>
|
||||
Date: Fri, 5 Dec 2025 18:01:15 +0100
|
||||
Subject: [PATCH] src/memsize.c: fix build
|
||||
|
||||
memsize.c:167:23: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
|
||||
167 | sa.sa_handler = gotalarm;
|
||||
| ^
|
||||
memsize.c:154:1: note: 'gotalarm' declared here
|
||||
154 | gotalarm()
|
||||
|
||||
Upstream: https://github.com/intel/lmbench/pull/43
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
---
|
||||
src/memsize.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/memsize.c b/src/memsize.c
|
||||
index e1d05be..902132a 100644
|
||||
--- a/src/memsize.c
|
||||
+++ b/src/memsize.c
|
||||
@@ -151,7 +151,7 @@ test_malloc(size_t size)
|
||||
}
|
||||
|
||||
void
|
||||
-gotalarm()
|
||||
+gotalarm(int)
|
||||
{
|
||||
alarm_triggered = 1;
|
||||
}
|
||||
--
|
||||
2.47.3
|
||||
|
||||
34
package/lmbench/0011-src-lat_unix.c-fix-build.patch
Normal file
34
package/lmbench/0011-src-lat_unix.c-fix-build.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From 88bb985d400ccaddf1a61fba1aa0602c3506a047 Mon Sep 17 00:00:00 2001
|
||||
From: Bernd Kuhls <bernd@kuhls.net>
|
||||
Date: Fri, 5 Dec 2025 18:02:10 +0100
|
||||
Subject: [PATCH] src/lat_unix.c: fix build
|
||||
|
||||
lat_unix.c:85:17: error: too many arguments to function 'exit'; expected 0, have 1
|
||||
85 | exit(1);
|
||||
| ^~~~ ~
|
||||
lat_unix.c:74:17: note: declared here
|
||||
74 | void exit();
|
||||
|
||||
Upstream: https://github.com/intel/lmbench/pull/43
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
---
|
||||
src/lat_unix.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/lat_unix.c b/src/lat_unix.c
|
||||
index 1e321f8..9a062c1 100644
|
||||
--- a/src/lat_unix.c
|
||||
+++ b/src/lat_unix.c
|
||||
@@ -71,7 +71,7 @@ void
|
||||
initialize(iter_t iterations, void* cookie)
|
||||
{
|
||||
struct _state* pState = (struct _state*)cookie;
|
||||
- void exit();
|
||||
+ void exit(int);
|
||||
|
||||
if (iterations) return;
|
||||
|
||||
--
|
||||
2.47.3
|
||||
|
||||
34
package/lmbench/0012-src-lat_usleep.c-fix-build.patch
Normal file
34
package/lmbench/0012-src-lat_usleep.c-fix-build.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From 3a57a2d54631df15d876147cf738d4ea033645a8 Mon Sep 17 00:00:00 2001
|
||||
From: Bernd Kuhls <bernd@kuhls.net>
|
||||
Date: Fri, 5 Dec 2025 18:04:07 +0100
|
||||
Subject: [PATCH] src/lat_usleep.c: fix build
|
||||
|
||||
lat_usleep.c:125:19: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
|
||||
125 | sa.sa_handler = interval;
|
||||
| ^
|
||||
lat_usleep.c:102:1: note: 'interval' declared here
|
||||
102 | interval()
|
||||
|
||||
Upstream: https://github.com/intel/lmbench/pull/43
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
---
|
||||
src/lat_usleep.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/lat_usleep.c b/src/lat_usleep.c
|
||||
index d18d0c8..842ad06 100755
|
||||
--- a/src/lat_usleep.c
|
||||
+++ b/src/lat_usleep.c
|
||||
@@ -99,7 +99,7 @@ bench_pselect(iter_t iterations, void *cookie)
|
||||
#endif /* _POSIX_SELECT */
|
||||
|
||||
void
|
||||
-interval()
|
||||
+interval(int)
|
||||
{
|
||||
if (++caught == n) {
|
||||
caught = 0;
|
||||
--
|
||||
2.47.3
|
||||
|
||||
14
package/lmbench/Config.in
Normal file
14
package/lmbench/Config.in
Normal file
@@ -0,0 +1,14 @@
|
||||
config BR2_PACKAGE_LMBENCH
|
||||
bool "lmbench"
|
||||
depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC || BR2_TOOLCHAIN_HAS_THREADS # libtirpc
|
||||
depends on BR2_USE_MMU # fork()
|
||||
select BR2_PACKAGE_LIBTIRPC if !BR2_TOOLCHAIN_HAS_NATIVE_RPC
|
||||
help
|
||||
LMbench is a suite of simple, portable,
|
||||
ANSI/C microbenchmarks for UNIX/POSIX.
|
||||
|
||||
https://github.com/intel/lmbench
|
||||
|
||||
comment "lmbench needs a toolchain w/ threads"
|
||||
depends on BR2_USE_MMU
|
||||
depends on !(BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_HAS_NATIVE_RPC)
|
||||
4
package/lmbench/lmbench.hash
Normal file
4
package/lmbench/lmbench.hash
Normal file
@@ -0,0 +1,4 @@
|
||||
# Locally computed:
|
||||
sha256 920ab1fee83d7a33d41e040c067dfec2ed2362a5c32e09e509c7a6501c33b7b4 lmbench-8b3ddfa52ee4a886abe5af4550f404142966eb88.tar.gz
|
||||
sha256 91df39d1816bfb17a4dda2d3d2c83b1f6f2d38d53e53e41e8f97ad5ac46a0cad COPYING
|
||||
sha256 3be7a155efa448db90071a95fbf81796f8f90edf9204f0463cfd23402dc90a72 COPYING-2
|
||||
44
package/lmbench/lmbench.mk
Normal file
44
package/lmbench/lmbench.mk
Normal file
@@ -0,0 +1,44 @@
|
||||
################################################################################
|
||||
#
|
||||
# lmbench
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LMBENCH_VERSION = 8b3ddfa52ee4a886abe5af4550f404142966eb88
|
||||
LMBENCH_SITE = $(call github,intel,lmbench,$(LMBENCH_VERSION))
|
||||
LMBENCH_LICENSE = lmbench license (based on GPL-2.0)
|
||||
LMBENCH_LICENSE_FILES = COPYING COPYING-2
|
||||
|
||||
LMBENCH_CFLAGS = $(TARGET_CFLAGS)
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBTIRPC),y)
|
||||
LMBENCH_DEPENDENCIES += host-pkgconf libtirpc
|
||||
LMBENCH_CFLAGS += `$(PKG_CONFIG_HOST_BINARY) --cflags libtirpc`
|
||||
LMBENCH_LDLIBS = `$(PKG_CONFIG_HOST_BINARY) --libs libtirpc`
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_101915),y)
|
||||
LMBENCH_CFLAGS += -O0
|
||||
endif
|
||||
|
||||
LMBENCH_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
|
||||
|
||||
define LMBENCH_CONFIGURE_CMDS
|
||||
sed -i 's/CFLAGS=/CFLAGS+=/g' $(@D)/src/Makefile
|
||||
sed -i '/cd .*doc/d' $(@D)/src/Makefile
|
||||
sed -i '/include/d' $(@D)/src/Makefile
|
||||
touch $@
|
||||
endef
|
||||
|
||||
# Note: there is a second stage 'make' invocation from the 'scripts/build'
|
||||
# script. So the variables override below don't take direct effect in
|
||||
# src/Makefile.
|
||||
define LMBENCH_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) CFLAGS="$(LMBENCH_CFLAGS)" LDLIBS="$(LMBENCH_LDLIBS)" OS=$(ARCH) CC="$(TARGET_CC)" -C $(@D)/src
|
||||
endef
|
||||
|
||||
define LMBENCH_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) CFLAGS="$(TARGET_CFLAGS)" OS=$(ARCH) CC="$(TARGET_CC)" BASE=$(TARGET_DIR)/usr -C $(@D)/src install
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user