diff mbox series

[wrynose,1/2] tiobench: update to latest upstream version

Message ID 20261117114902.577356-2-vaibjind@qti.qualcomm.com
State New
Headers show
Series tiobench: backport update to 0.4.2+git to wrynose | expand

Commit Message

Vaibhav Jindal Nov. 17, 2026, 11:49 a.m. UTC
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).

Signed-off-by: Vaibhav Jindal <vaibjind@qti.qualcomm.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
(cherry picked from commit dadc43246de3ceff7cae38d3caa09ffd032d94ff)
Signed-off-by: Vaibhav Jindal <vaibjind@qti.qualcomm.com>
---
 ...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
diff mbox series

Patch

diff --git a/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Drop-inline-of-crc32-function-to-fix-build-using-GCC.patch b/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Drop-inline-of-crc32-function-to-fix-build-using-GCC.patch
deleted file mode 100644
index 5aebb956c1..0000000000
--- a/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Drop-inline-of-crc32-function-to-fix-build-using-GCC.patch
+++ /dev/null
@@ -1,30 +0,0 @@ 
-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
-
diff --git a/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Specify-printf-formats.patch b/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Specify-printf-formats.patch
deleted file mode 100644
index cfd34f02a0..0000000000
--- a/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/0001-Specify-printf-formats.patch
+++ /dev/null
@@ -1,49 +0,0 @@ 
-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
-
diff --git a/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/avoid-glibc-clashes.patch b/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/avoid-glibc-clashes.patch
deleted file mode 100644
index 321d299837..0000000000
--- a/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/avoid-glibc-clashes.patch
+++ /dev/null
@@ -1,57 +0,0 @@ 
-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
-
diff --git a/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/tiobench-makefile.patch b/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/tiobench-makefile.patch
deleted file mode 100644
index f820c7e337..0000000000
--- a/meta-oe/recipes-benchmark/tiobench/tiobench-0.3.3/tiobench-makefile.patch
+++ /dev/null
@@ -1,49 +0,0 @@ 
-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
diff --git a/meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb b/meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb
deleted file mode 100644
index 98914836ed..0000000000
--- a/meta-oe/recipes-benchmark/tiobench/tiobench_0.3.3.bb
+++ /dev/null
@@ -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 \
-"
diff --git a/meta-oe/recipes-benchmark/tiobench/tiobench_0.4.2+git.bb b/meta-oe/recipes-benchmark/tiobench/tiobench_0.4.2+git.bb
new file mode 100644
index 0000000000..b42982686c
--- /dev/null
+++ b/meta-oe/recipes-benchmark/tiobench/tiobench_0.4.2+git.bb
@@ -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 \
+"