Skip to contentSkip to conversation

tiobench: backport update to 0.4.2+git to wrynose

PATCH New Vaibhav Jindal 1 participant 3 messages Nov 17

lore
Share & tools
lore
#0 lore raw

cover tiobench: backport update to 0.4.2+git to wrynose

Backport request for the tiobench update from master.
- 0.3.3 fails on random I/O unless a sequential test ran first. It prints "No such file or directory" and produces no results.
- 0.4.2+git was validated on the same target (IQ-9075 EVK) with correct output.
- Upstream fixed read-past-EOF (654eea7) and mmap/consistency checking (9c6be14) after 0.3.3.
- The update drops 4 downstream patches.
- It is a single leaf recipe with no dependency changes, so the blast radius is small.
- The second patch is the musl fix that follows the update on master.
- Build and runtime tested on wrynose (IQ-9075 EVK).

Khem Raj (1):
tiobench: Allow large file support with musl

Vaibhav Jindal (1):
tiobench: update to latest upstream version

 ...rc32-function-to-fix-build-using-GCC.patch | 30 -------
 .../0001-Specify-printf-formats.patch         | 49 ----------
 .../tiobench-0.3.3/avoid-glibc-clashes.patch  | 57 ------------
 .../tiobench-0.3.3/tiobench-makefile.patch    | 49 ----------
 ...1-Allow-large-file-support-with-musl.patch | 90 +++++++++++++++++++
 .../tiobench/tiobench_0.3.3.bb                | 28 ------
 .../tiobench/tiobench_0.4.2+git.bb            | 25 ++++++
 7 files changed, 115 insertions(+), 213 deletions(-)
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Drop-inline-of-crc32-function-to-fix-build-using-GCC.patch
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Specify-printf-formats.patch
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/avoid-glibc-clashes.patch
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/tiobench-makefile.patch
 create mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench/0001-Allow-large-file-support-with-musl.patch
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb
 create mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench_0.4.2+git.bb
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 tiobench: update to latest upstream version

Update tiobench from the legacy 0.3.3 SourceForge release to the actively maintained upstream at github.com/mkuoppal/tiobench, pinned to 11c965c8 (35 commits past v0.4.2). Picks up Clang build support, random I/O test enhancements and cache handling updates.

Remove obsolete downstream patches, now fixed upstream:

avoid-glibc-clashes.patch - helper renamed to tt_aligned_alloc
0001-Specify-printf-formats.patch - format specifiers fixed 0001-Drop-inline-of-crc32-*.patch - crc32 inlining fixed
tiobench-makefile.patch - CC?= and LDFLAGS now upstream

Pass CFLAGS via EXTRA_OEMAKE. The upstream Makefile hardcodes CFLAGS=-O2 -Wall and oe_runmake does not pass -e, so OE flags never reached the compiler, losing -g (empty -dbg package), the hardening flags, -ffile-prefix-map and the tune flags. DEFINES is separate, so -DUSE_LARGEFILES is unaffected.

Install from do_install() rather than the upstream install target, which has no DESTDIR support and installs tiosum.pl and README, both long gone from the tree. COPYING is dropped from docdir as licenses are handled by the license manifest.

Trim RDEPENDS to perl and perl-module-getopt-long; tiobench.pl only uses warnings, strict and Getopt::Long, and strict is RPROVIDED by perl. Data::Dumper and Term::ProgressBar are only reachable via the opt-in --dump and --progress flags. Drop the redundant PV, already set by the recipe filename.

Runtime validated on IQ-9075 EVK with tiotest and tiobench.pl across multiple benchmark configurations, including tiobench.pl --help on an image carrying only the trimmed RDEPENDS.

Build tested with gcc against glibc on aarch64 (armv8-2a).

(cherry picked from commit dadc43246de3ceff7cae38d3caa09ffd032d94ff)
---
 ...rc32-function-to-fix-build-using-GCC.patch | 30 ----------
 .../0001-Specify-printf-formats.patch         | 49 ----------------
 .../tiobench-0.3.3/avoid-glibc-clashes.patch  | 57 -------------------
 .../tiobench-0.3.3/tiobench-makefile.patch    | 49 ----------------
 .../tiobench/tiobench_0.3.3.bb                | 28 ---------
 .../tiobench/tiobench_0.4.2+git.bb            | 23 ++++++++
 6 files changed, 23 insertions(+), 213 deletions(-)
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Drop-inline-of-crc32-function-to-fix-build-using-GCC.patch
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Specify-printf-formats.patch
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/avoid-glibc-clashes.patch
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/tiobench-makefile.patch
 delete mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb
 create mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench_0.4.2+git.bb
meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Drop-inline-of-crc32-function-to-fix-build-using-GCC.patch deleted +0 -30
deleted file mode 100644
index 5aebb956c1..0000000000
@@ -1,30 +0,0 @@
-From 5429ab90eb33eb243fa7b9cd247e0490d72b9da5 Mon Sep 17 00:00:00 2001
-From: Otavio Salvador <[email protected]>
-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 <[email protected]>
----
- 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
-
meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Specify-printf-formats.patch deleted +0 -49

49 lines not on this page · raw message

meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/avoid-glibc-clashes.patch deleted +0 -57

57 lines not on this page · raw message

meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/tiobench-makefile.patch deleted +0 -49

49 lines not on this page · raw message

meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb deleted +0 -28
deleted file mode 100644
index 98914836ed..0000000000
@@ -1,28 +0,0 @@
-SUMMARY = "Threaded I/O tester"
-HOMEPAGE = "http://sourceforge.net/projects/tiobench/"
-LICENSE = "GPL-2.0-only"
-LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
-
-
-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[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 \
-"
meta-oe/recipes-benchmark/tiobench/tiobench_0.4.2+git.bb new file +23 -0
new file mode 100644
index 0000000000..b42982686c
@@ -0,0 +1,23 @@
+SUMMARY = "Threaded I/O tester"
+HOMEPAGE = "https://github.com/mkuoppal/tiobench"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
+
+SRC_URI = "git://github.com/mkuoppal/tiobench.git;protocol=https;branch=master"
+
+SRCREV = "11c965c8c0f37927423fb4ea590df6c093cf2f1e"
+
+EXTRA_OEMAKE = "PREFIX=${prefix} CFLAGS='${CFLAGS}'"
+
+do_install() {
+    install -Dm 0755 ${S}/tiotest ${D}${bindir}/tiotest
+    install -Dm 0755 ${S}/tiobench.pl ${D}${bindir}/tiobench.pl
+
+    install -d ${D}${docdir}/${BPN}
+    install -m 0644 ${S}/README.md ${S}/BUGS ${S}/ChangeLog ${S}/TODO ${D}${docdir}/${BPN}
+}
+
+RDEPENDS:${PN} += "\
+    perl \
+    perl-module-getopt-long \
+"
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/2 tiobench: Allow large file support with musl

In reply to Vaibhav Jindal

From: Khem Raj <[email protected]>

USE_LARGEFILES requires _LFS64_LARGEFILE, which musl does not define because its off_t is always 64-bit, so the build fails on musl:

./constants.h:36:2: error: no large file support available, remove -DLARGEFILES from makefile

Add a patch that only requires a 64-bit off_t in that case. It also replaces the %L length modifier on integer conversions with the standard %ll, which musl's printf requires.

AI-Generated: Uses Claude Code

(cherry picked from commit 4ef0b50bcd671b81396689dd8b554b6bf2908fb8)
---
 ...1-Allow-large-file-support-with-musl.patch | 90 +++++++++++++++++++
 .../tiobench/tiobench_0.4.2+git.bb            |  4 +-
 2 files changed, 93 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-benchmark/tiobench/tiobench/0001-Allow-large-file-support-with-musl.patch
meta-oe/recipes-benchmark/tiobench/tiobench/0001-Allow-large-file-support-with-musl.patch new file +90 -0
new file mode 100644
index 0000000000..632553c066
@@ -0,0 +1,90 @@
+From: Khem Raj <[email protected]>
+Date: Sun, 18 Oct 2026 19:00:00 -0700
+Subject: [PATCH] Allow large file support with musl
+
+USE_LARGEFILES requires the libc to define _LFS64_LARGEFILE and errors
+out otherwise. musl does not define it: its off_t is always 64-bit and
+lseek64(), mmap64() and friends are aliases of the plain interfaces.
+So the build fails on musl:
+
+  ./constants.h:36:2: error: no large file support available, remove -DLARGEFILES from makefile
+
+When _LFS64_LARGEFILE is missing, only require a 64-bit off_t.
+
+Also replace the %L length modifier on integer conversions with the
+standard %ll. %L is only defined for long double, and musl's printf
+rejects it with integer conversions.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ constants.h       | 9 +++++++--
+ test_largefiles.c | 6 +++---
+ tiotest.c         | 2 +-
+ 3 files changed, 11 insertions(+), 6 deletions(-)
+
+--- a/constants.h
++++ b/constants.h
+@@ -33,7 +33,12 @@
+ 
+ #ifdef USE_LARGEFILES
+ #ifndef _LFS64_LARGEFILE
+-#error no large file support available, remove -DLARGEFILES from makefile
++/*
++ * musl does not define _LFS64_LARGEFILE: its off_t is always 64-bit and
++ * the *64 interfaces are plain aliases, so only require a 64-bit off_t.
++ */
++_Static_assert(sizeof(off_t) >= 8,
++	"no large file support available, remove -DLARGEFILES from makefile");
+ #endif
+ #endif
+ 
+@@ -83,7 +88,7 @@
+ #define TIO_ftruncate  ftruncate64
+ #define TIO_pread      pread64
+ #define TIO_pwrite     pwrite64
+-#define OFFSET_FORMAT  "0x%Lx"
++#define OFFSET_FORMAT  "0x%llx"
+ #else
+ typedef off_t          TIO_off_t;
+ #define TIO_lseek      lseek
+--- a/tiotest.c
++++ b/tiotest.c
+@@ -1411,7 +1411,7 @@
+ 
+ 			if(crc != d->bufferCrc)
+ 			{
+-				fprintf(stderr, "Thread(%lu) consistency check failed at offset %Lu\n", d->myNumber, (long long unsigned int)offset);
++				fprintf(stderr, "Thread(%lu) consistency check failed at offset %llu\n", d->myNumber, (long long unsigned int)offset);
+ 				return -1;
+ 			}
+ 		}
+--- a/test_largefiles.c
++++ b/test_largefiles.c
+@@ -57,7 +57,7 @@
+         exit(1);
+     }
+ 
+-    printf( xstr(TIO_ftruncate) "()'ing large test file to size %Lx\n", LARGEFILE_SIZE);
++    printf( xstr(TIO_ftruncate) "()'ing large test file to size %llx\n", LARGEFILE_SIZE);
+     rc = TIO_ftruncate(fd, LARGEFILE_SIZE); /* pre-allocate space */
+     if(rc != 0) 
+     {
+@@ -67,7 +67,7 @@
+ 
+     for(offset = (TIO_off_t)0; offset + CHUNK_SIZE <= LARGEFILE_SIZE; offset += CHUNK_SIZE) {
+ 
+-        printf(xstr(TIO_lseek) "()ing to offset %Lx\n", offset);
++        printf(xstr(TIO_lseek) "()ing to offset %llx\n", offset);
+         offset_ret = TIO_lseek(fd, offset, SEEK_SET);
+         if (offset_ret != offset) {
+             perror("Error " xstr(TIO_lseek) "()ing");
+@@ -105,7 +105,7 @@
+         }
+         data = 0;
+ 
+-        printf(xstr(TIO_mmap) "()ing chunk of size %Lx at offset %Lx\n", CHUNK_SIZE, offset);
++        printf(xstr(TIO_mmap) "()ing chunk of size %llx at offset %llx\n", CHUNK_SIZE, offset);
+         file_loc = TIO_mmap((caddr_t )0, CHUNK_SIZE,
+                  PROT_READ | PROT_WRITE, MAP_SHARED, fd, (TIO_off_t)offset);
+         if (file_loc == MAP_FAILED) {
meta-oe/recipes-benchmark/tiobench/tiobench_0.4.2+git.bb +3 -1
index b42982686c..c773a8cc53 100644
@@ -3,7 +3,9 @@ HOMEPAGE = "https://github.com/mkuoppal/tiobench"
 LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
 
-SRC_URI = "git://github.com/mkuoppal/tiobench.git;protocol=https;branch=master"
+SRC_URI = "git://github.com/mkuoppal/tiobench.git;protocol=https;branch=master \
+           file://0001-Allow-large-file-support-with-musl.patch \
+           "
 
 SRCREV = "11c965c8c0f37927423fb4ea590df6c093cf2f1e"
 
Signature · 1 line
2.34.1