2021-11-26 06:02:56

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v3 1/6] perf bench futex: Add support for 32-bit systems with 64-bit time_t

From: Alistair Francis <[email protected]>

Some 32-bit architectures (such are 32-bit RISC-V) only have a 64-bit
time_t and as such don't have the SYS_futex syscall. This patch will
allow us to use the SYS_futex_time64 syscall on those platforms.

This also converts the futex calls to be y2038 safe (when built for a
5.1+ kernel).

This is a revert of commit ba4026b09d83acf56c040b6933eac7916c27e728
"Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t"".

The original commit was reverted as including linux/time_types.h would
fail to compile on older kernels. This commit doesn't include
linux/time_types.h to avoid this issue.

Signed-off-by: Alistair Francis <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Atish Patra <[email protected]>
Cc: Darren Hart <[email protected]>
Cc: Davidlohr Bueso <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: Arnaldo Carvalho de Melo <[email protected]>
---
tools/perf/bench/futex.h | 52 +++++++++++++++++++++++++++++++++++++---
1 file changed, 49 insertions(+), 3 deletions(-)

diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
index ebdc2b032afc..385d2bdfaa9f 100644
--- a/tools/perf/bench/futex.h
+++ b/tools/perf/bench/futex.h
@@ -8,6 +8,7 @@
#ifndef _FUTEX_H
#define _FUTEX_H

+#include <errno.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>
@@ -28,7 +29,17 @@ struct bench_futex_parameters {
};

/**
- * futex_syscall() - SYS_futex syscall wrapper
+ * This is copied from linux/time_types.h.
+ * We copy this here to avoid compilation failures when running
+ * on systems that don't ship with linux/time_types.h.
+ */
+struct __kernel_old_timespec {
+ __kernel_old_time_t tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+
+/**
+ * futex_syscall() - __NR_futex syscall wrapper
* @uaddr: address of first futex
* @op: futex op code
* @val: typically expected value of uaddr, but varies by op
@@ -49,14 +60,49 @@ static inline int
futex_syscall(volatile u_int32_t *uaddr, int op, u_int32_t val, struct timespec *timeout,
volatile u_int32_t *uaddr2, int val3, int opflags)
{
- return syscall(SYS_futex, uaddr, op | opflags, val, timeout, uaddr2, val3);
+#if defined(__NR_futex_time64)
+ if (sizeof(*timeout) != sizeof(struct __kernel_old_timespec)) {
+ int ret = syscall(__NR_futex_time64, uaddr, op | opflags, val, timeout,
+ uaddr2, val3);
+ if (ret == 0 || errno != ENOSYS)
+ return ret;
+ }
+#endif
+
+#if defined(__NR_futex)
+ if (sizeof(*timeout) == sizeof(struct __kernel_old_timespec))
+ return syscall(__NR_futex, uaddr, op | opflags, val, timeout, uaddr2, val3);
+
+ if (timeout && timeout->tv_sec == (long)timeout->tv_sec) {
+ struct __kernel_old_timespec ts32;
+
+ ts32.tv_sec = (__kernel_long_t) timeout->tv_sec;
+ ts32.tv_nsec = (__kernel_long_t) timeout->tv_nsec;
+
+ return syscall(__NR_futex, uaddr, op | opflags, val, ts32, uaddr2, val3);
+ } else if (!timeout) {
+ return syscall(__NR_futex, uaddr, op | opflags, val, NULL, uaddr2, val3);
+ }
+#endif
+
+ errno = ENOSYS;
+ return -1;
}

static inline int
futex_syscall_nr_requeue(volatile u_int32_t *uaddr, int op, u_int32_t val, int nr_requeue,
volatile u_int32_t *uaddr2, int val3, int opflags)
{
- return syscall(SYS_futex, uaddr, op | opflags, val, nr_requeue, uaddr2, val3);
+#if defined(__NR_futex_time64)
+ int ret = syscall(__NR_futex_time64, uaddr, op | opflags, val, nr_requeue,
+ uaddr2, val3);
+ if (ret == 0 || errno != ENOSYS)
+ return ret;
+#endif
+
+#if defined(__NR_futex)
+ return syscall(__NR_futex, uaddr, op | opflags, val, nr_requeue, uaddr2, val3);
+#endif
}

/**
--
2.31.1



2021-11-26 06:03:11

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v3 2/6] selftests: futex: Call the futex syscall from a function

From: Alistair Francis <[email protected]>

Call the futex syscall from a function

In preparation for a more complex futex() function let's convert the
current macro into two functions. We need two functions to avoid
compiler failures as the macro is overloaded.

This will allow us to include pre-processor conditionals in the futex
syscall functions.

Signed-off-by: Alistair Francis <[email protected]>
---
.../selftests/futex/include/futextest.h | 59 +++++++++++--------
1 file changed, 34 insertions(+), 25 deletions(-)

diff --git a/tools/testing/selftests/futex/include/futextest.h b/tools/testing/selftests/futex/include/futextest.h
index ddbcfc9b7bac..c786fffecb8a 100644
--- a/tools/testing/selftests/futex/include/futextest.h
+++ b/tools/testing/selftests/futex/include/futextest.h
@@ -48,7 +48,7 @@ typedef volatile u_int32_t futex_t;
#endif

/**
- * futex() - SYS_futex syscall wrapper
+ * futex_syscall() - SYS_futex syscall wrapper
* @uaddr: address of first futex
* @op: futex op code
* @val: typically expected value of uaddr, but varies by op
@@ -58,17 +58,26 @@ typedef volatile u_int32_t futex_t;
* @val3: varies by op
* @opflags: flags to be bitwise OR'd with op, such as FUTEX_PRIVATE_FLAG
*
- * futex() is used by all the following futex op wrappers. It can also be
+ * futex_syscall() is used by all the following futex op wrappers. It can also be
* used for misuse and abuse testing. Generally, the specific op wrappers
- * should be used instead. It is a macro instead of an static inline function as
- * some of the types over overloaded (timeout is used for nr_requeue for
- * example).
+ * should be used instead.
*
* These argument descriptions are the defaults for all
* like-named arguments in the following wrappers except where noted below.
*/
-#define futex(uaddr, op, val, timeout, uaddr2, val3, opflags) \
- syscall(SYS_futex, uaddr, op | opflags, val, timeout, uaddr2, val3)
+static inline int
+futex_syscall(volatile u_int32_t *uaddr, int op, u_int32_t val, struct timespec *timeout,
+ volatile u_int32_t *uaddr2, int val3, int opflags)
+{
+ return syscall(SYS_futex, uaddr, op | opflags, val, timeout, uaddr2, val3);
+}
+
+static inline int
+futex_syscall_nr_requeue(volatile u_int32_t *uaddr, int op, u_int32_t val, int nr_requeue,
+ volatile u_int32_t *uaddr2, int val3, int opflags)
+{
+ return syscall(SYS_futex, uaddr, op | opflags, val, nr_requeue, uaddr2, val3);
+}

/**
* futex_wait() - block on uaddr with optional timeout
@@ -77,7 +86,7 @@ typedef volatile u_int32_t futex_t;
static inline int
futex_wait(futex_t *uaddr, futex_t val, struct timespec *timeout, int opflags)
{
- return futex(uaddr, FUTEX_WAIT, val, timeout, NULL, 0, opflags);
+ return futex_syscall(uaddr, FUTEX_WAIT, val, timeout, NULL, 0, opflags);
}

/**
@@ -87,7 +96,7 @@ futex_wait(futex_t *uaddr, futex_t val, struct timespec *timeout, int opflags)
static inline int
futex_wake(futex_t *uaddr, int nr_wake, int opflags)
{
- return futex(uaddr, FUTEX_WAKE, nr_wake, NULL, NULL, 0, opflags);
+ return futex_syscall(uaddr, FUTEX_WAKE, nr_wake, NULL, NULL, 0, opflags);
}

/**
@@ -98,8 +107,8 @@ static inline int
futex_wait_bitset(futex_t *uaddr, futex_t val, struct timespec *timeout,
u_int32_t bitset, int opflags)
{
- return futex(uaddr, FUTEX_WAIT_BITSET, val, timeout, NULL, bitset,
- opflags);
+ return futex_syscall(uaddr, FUTEX_WAIT_BITSET, val, timeout, NULL, bitset,
+ opflags);
}

/**
@@ -109,8 +118,8 @@ futex_wait_bitset(futex_t *uaddr, futex_t val, struct timespec *timeout,
static inline int
futex_wake_bitset(futex_t *uaddr, int nr_wake, u_int32_t bitset, int opflags)
{
- return futex(uaddr, FUTEX_WAKE_BITSET, nr_wake, NULL, NULL, bitset,
- opflags);
+ return futex_syscall(uaddr, FUTEX_WAKE_BITSET, nr_wake, NULL, NULL, bitset,
+ opflags);
}

/**
@@ -121,7 +130,7 @@ static inline int
futex_lock_pi(futex_t *uaddr, struct timespec *timeout, int detect,
int opflags)
{
- return futex(uaddr, FUTEX_LOCK_PI, detect, timeout, NULL, 0, opflags);
+ return futex_syscall(uaddr, FUTEX_LOCK_PI, detect, timeout, NULL, 0, opflags);
}

/**
@@ -130,7 +139,7 @@ futex_lock_pi(futex_t *uaddr, struct timespec *timeout, int detect,
static inline int
futex_unlock_pi(futex_t *uaddr, int opflags)
{
- return futex(uaddr, FUTEX_UNLOCK_PI, 0, NULL, NULL, 0, opflags);
+ return futex_syscall(uaddr, FUTEX_UNLOCK_PI, 0, NULL, NULL, 0, opflags);
}

/**
@@ -140,8 +149,8 @@ static inline int
futex_wake_op(futex_t *uaddr, futex_t *uaddr2, int nr_wake, int nr_wake2,
int wake_op, int opflags)
{
- return futex(uaddr, FUTEX_WAKE_OP, nr_wake, nr_wake2, uaddr2, wake_op,
- opflags);
+ return futex_syscall_nr_requeue(uaddr, FUTEX_WAKE_OP, nr_wake, nr_wake2, uaddr2, wake_op,
+ opflags);
}

/**
@@ -156,8 +165,8 @@ static inline int
futex_requeue(futex_t *uaddr, futex_t *uaddr2, int nr_wake, int nr_requeue,
int opflags)
{
- return futex(uaddr, FUTEX_REQUEUE, nr_wake, nr_requeue, uaddr2, 0,
- opflags);
+ return futex_syscall_nr_requeue(uaddr, FUTEX_REQUEUE, nr_wake, nr_requeue, uaddr2, 0,
+ opflags);
}

/**
@@ -169,8 +178,8 @@ static inline int
futex_cmp_requeue(futex_t *uaddr, futex_t val, futex_t *uaddr2, int nr_wake,
int nr_requeue, int opflags)
{
- return futex(uaddr, FUTEX_CMP_REQUEUE, nr_wake, nr_requeue, uaddr2,
- val, opflags);
+ return futex_syscall_nr_requeue(uaddr, FUTEX_CMP_REQUEUE, nr_wake, nr_requeue, uaddr2,
+ val, opflags);
}

/**
@@ -185,8 +194,8 @@ static inline int
futex_wait_requeue_pi(futex_t *uaddr, futex_t val, futex_t *uaddr2,
struct timespec *timeout, int opflags)
{
- return futex(uaddr, FUTEX_WAIT_REQUEUE_PI, val, timeout, uaddr2, 0,
- opflags);
+ return futex_syscall(uaddr, FUTEX_WAIT_REQUEUE_PI, val, timeout, uaddr2, 0,
+ opflags);
}

/**
@@ -200,8 +209,8 @@ static inline int
futex_cmp_requeue_pi(futex_t *uaddr, futex_t val, futex_t *uaddr2, int nr_wake,
int nr_requeue, int opflags)
{
- return futex(uaddr, FUTEX_CMP_REQUEUE_PI, nr_wake, nr_requeue, uaddr2,
- val, opflags);
+ return futex_syscall_nr_requeue(uaddr, FUTEX_CMP_REQUEUE_PI, nr_wake, nr_requeue, uaddr2,
+ val, opflags);
}

/**
--
2.31.1


2021-11-26 06:03:21

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v3 5/6] uapi: futex: Add a futex waitv syscall

From: Alistair Francis <[email protected]>

This commit adds a futex waitv syscall wrapper that is exposed to
userspace.

Neither the kernel or glibc currently expose a futex wrapper, so
userspace is left performing raw syscalls. As the futex_waitv syscall
always expects a 64-bit time_t this can be tricky for 32-bit systems to
get correct.

In order to avoid userspace incorrectly passing the wrong timeouts let's
expose a public helper function that ensures the kernel is passed the
correct timeout struct.

Signed-off-by: Alistair Francis <[email protected]>
---
include/uapi/linux/futex_syscall.h | 32 +++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/futex_syscall.h b/include/uapi/linux/futex_syscall.h
index e0305c581142..98c550990833 100644
--- a/include/uapi/linux/futex_syscall.h
+++ b/include/uapi/linux/futex_syscall.h
@@ -9,12 +9,15 @@
#ifndef _UAPI_LINUX_FUTEX_SYSCALL_H
#define _UAPI_LINUX_FUTEX_SYSCALL_H

-#include <asm/unistd.h>
+#include <unistd.h>
#include <errno.h>
+#include <linux/futex.h>
#include <linux/types.h>
#include <linux/time_types.h>
#include <stdint.h>
#include <sys/syscall.h>
+#include <sys/types.h>
+#include <time.h>

/**
* futex_syscall_timeout() - __NR_futex/__NR_futex_time64 syscall wrapper
@@ -86,4 +89,31 @@ __kernel_futex_syscall_nr_requeue(volatile uint32_t *uaddr, int op, uint32_t val
return -1;
}

+/**
+ * futex_waitv - Wait at multiple futexes, wake on any
+ * @waiters: Array of waiters
+ * @nr_waiters: Length of waiters array
+ * @flags: Operation flags
+ * @timo: Optional timeout for operation
+ */
+static inline int
+__kernel_futex_syscall_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
+ unsigned long flags, struct timespec *timo, clockid_t clockid)
+{
+ /* futex_waitv expects a 64-bit time_t */
+ if (sizeof(*timo) == sizeof(struct __kernel_timespec))
+ return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
+
+ /* If the caller supplied a 32-bit time_t, convert it to 64-bit */
+ if (timo) {
+ struct __kernel_timespec ts_new;
+
+ ts_new.tv_sec = timo->tv_sec;
+ ts_new.tv_nsec = timo->tv_nsec;
+
+ return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, &ts_new, clockid);
+ } else
+ return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, NULL, clockid);
+}
+
#endif /* _UAPI_LINUX_FUTEX_SYSCALL_H */
--
2.31.1


2021-11-26 06:04:54

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v3 4/6] selftests: futex: Add support for 32-bit systems with 64-bit time_t

From: Alistair Francis <[email protected]>

Using the new __kernel_futex_syscall*() functions let's add support for
32-bit systems with a 64-bit time_t. We can just direclty call the
publically exposed __kernel_futex_syscall_timeout() and
__kernel_futex_syscall_nr_requeue() functions to do this.

Signed-off-by: Alistair Francis <[email protected]>
---
tools/testing/selftests/futex/functional/futex_requeue_pi.c | 2 +-
tools/testing/selftests/futex/include/futextest.h | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
index 1ee5518ee6b7..d3673996fed4 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
@@ -294,7 +294,7 @@ int unit_test(int broadcast, long lock, int third_party_owner, long timeout_ns)
secs = (ts.tv_nsec + timeout_ns) / 1000000000;
ts.tv_nsec = ((int64_t)ts.tv_nsec + timeout_ns) % 1000000000;
ts.tv_sec += secs;
- info("ts.tv_sec = %ld\n", ts.tv_sec);
+ info("ts.tv_sec = %lld\n", ts.tv_sec);
info("ts.tv_nsec = %ld\n", ts.tv_nsec);
tsp = &ts;
}
diff --git a/tools/testing/selftests/futex/include/futextest.h b/tools/testing/selftests/futex/include/futextest.h
index c786fffecb8a..1686f94667b1 100644
--- a/tools/testing/selftests/futex/include/futextest.h
+++ b/tools/testing/selftests/futex/include/futextest.h
@@ -21,6 +21,7 @@
#include <sys/syscall.h>
#include <sys/types.h>
#include <linux/futex.h>
+#include <linux/futex_syscall.h>

typedef volatile u_int32_t futex_t;
#define FUTEX_INITIALIZER 0
@@ -69,14 +70,14 @@ static inline int
futex_syscall(volatile u_int32_t *uaddr, int op, u_int32_t val, struct timespec *timeout,
volatile u_int32_t *uaddr2, int val3, int opflags)
{
- return syscall(SYS_futex, uaddr, op | opflags, val, timeout, uaddr2, val3);
+ return __kernel_futex_syscall_timeout(uaddr, op | opflags, val, timeout, uaddr2, val3);
}

static inline int
futex_syscall_nr_requeue(volatile u_int32_t *uaddr, int op, u_int32_t val, int nr_requeue,
volatile u_int32_t *uaddr2, int val3, int opflags)
{
- return syscall(SYS_futex, uaddr, op | opflags, val, nr_requeue, uaddr2, val3);
+ return __kernel_futex_syscall_nr_requeue(uaddr, op | opflags, val, nr_requeue, uaddr2, val3);
}

/**
--
2.31.1


2021-11-26 06:05:03

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v3 3/6] uapi: futex: Add a futex syscall

From: Alistair Francis <[email protected]>

This commit adds two futex syscall wrappers that are exposed to
userspace.

Neither the kernel or glibc currently expose a futex wrapper, so
userspace is left performing raw syscalls. This has mostly been because
the overloading of one of the arguments makes it impossible to provide a
single type safe function.

Until recently the single syscall has worked fine. With the introduction
of a 64-bit time_t futex call on 32-bit architectures, this has become
more complex. The logic of handling the two possible futex syscalls is
complex and often implemented incorrectly.

This patch adds two futux syscall functions that correctly handle the
time_t complexity for userspace.

This idea is based on previous discussions:
https://lore.kernel.org/lkml/CAK8P3a3x_EyCiPDpMK54y=Rtm-Wb08ym2TNiuAZgXhYrThcWTw@mail.gmail.com/

Signed-off-by: Alistair Francis <[email protected]>
---
include/uapi/linux/futex_syscall.h | 89 ++++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)
create mode 100644 include/uapi/linux/futex_syscall.h

diff --git a/include/uapi/linux/futex_syscall.h b/include/uapi/linux/futex_syscall.h
new file mode 100644
index 000000000000..e0305c581142
--- /dev/null
+++ b/include/uapi/linux/futex_syscall.h
@@ -0,0 +1,89 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/*
+ * Futex syscall helper functions
+ *
+ * Copyright (C) 2021 Western Digital. All Rights Reserved.
+ *
+ * Author: Alistair Francis <[email protected]>
+ */
+#ifndef _UAPI_LINUX_FUTEX_SYSCALL_H
+#define _UAPI_LINUX_FUTEX_SYSCALL_H
+
+#include <asm/unistd.h>
+#include <errno.h>
+#include <linux/types.h>
+#include <linux/time_types.h>
+#include <stdint.h>
+#include <sys/syscall.h>
+
+/**
+ * futex_syscall_timeout() - __NR_futex/__NR_futex_time64 syscall wrapper
+ * @uaddr: address of first futex
+ * @op: futex op code
+ * @val: typically expected value of uaddr, but varies by op
+ * @timeout: an absolute struct timespec
+ * @uaddr2: address of second futex for some ops
+ * @val3: varies by op
+ */
+static inline int
+__kernel_futex_syscall_timeout(volatile uint32_t *uaddr, int op, uint32_t val,
+ struct timespec *timeout, volatile uint32_t *uaddr2, int val3)
+{
+#if defined(__NR_futex_time64)
+ if (sizeof(*timeout) != sizeof(struct __kernel_old_timespec)) {
+ int ret = syscall(__NR_futex_time64, uaddr, op, val, timeout, uaddr2, val3);
+
+ if (ret == 0 || errno != ENOSYS)
+ return ret;
+ }
+#endif
+
+#if defined(__NR_futex)
+ if (sizeof(*timeout) == sizeof(struct __kernel_old_timespec))
+ return syscall(__NR_futex, uaddr, op, val, timeout, uaddr2, val3);
+
+ if (timeout && timeout->tv_sec == (long)timeout->tv_sec) {
+ struct __kernel_old_timespec ts_old;
+
+ ts_old.tv_sec = (__kernel_long_t) timeout->tv_sec;
+ ts_old.tv_nsec = (__kernel_long_t) timeout->tv_nsec;
+
+ return syscall(__NR_futex, uaddr, op, val, &ts_old, uaddr2, val3);
+ } else if (!timeout) {
+ return syscall(__NR_futex, uaddr, op, val, NULL, uaddr2, val3);
+ }
+#endif
+
+ errno = ENOSYS;
+ return -1;
+}
+
+/**
+ * futex_syscall_nr_requeue() - __NR_futex/__NR_futex_time64 syscall wrapper
+ * @uaddr: address of first futex
+ * @op: futex op code
+ * @val: typically expected value of uaddr, but varies by op
+ * @nr_requeue: an op specific meaning
+ * @uaddr2: address of second futex for some ops
+ * @val3: varies by op
+ */
+static inline int
+__kernel_futex_syscall_nr_requeue(volatile uint32_t *uaddr, int op, uint32_t val,
+ uint32_t nr_requeue, volatile uint32_t *uaddr2, int val3)
+{
+#if defined(__NR_futex_time64)
+ int ret = syscall(__NR_futex_time64, uaddr, op, val, nr_requeue, uaddr2, val3);
+
+ if (ret == 0 || errno != ENOSYS)
+ return ret;
+#endif
+
+#if defined(__NR_futex)
+ return syscall(__NR_futex, uaddr, op, val, nr_requeue, uaddr2, val3);
+#endif
+
+ errno = ENOSYS;
+ return -1;
+}
+
+#endif /* _UAPI_LINUX_FUTEX_SYSCALL_H */
--
2.31.1


2021-11-26 06:05:21

by Alistair Francis

[permalink] [raw]
Subject: [PATCH v3 6/6] selftests: futex: Use futex_waitv helper function

From: Alistair Francis <[email protected]>

Use the publically exposed __kernel_futex_syscall_waitv() helper
function for the futex_waitv tests.

Signed-off-by: Alistair Francis <[email protected]>
---
.../futex/functional/futex_wait_timeout.c | 6 ++---
.../futex/functional/futex_wait_wouldblock.c | 4 ++--
.../selftests/futex/functional/futex_waitv.c | 16 ++++++++------
.../selftests/futex/include/futex2test.h | 22 -------------------
4 files changed, 14 insertions(+), 34 deletions(-)
delete mode 100644 tools/testing/selftests/futex/include/futex2test.h

diff --git a/tools/testing/selftests/futex/functional/futex_wait_timeout.c b/tools/testing/selftests/futex/functional/futex_wait_timeout.c
index 3651ce17beeb..f25e3bd8222e 100644
--- a/tools/testing/selftests/futex/functional/futex_wait_timeout.c
+++ b/tools/testing/selftests/futex/functional/futex_wait_timeout.c
@@ -15,9 +15,9 @@
*
*****************************************************************************/

+#include <linux/futex_syscall.h>
#include <pthread.h>
#include "futextest.h"
-#include "futex2test.h"
#include "logging.h"

#define TEST_NAME "futex-wait-timeout"
@@ -185,13 +185,13 @@ int main(int argc, char *argv[])
/* futex_waitv with CLOCK_MONOTONIC */
if (futex_get_abs_timeout(CLOCK_MONOTONIC, &to, timeout_ns))
return RET_FAIL;
- res = futex_waitv(&waitv, 1, 0, &to, CLOCK_MONOTONIC);
+ res = __kernel_futex_syscall_waitv(&waitv, 1, 0, &to, CLOCK_MONOTONIC);
test_timeout(res, &ret, "futex_waitv monotonic", ETIMEDOUT);

/* futex_waitv with CLOCK_REALTIME */
if (futex_get_abs_timeout(CLOCK_REALTIME, &to, timeout_ns))
return RET_FAIL;
- res = futex_waitv(&waitv, 1, 0, &to, CLOCK_REALTIME);
+ res = __kernel_futex_syscall_waitv(&waitv, 1, 0, &to, CLOCK_REALTIME);
test_timeout(res, &ret, "futex_waitv realtime", ETIMEDOUT);

ksft_print_cnts();
diff --git a/tools/testing/selftests/futex/functional/futex_wait_wouldblock.c b/tools/testing/selftests/futex/functional/futex_wait_wouldblock.c
index 7d7a6a06cdb7..399ac636524b 100644
--- a/tools/testing/selftests/futex/functional/futex_wait_wouldblock.c
+++ b/tools/testing/selftests/futex/functional/futex_wait_wouldblock.c
@@ -17,12 +17,12 @@

#include <errno.h>
#include <getopt.h>
+#include <linux/futex_syscall.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "futextest.h"
-#include "futex2test.h"
#include "logging.h"

#define TEST_NAME "futex-wait-wouldblock"
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
}

info("Calling futex_waitv on f1: %u @ %p with val=%u\n", f1, &f1, f1+1);
- res = futex_waitv(&waitv, 1, 0, &to, CLOCK_MONOTONIC);
+ res = __kernel_futex_syscall_waitv(&waitv, 1, 0, &to, CLOCK_MONOTONIC);
if (!res || errno != EWOULDBLOCK) {
ksft_test_result_pass("futex_waitv returned: %d %s\n",
res ? errno : res,
diff --git a/tools/testing/selftests/futex/functional/futex_waitv.c b/tools/testing/selftests/futex/functional/futex_waitv.c
index a94337f677e1..8ba45363c094 100644
--- a/tools/testing/selftests/futex/functional/futex_waitv.c
+++ b/tools/testing/selftests/futex/functional/futex_waitv.c
@@ -8,6 +8,7 @@
#include <errno.h>
#include <error.h>
#include <getopt.h>
+#include <linux/futex_syscall.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -16,7 +17,6 @@
#include <stdint.h>
#include <sys/shm.h>
#include "futextest.h"
-#include "futex2test.h"
#include "logging.h"

#define TEST_NAME "futex-wait"
@@ -25,6 +25,8 @@
static struct futex_waitv waitv[NR_FUTEXES];
u_int32_t futexes[NR_FUTEXES] = {0};

+#define u64_to_ptr(x) ((void *)(uintptr_t)(x))
+
void usage(char *prog)
{
printf("Usage: %s\n", prog);
@@ -45,7 +47,7 @@ void *waiterfn(void *arg)

to.tv_sec++;

- res = futex_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
+ res = __kernel_futex_syscall_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
if (res < 0) {
ksft_test_result_fail("futex_waitv returned: %d %s\n",
errno, strerror(errno));
@@ -153,7 +155,7 @@ int main(int argc, char *argv[])

to.tv_sec++;

- res = futex_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
+ res = __kernel_futex_syscall_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
if (res == EINVAL) {
ksft_test_result_fail("futex_waitv private returned: %d %s\n",
res ? errno : res,
@@ -172,7 +174,7 @@ int main(int argc, char *argv[])

to.tv_sec++;

- res = futex_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
+ res = __kernel_futex_syscall_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
if (res == EINVAL) {
ksft_test_result_fail("futex_wake private returned: %d %s\n",
res ? errno : res,
@@ -190,7 +192,7 @@ int main(int argc, char *argv[])

to.tv_sec++;

- res = futex_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
+ res = __kernel_futex_syscall_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
if (res == EINVAL) {
ksft_test_result_fail("futex_waitv private returned: %d %s\n",
res ? errno : res,
@@ -206,7 +208,7 @@ int main(int argc, char *argv[])

to.tv_sec++;

- res = futex_waitv(NULL, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
+ res = __kernel_futex_syscall_waitv(NULL, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC);
if (res == EINVAL) {
ksft_test_result_fail("futex_waitv private returned: %d %s\n",
res ? errno : res,
@@ -222,7 +224,7 @@ int main(int argc, char *argv[])

to.tv_sec++;

- res = futex_waitv(NULL, NR_FUTEXES, 0, &to, CLOCK_TAI);
+ res = __kernel_futex_syscall_waitv(NULL, NR_FUTEXES, 0, &to, CLOCK_TAI);
if (res == EINVAL) {
ksft_test_result_fail("futex_waitv private returned: %d %s\n",
res ? errno : res,
diff --git a/tools/testing/selftests/futex/include/futex2test.h b/tools/testing/selftests/futex/include/futex2test.h
deleted file mode 100644
index 9d305520e849..000000000000
--- a/tools/testing/selftests/futex/include/futex2test.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Futex2 library addons for futex tests
- *
- * Copyright 2021 Collabora Ltd.
- */
-#include <stdint.h>
-
-#define u64_to_ptr(x) ((void *)(uintptr_t)(x))
-
-/**
- * futex_waitv - Wait at multiple futexes, wake on any
- * @waiters: Array of waiters
- * @nr_waiters: Length of waiters array
- * @flags: Operation flags
- * @timo: Optional timeout for operation
- */
-static inline int futex_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
- unsigned long flags, struct timespec *timo, clockid_t clockid)
-{
- return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
-}
--
2.31.1


2021-11-26 07:22:13

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v3 1/6] perf bench futex: Add support for 32-bit systems with 64-bit time_t

On Fri, Nov 26, 2021 at 7:00 AM Alistair Francis
<[email protected]> wrote:
> From: Alistair Francis <[email protected]>
>
> Some 32-bit architectures (such are 32-bit RISC-V) only have a 64-bit
> time_t and as such don't have the SYS_futex syscall. This patch will
> allow us to use the SYS_futex_time64 syscall on those platforms.
>
> This also converts the futex calls to be y2038 safe (when built for a
> 5.1+ kernel).
>
> This is a revert of commit ba4026b09d83acf56c040b6933eac7916c27e728
> "Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t"".
>
> The original commit was reverted as including linux/time_types.h would
> fail to compile on older kernels. This commit doesn't include
> linux/time_types.h to avoid this issue.
>
> Signed-off-by: Alistair Francis <[email protected]>


Reviewed-by: Arnd Bergmann <[email protected]>

2021-11-26 07:26:47

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v3 3/6] uapi: futex: Add a futex syscall

On Fri, Nov 26, 2021 at 7:00 AM Alistair Francis
<[email protected]> wrote:
>
> From: Alistair Francis <[email protected]>
>
> This commit adds two futex syscall wrappers that are exposed to
> userspace.
>
> Neither the kernel or glibc currently expose a futex wrapper, so
> userspace is left performing raw syscalls. This has mostly been because
> the overloading of one of the arguments makes it impossible to provide a
> single type safe function.
>
> Until recently the single syscall has worked fine. With the introduction
> of a 64-bit time_t futex call on 32-bit architectures, this has become
> more complex. The logic of handling the two possible futex syscalls is
> complex and often implemented incorrectly.
>
> This patch adds two futux syscall functions that correctly handle the

s/futux/futex/

> time_t complexity for userspace.
>
> This idea is based on previous discussions:
> https://lore.kernel.org/lkml/CAK8P3a3x_EyCiPDpMK54y=Rtm-Wb08ym2TNiuAZgXhYrThcWTw@mail.gmail.com/
>
> Signed-off-by: Alistair Francis <[email protected]>

The implementation looks correct to me, the calling conventions seem
"good enough"
to me, but I wouldn't object if someone else can suggest a better interface.

One minor detail:

> +/**
> + * futex_syscall_timeout() - __NR_futex/__NR_futex_time64 syscall wrapper
> + * @uaddr: address of first futex
> + * @op: futex op code
> + * @val: typically expected value of uaddr, but varies by op
> + * @timeout: an absolute struct timespec
> + * @uaddr2: address of second futex for some ops
> + * @val3: varies by op
> + */
> +static inline int
> +__kernel_futex_syscall_timeout(volatile uint32_t *uaddr, int op, uint32_t val,
> + struct timespec *timeout, volatile uint32_t *uaddr2, int val3)

The two function names do not match the respective documentation.

Arnd

2021-11-26 07:29:35

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v3 5/6] uapi: futex: Add a futex waitv syscall

On Fri, Nov 26, 2021 at 7:00 AM Alistair Francis
<[email protected]> wrote:
>
> From: Alistair Francis <[email protected]>
>
> This commit adds a futex waitv syscall wrapper that is exposed to
> userspace.
>
> Neither the kernel or glibc currently expose a futex wrapper, so
> userspace is left performing raw syscalls. As the futex_waitv syscall
> always expects a 64-bit time_t this can be tricky for 32-bit systems to
> get correct.
>
> In order to avoid userspace incorrectly passing the wrong timeouts let's
> expose a public helper function that ensures the kernel is passed the
> correct timeout struct.
>
> Signed-off-by: Alistair Francis <[email protected]>

Reviewed-by: Arnd Bergmann <[email protected]>
> +/**
> + * futex_waitv - Wait at multiple futexes, wake on any
> + * @waiters: Array of waiters
> + * @nr_waiters: Length of waiters array
> + * @flags: Operation flags
> + * @timo: Optional timeout for operation
> + */
> +static inline int
> +__kernel_futex_syscall_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
> + unsigned long flags, struct timespec *timo, clockid_t clockid)

Same thing about the mismatched function name

Arnd

2021-11-26 07:36:20

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v3 6/6] selftests: futex: Use futex_waitv helper function

On Fri, Nov 26, 2021 at 7:00 AM Alistair Francis
<[email protected]> wrote:
>
> From: Alistair Francis <[email protected]>
>
> Use the publically exposed __kernel_futex_syscall_waitv() helper
> function for the futex_waitv tests.
>
> Signed-off-by: Alistair Francis <[email protected]>

I think it would be nicer to wrap __kernel_futex_syscall_waitv() here

> -static inline int futex_waitv(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
> - unsigned long flags, struct timespec *timo, clockid_t clockid)
> -{
> - return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
> -}

Basically just changing this part to call the new function

Arnd

2021-11-26 07:39:02

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH v3 4/6] selftests: futex: Add support for 32-bit systems with 64-bit time_t

On Fri, Nov 26, 2021 at 7:00 AM Alistair Francis
<[email protected]> wrote:
>
> From: Alistair Francis <[email protected]>
>
> Using the new __kernel_futex_syscall*() functions let's add support for
> 32-bit systems with a 64-bit time_t. We can just direclty call the
> publically exposed __kernel_futex_syscall_timeout() and
> __kernel_futex_syscall_nr_requeue() functions to do this.
>
> Signed-off-by: Alistair Francis <[email protected]>
> ---
> tools/testing/selftests/futex/functional/futex_requeue_pi.c | 2 +-
> tools/testing/selftests/futex/include/futextest.h | 5 +++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
> index 1ee5518ee6b7..d3673996fed4 100644
> --- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c
> +++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
> @@ -294,7 +294,7 @@ int unit_test(int broadcast, long lock, int third_party_owner, long timeout_ns)
> secs = (ts.tv_nsec + timeout_ns) / 1000000000;
> ts.tv_nsec = ((int64_t)ts.tv_nsec + timeout_ns) % 1000000000;
> ts.tv_sec += secs;
> - info("ts.tv_sec = %ld\n", ts.tv_sec);
> + info("ts.tv_sec = %lld\n", ts.tv_sec);
> info("ts.tv_nsec = %ld\n", ts.tv_nsec);
> tsp = &ts;
> }

I think this causes a warning on 64-bit builds now, you have to add a
cast to 'long long'
to make it work everywhere.

Arnd

2021-11-27 08:43:53

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH v3 3/6] uapi: futex: Add a futex syscall

Hi Alistair,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tip/locking/core]
[also build test ERROR on linux/master soc/for-next linus/master v5.16-rc2 next-20211126]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Alistair-Francis/perf-bench-futex-Add-support-for-32-bit-systems-with-64-bit-time_t/20211126-140752
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 3297481d688a5cc2973ea58bd78e66b8639748b1
config: x86_64-randconfig-a002-20211126 (https://download.01.org/0day-ci/archive/20211127/[email protected]/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5162b558d8c0b542e752b037e72a69d5fd51eb1e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/e6bfd30ff20551d613ea63d17bc9667179a593de
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alistair-Francis/perf-bench-futex-Add-support-for-32-bit-systems-with-64-bit-time_t/20211126-140752
git checkout e6bfd30ff20551d613ea63d17bc9667179a593de
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All error/warnings (new ones prefixed by >>):

In file included from <built-in>:1:
>> ./usr/include/linux/futex_syscall.h:30:16: warning: declaration of 'struct timespec' will not be visible outside of this function [-Wvisibility]
struct timespec *timeout, __volatile__ uint32_t *uaddr2, int val3)
^
>> ./usr/include/linux/futex_syscall.h:42:12: error: invalid application of 'sizeof' to an incomplete type 'struct timespec'
if (sizeof(*timeout) == sizeof(struct __kernel_old_timespec))
^~~~~~~~~~
./usr/include/linux/futex_syscall.h:30:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ uint32_t *uaddr2, int val3)
^
>> ./usr/include/linux/futex_syscall.h:43:10: error: implicit declaration of function 'syscall' [-Werror,-Wimplicit-function-declaration]
return syscall(__NR_futex, uaddr, op, val, timeout, uaddr2, val3);
^
>> ./usr/include/linux/futex_syscall.h:45:24: error: incomplete definition of type 'struct timespec'
if (timeout && timeout->tv_sec == (long)timeout->tv_sec) {
~~~~~~~^
./usr/include/linux/futex_syscall.h:30:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ uint32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:45:49: error: incomplete definition of type 'struct timespec'
if (timeout && timeout->tv_sec == (long)timeout->tv_sec) {
~~~~~~~^
./usr/include/linux/futex_syscall.h:30:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ uint32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:48:44: error: incomplete definition of type 'struct timespec'
ts_old.tv_sec = (__kernel_long_t) timeout->tv_sec;
~~~~~~~^
./usr/include/linux/futex_syscall.h:30:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ uint32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:49:45: error: incomplete definition of type 'struct timespec'
ts_old.tv_nsec = (__kernel_long_t) timeout->tv_nsec;
~~~~~~~^
./usr/include/linux/futex_syscall.h:30:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ uint32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:53:46: error: use of undeclared identifier 'NULL'
return syscall(__NR_futex, uaddr, op, val, NULL, uaddr2, val3);
^
./usr/include/linux/futex_syscall.h:82:9: error: implicit declaration of function 'syscall' [-Werror,-Wimplicit-function-declaration]
return syscall(__NR_futex, uaddr, op, val, nr_requeue, uaddr2, val3);
^
1 warning and 8 errors generated.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

2022-02-26 14:50:13

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH v3 1/6] perf bench futex: Add support for 32-bit systems with 64-bit time_t

Em Fri, Nov 26, 2021 at 04:00:19PM +1000, Alistair Francis escreveu:
> From: Alistair Francis <[email protected]>
>
> Some 32-bit architectures (such are 32-bit RISC-V) only have a 64-bit
> time_t and as such don't have the SYS_futex syscall. This patch will
> allow us to use the SYS_futex_time64 syscall on those platforms.
>
> This also converts the futex calls to be y2038 safe (when built for a
> 5.1+ kernel).
>
> This is a revert of commit ba4026b09d83acf56c040b6933eac7916c27e728
> "Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t"".
>
> The original commit was reverted as including linux/time_types.h would
> fail to compile on older kernels. This commit doesn't include
> linux/time_types.h to avoid this issue.

With this patch:

1 101.45 almalinux:8 : Ok gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4) , clang version 12.0.1 (Red Hat 12.0.1-4.module_el8.5.0+1025+93159d6c)
2 8.51 alpine:3.4 : FAIL gcc version 5.3.0 (Alpine 5.3.0)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
3 15.02 alpine:3.5 : FAIL gcc version 6.2.1 20160822 (Alpine 6.2.1)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
4 9.00 alpine:3.6 : FAIL gcc version 6.3.0 (Alpine 6.3.0)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
5 9.01 alpine:3.7 : FAIL gcc version 6.4.0 (Alpine 6.4.0)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
6 8.80 alpine:3.8 : FAIL gcc version 6.4.0 (Alpine 6.4.0)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
7 9.81 alpine:3.9 : FAIL gcc version 8.3.0 (Alpine 8.3.0)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
8 9.80 alpine:3.10 : FAIL gcc version 8.3.0 (Alpine 8.3.0)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
9 10.81 alpine:3.11 : FAIL gcc version 9.3.0 (Alpine 9.3.0)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
37 | __kernel_old_time_t tv_sec; /* seconds */
| ^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
37 | __kernel_old_time_t tv_sec; /* seconds */
| ^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
10 10.21 alpine:3.12 : FAIL gcc version 9.3.0 (Alpine 9.3.0)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
37 | __kernel_old_time_t tv_sec; /* seconds */
| ^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
11 120.31 alpine:3.13 : Ok gcc (Alpine 10.2.1_pre1) 10.2.1 20201203 , Alpine clang version 10.0.1
12 107.68 alpine:3.14 : Ok gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424 , Alpine clang version 11.1.0
13 107.06 alpine:3.15 : Ok gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027 , Alpine clang version 12.0.1
14 108.78 alpine:edge : Ok gcc (Alpine 11.2.1_git20211128) 11.2.1 20211128 , Alpine clang version 12.0.1
15 7.79 alt:p8 : FAIL gcc version 5.3.1 20151207 (ALT p8 5.3.1-alt3.M80P.1) (GCC)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
make[3]: *** [bench] Error 2
16 80.88 alt:p9 : Ok x86_64-alt-linux-gcc (GCC) 8.4.1 20200305 (ALT p9 8.4.1-alt0.p9.1) , clang version 10.0.0
17 79.87 alt:p10 : Ok x86_64-alt-linux-gcc (GCC) 10.3.1 20210703 (ALT Sisyphus 10.3.1-alt2) , clang version 11.0.1
18 79.18 alt:sisyphus : Ok x86_64-alt-linux-gcc (GCC) 11.2.1 20211202 (ALT Sisyphus 11.2.1-alt2) , ALT Linux Team clang version 12.0.1
19 8.39 amazonlinux:1 : FAIL gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [bench] Error 2
20 9.10 amazonlinux:2 : FAIL gcc version 7.3.1 20180712 (Red Hat 7.3.1-13) (GCC)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [bench] Error 2
21 81.17 archlinux:base : Ok gcc (GCC) 11.1.0 , clang version 13.0.0
22 84.48 centos:8 : Ok gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) , clang version 11.0.1 (Red Hat 11.0.1-1.module_el8.4.0+966+2995ef20)
23 91.62 centos:stream : Ok gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10) , clang version 13.0.0 (Red Hat 13.0.0-3.module_el8.6.0+1074+380cef3f)
24 50.63 clearlinux:latest : Ok gcc (Clear Linux OS for Intel Architecture) 11.2.1 20220215 releases/gcc-11.2.0-770-g2c9485a496 , clang version 13.0.0
25 7.70 debian:9 : FAIL gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
26 18.76 debian:10 : FAIL gcc version 8.3.0 (Debian 8.3.0-6)
In file included from bench/futex-wake.c:25:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
27 88.71 debian:11 : Ok gcc (Debian 10.2.1-6) 10.2.1 20210110 , Debian clang version 11.0.1-2
28 102.77 debian:experimental : Ok gcc (Debian 11.2.0-14) 11.2.0 , Debian clang version 13.0.1-+rc3-1~exp1+b1
29 24.47 debian:experimental-x-arm64 : Ok aarch64-linux-gnu-gcc (Debian 11.2.0-9) 11.2.0
30 20.15 debian:experimental-x-mips : Ok mips-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110
31 22.26 debian:experimental-x-mips64 : Ok mips64-linux-gnuabi64-gcc (Debian 10.2.1-6) 10.2.1 20210110
32 23.07 debian:experimental-x-mipsel : Ok mipsel-linux-gnu-gcc (Debian 11.2.0-9) 11.2.0
33 8.50 fedora:22 : FAIL gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
34 8.50 fedora:23 : FAIL gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
35 8.90 fedora:24 : FAIL gcc version 6.3.1 20161221 (Red Hat 6.3.1-1) (GCC)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
36 11.51 fedora:24-x-ARC-uClibc : FAIL gcc version 7.1.1 20170710 (ARCompact ISA Linux uClibc toolchain 2017.09-rc2)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-requeue.c:26:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
37 9.00 fedora:25 : FAIL gcc version 6.4.1 20170727 (Red Hat 6.4.1-1) (GCC)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
38 9.31 fedora:26 : FAIL gcc version 7.3.1 20180130 (Red Hat 7.3.1-2) (GCC)
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
39 9.20 fedora:27 : FAIL gcc version 7.3.1 20180712 (Red Hat 7.3.1-6) (GCC)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-requeue.c:26:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
40 9.60 fedora:28 : FAIL gcc version 8.3.1 20190223 (Red Hat 8.3.1-2) (GCC)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
41 10.11 fedora:29 : FAIL gcc version 8.3.1 20190223 (Red Hat 8.3.1-2) (GCC)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
42 104.33 fedora:30 : Ok gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2) , clang version 8.0.0 (Fedora 8.0.0-3.fc30)
43 96.30 fedora:31 : Ok gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2) , clang version 9.0.1 (Fedora 9.0.1-4.fc31)
44 90.41 fedora:32 : Ok gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1) , clang version 10.0.1 (Fedora 10.0.1-3.fc32)
45 89.81 fedora:33 : Ok gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1) , clang version 11.0.0 (Fedora 11.0.0-3.fc33)
46 92.32 fedora:34 : Ok gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1) , clang version 12.0.1 (Fedora 12.0.1-1.fc34)
47 7.20 fedora:34-x-ARC-glibc : FAIL gcc version 8.3.1 20190225 (ARC HS GNU/Linux glibc toolchain 2019.03-rc1)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
48 6.39 fedora:34-x-ARC-uClibc : FAIL gcc version 8.3.1 20190225 (ARCv2 ISA Linux uClibc toolchain 2019.03-rc1)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-requeue.c:26:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-lock-pi.c:19:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
49 95.94 fedora:35 : Ok gcc (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7) , clang version 13.0.0 (Fedora 13.0.0-3.fc35)
50 107.18 fedora:rawhide : Ok gcc (GCC) 12.0.1 20220205 (Red Hat 12.0.1-0) , clang version 13.0.0 (Fedora 13.0.0-5.fc36)
51 83.10 gentoo-stage3:latest : Ok gcc (Gentoo 11.2.0 p1) 11.2.0 , clang version 13.0.0
52 9.41 mageia:6 : FAIL gcc version 5.5.0 (Mageia 5.5.0-1.mga6)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
53 40.71 mageia:7 : FAIL clang version 8.0.0 (Mageia 8.0.0-1.mga7)
yychar = yylex (&yylval, &yylloc, scanner);
^
#define yylex parse_events_lex
^
1 error generated.
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: util] Error 2
54 92.83 manjaro:base : Ok gcc (GCC) 11.1.0 , clang version 13.0.0
55 6.49 openmandriva:4.2 : FAIL gcc version 11.2.0 20210728 (OpenMandriva) (GCC)
In file included from builtin-bench.c:22:
bench/bench.h:66:19: error: conflicting types for 'pthread_attr_setaffinity_np'; have 'int(pthread_attr_t *, size_t, cpu_set_t *)' {aka 'int(pthread_attr_t *, long unsigned int, cpu_set_t *)'}
66 | static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr __maybe_unused,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from bench/bench.h:64,
from builtin-bench.c:22:
/usr/include/pthread.h:394:12: note: previous declaration of 'pthread_attr_setaffinity_np' with type 'int(pthread_attr_t *, size_t, const cpu_set_t *)' {aka 'int(pthread_attr_t *, long unsigned int, const cpu_set_t *)'}
394 | extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ld: warning: -r and --gc-sections may not be used together, disabling --gc-sections
ld: warning: -r and --icf may not be used together, disabling --icf
ld: warning: -r and --gc-sections may not be used together, disabling --gc-sections
ld: warning: -r and --icf may not be used together, disabling --icf
ld: warning: -r and --gc-sections may not be used together, disabling --gc-sections
ld: warning: -r and --icf may not be used together, disabling --icf
56 6.18 openmandriva:cooker : FAIL gcc version 11.2.0 20210728 (OpenMandriva) (GCC)
In file included from builtin-bench.c:22:
bench/bench.h:66:19: error: conflicting types for 'pthread_attr_setaffinity_np'; have 'int(pthread_attr_t *, size_t, cpu_set_t *)' {aka 'int(pthread_attr_t *, long unsigned int, cpu_set_t *)'}
66 | static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr __maybe_unused,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from bench/bench.h:64,
from builtin-bench.c:22:
/usr/include/pthread.h:394:12: note: previous declaration of 'pthread_attr_setaffinity_np' with type 'int(pthread_attr_t *, size_t, const cpu_set_t *)' {aka 'int(pthread_attr_t *, long unsigned int, const cpu_set_t *)'}
394 | extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
ld: warning: -r and --gc-sections may not be used together, disabling --gc-sections
ld: warning: -r and --icf may not be used together, disabling --icf
ld: warning: -r and --gc-sections may not be used together, disabling --gc-sections
ld: warning: -r and --icf may not be used together, disabling --icf
57 12.82 opensuse:15.0 : FAIL gcc version 7.4.1 20190905 [gcc-7-branch revision 275407] (SUSE Linux)
Makefile.config:1005: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
update-alternatives: error: no alternatives for java
update-alternatives: error: no alternatives for java
Makefile.config:1052: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel

Auto-detecting system features:
... dwarf: [ on ]
... dwarf_getlocations: [ on ]
... glibc: [ on ]
... libbfd: [ OFF ]
... libbfd-buildid: [ OFF ]
... libcap: [ on ]
... libelf: [ on ]
... libnuma: [ on ]
... numa_num_possible_cpus: [ on ]
... libperl: [ on ]
... libpython: [ on ]
... libcrypto: [ on ]
... libunwind: [ on ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ on ]
... bpf: [ on ]
... libaio: [ on ]
... libzstd: [ on ]
... disassembler-four-args: [ on ]


PERF_VERSION = 5.17.rc4.gec9389ea0661
GEN perf-archive
GEN perf-with-kcore
GEN perf-iostat
--
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
58 13.11 opensuse:15.1 : FAIL gcc version 7.5.0 (SUSE Linux)
Makefile.config:1005: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
update-alternatives: error: no alternatives for java
update-alternatives: error: no alternatives for java
Makefile.config:1052: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel

Auto-detecting system features:
... dwarf: [ on ]
... dwarf_getlocations: [ on ]
... glibc: [ on ]
... libbfd: [ OFF ]
... libbfd-buildid: [ OFF ]
... libcap: [ on ]
... libelf: [ on ]
... libnuma: [ on ]
... numa_num_possible_cpus: [ on ]
... libperl: [ on ]
... libpython: [ on ]
... libcrypto: [ on ]
... libunwind: [ on ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ on ]
... bpf: [ on ]
... libaio: [ on ]
... libzstd: [ on ]
... disassembler-four-args: [ on ]


PERF_VERSION = 5.17.rc4.gec9389ea0661
GEN perf-archive
GEN perf-with-kcore
GEN perf-iostat
--
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
59 13.21 opensuse:15.2 : FAIL gcc version 7.5.0 (SUSE Linux)
Makefile.config:1005: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
update-alternatives: error: no alternatives for java
update-alternatives: error: no alternatives for java
Makefile.config:1052: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel

Auto-detecting system features:
... dwarf: [ on ]
... dwarf_getlocations: [ on ]
... glibc: [ on ]
... libbfd: [ OFF ]
... libbfd-buildid: [ OFF ]
... libcap: [ on ]
... libelf: [ on ]
... libnuma: [ on ]
... numa_num_possible_cpus: [ on ]
... libperl: [ on ]
... libpython: [ on ]
... libcrypto: [ on ]
... libunwind: [ on ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ on ]
... bpf: [ on ]
... libaio: [ on ]
... libzstd: [ on ]
... disassembler-four-args: [ on ]


PERF_VERSION = 5.17.rc4.gec9389ea0661
GEN perf-archive
GEN perf-with-kcore
GEN perf-iostat
--
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
60 14.42 opensuse:15.3 : FAIL gcc version 7.5.0 (SUSE Linux)
Makefile.config:1005: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev
update-alternatives: error: no alternatives for java
update-alternatives: error: no alternatives for java
Makefile.config:1052: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel

Auto-detecting system features:
... dwarf: [ on ]
... dwarf_getlocations: [ on ]
... glibc: [ on ]
... libbfd: [ OFF ]
... libbfd-buildid: [ OFF ]
... libcap: [ on ]
... libelf: [ on ]
... libnuma: [ on ]
... numa_num_possible_cpus: [ on ]
... libperl: [ on ]
... libpython: [ on ]
... libcrypto: [ on ]
... libunwind: [ on ]
... libdw-dwarf-unwind: [ on ]
... zlib: [ on ]
... lzma: [ on ]
... get_cpuid: [ on ]
... bpf: [ on ]
... libaio: [ on ]
... libzstd: [ on ]
... disassembler-four-args: [ on ]


PERF_VERSION = 5.17.rc4.gec9389ea0661
GEN perf-archive
GEN perf-with-kcore
GEN perf-iostat
--
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-requeue.c:26:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-lock-pi.c:19:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
61 120.78 opensuse:15.4 : Ok gcc (SUSE Linux) 7.5.0 , clang version 11.0.1
62 137.24 opensuse:tumbleweed : Ok gcc (SUSE Linux) 11.2.1 20211124 [revision 7510c23c1ec53aa4a62705f0384079661342ff7b] , clang version 13.0.0
63 99.03 oraclelinux:8 : Ok gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4.0.1) , clang version 12.0.1 (Red Hat 12.0.1-4.0.1.module+el8.5.0+20428+2b4ecd47)
64 100.63 rockylinux:8 : Ok gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4) , clang version 12.0.1 (Red Hat 12.0.1-4.module+el8.5.0+715+58f51d49)
65 8.40 ubuntu:16.04 : FAIL gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
66 7.10 ubuntu:16.04-x-arm : FAIL gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
67 7.20 ubuntu:16.04-x-arm64 : FAIL gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
68 7.10 ubuntu:16.04-x-powerpc : FAIL gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
69 7.30 ubuntu:16.04-x-powerpc64 : FAIL gcc version 5.4.0 20160609 (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
70 7.00 ubuntu:16.04-x-powerpc64el : FAIL gcc version 5.4.0 20160609 (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
71 6.70 ubuntu:16.04-x-s390 : FAIL gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
72 9.00 ubuntu:18.04 : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
73 7.60 ubuntu:18.04-x-arm : FAIL gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
74 7.70 ubuntu:18.04-x-arm64 : FAIL gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
75 6.39 ubuntu:18.04-x-m68k : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
76 7.50 ubuntu:18.04-x-powerpc : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
77 8.10 ubuntu:18.04-x-powerpc64 : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake-parallel.c:31:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
78 8.10 ubuntu:18.04-x-powerpc64el : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
79 7.09 ubuntu:18.04-x-riscv64 : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
80 6.99 ubuntu:18.04-x-s390 : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
81 7.40 ubuntu:18.04-x-sh4 : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
In file included from bench/futex-wake.c:25:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
82 7.00 ubuntu:18.04-x-sparc64 : FAIL gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
In file included from bench/futex-hash.c:29:0:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
__kernel_old_time_t tv_sec; /* seconds */
^~~~~~~~~~~~~~~~~~~
/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
83 8.21 ubuntu:20.04 : FAIL gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
37 | __kernel_old_time_t tv_sec; /* seconds */
| ^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
84 8.30 ubuntu:20.04-x-powerpc64el : FAIL gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04)
In file included from bench/futex-hash.c:29:
bench/futex.h:37:2: error: unknown type name '__kernel_old_time_t'
37 | __kernel_old_time_t tv_sec; /* seconds */
| ^~~~~~~~~~~~~~~~~~~
make[3]: *** [/git/perf-5.17.0-rc4/tools/build/Makefile.build:139: bench] Error 2
85 76.05 ubuntu:20.10 : Ok gcc (Ubuntu 10.3.0-1ubuntu1~20.10) 10.3.0 , Ubuntu clang version 11.0.0-2
86 86.69 ubuntu:21.04 : Ok gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0 , Ubuntu clang version 12.0.0-3ubuntu1~21.04.2
87 90.71 ubuntu:21.10 : Ok gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0 , Ubuntu clang version 13.0.0-2
88 112.18 ubuntu:22.04 : Ok gcc (Ubuntu 11.2.0-14ubuntu1) 11.2.0 , Ubuntu clang version 13.0.0-9
BUILD_TARBALL_HEAD=ec9389ea066166f6807722b48bbc7cd128660cd1