diff mbox series

[meta-oe,1/9] fio: Fix additional warnings seen with musl

Message ID 20220826061150.3030485-1-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,1/9] fio: Fix additional warnings seen with musl | expand

Commit Message

Khem Raj Aug. 26, 2022, 6:11 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...ring-Replace-pthread_self-with-s-tid.patch | 45 +++++++++++++++++++
 meta-oe/recipes-benchmark/fio/fio_3.31.bb     |  3 +-
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-benchmark/fio/fio/0001-io_uring-Replace-pthread_self-with-s-tid.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-benchmark/fio/fio/0001-io_uring-Replace-pthread_self-with-s-tid.patch b/meta-oe/recipes-benchmark/fio/fio/0001-io_uring-Replace-pthread_self-with-s-tid.patch
new file mode 100644
index 0000000000..766b1fe274
--- /dev/null
+++ b/meta-oe/recipes-benchmark/fio/fio/0001-io_uring-Replace-pthread_self-with-s-tid.patch
@@ -0,0 +1,45 @@ 
+From 269164337e0168b93661bb95c6a4e462ae6d8b61 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 24 Aug 2022 18:08:53 -0700
+Subject: [PATCH] io_uring: Replace pthread_self with s->tid
+
+__init_rand64 takes 64bit value and srand48 takes unsigned 32bit value,
+pthread_t is opaque type and some libcs ( e.g. musl ) do not define them
+in plain old data types and ends up with errors
+
+| t/io_uring.c:809:32: error: incompatible pointer to integer conversion passing 'pthread_t' (aka 'struct __pthread *') to parameter of type 'uint64_t' (aka 'unsigned long') [-Wint-conver
+sion]
+|         __init_rand64(&s->rand_state, pthread_self());
+|                                       ^~~~~~~~~~~~~~
+
+Upstream-Status: Submitted [https://github.com/axboe/fio/pull/1455]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ t/io_uring.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/t/io_uring.c b/t/io_uring.c
+index 35bf1956..f34a3554 100644
+--- a/t/io_uring.c
++++ b/t/io_uring.c
+@@ -799,15 +799,14 @@ static int submitter_init(struct submitter *s)
+ 	int i, nr_batch, err;
+ 	static int init_printed;
+ 	char buf[80];
+-
+ 	s->tid = gettid();
+ 	printf("submitter=%d, tid=%d, file=%s, node=%d\n", s->index, s->tid,
+ 							s->filename, s->numa_node);
+ 
+ 	set_affinity(s);
+ 
+-	__init_rand64(&s->rand_state, pthread_self());
+-	srand48(pthread_self());
++	__init_rand64(&s->rand_state, s->tid);
++	srand48(s->tid);
+ 
+ 	for (i = 0; i < MAX_FDS; i++)
+ 		s->files[i].fileno = i;
+-- 
+2.37.2
+
diff --git a/meta-oe/recipes-benchmark/fio/fio_3.31.bb b/meta-oe/recipes-benchmark/fio/fio_3.31.bb
index d655d6c98f..f8d63014ae 100644
--- a/meta-oe/recipes-benchmark/fio/fio_3.31.bb
+++ b/meta-oe/recipes-benchmark/fio/fio_3.31.bb
@@ -24,7 +24,8 @@  PACKAGECONFIG[numa] = ",--disable-numa,numactl"
 
 SRCREV = "6cafe8445fd1e04e5f7d67bbc73029a538d1b253"
 SRC_URI = "git://git.kernel.dk/fio.git;branch=master \
-"
+           file://0001-io_uring-Replace-pthread_self-with-s-tid.patch \
+           "
 
 S = "${WORKDIR}/git"