From: Alistair Francis <alistair.francis@opensource.wdc.com>
To: linux-riscv@lists.infradead.org, linux-perf-users@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com,
namhyung@kernel.org, jolsa@redhat.com,
alexander.shishkin@linux.intel.com, mark.rutland@arm.com,
acme@kernel.org, dave@stgolabs.net, dvhart@infradead.org,
peterz@infradead.org, mingo@redhat.com, tglx@linutronix.de,
atish.patra@wdc.com, arnd@arndb.de,
Alistair Francis <alistair.francis@wdc.com>
Subject: [PATCH] perf bench: Add support for 32-bit systems with 64-bit time_t
Date: Thu, 9 Sep 2021 14:25:43 +1000 [thread overview]
Message-ID: <20210909042543.1982893-1-alistair.francis@opensource.wdc.com> (raw)
From: Alistair Francis <alistair.francis@wdc.com>
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 patch does not attempt to gracefully allow 32-bit architectures
with both SYS_futex and SYS_futex_time64 to support a 64-bit time_t.
This patch only applies to 32-bit architectures with a 64-bit time_t.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
tools/perf/bench/futex.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
index b3853aac3021..912342d7f594 100644
--- a/tools/perf/bench/futex.h
+++ b/tools/perf/bench/futex.h
@@ -27,6 +27,17 @@ struct bench_futex_parameters {
unsigned int nrequeue;
};
+/**
+ * Some newer 32-bit architectures (such as RISC-V 32-bit) don't have
+ * the SYS_futex syscall and instead only have the SYS_futex_time64 call.
+ * Let's ensure that those still compile and run by just using the
+ * SYS_futex_time64 syscall. On these systems `struct timespec` will use a
+ * 64-bit time_t so the SYS_futex_time64 call will work.
+ */
+#if !defined(SYS_futex) && defined(SYS_futex_time64)
+ #define SYS_futex SYS_futex_time64
+#endif
+
/**
* futex() - SYS_futex syscall wrapper
* @uaddr: address of first futex
--
2.31.1
next reply other threads:[~2021-09-09 4:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 4:25 Alistair Francis [this message]
2021-09-09 8:20 ` [PATCH] perf bench: Add support for 32-bit systems with 64-bit time_t Arnd Bergmann
2021-09-10 0:45 ` Alistair Francis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210909042543.1982893-1-alistair.francis@opensource.wdc.com \
--to=alistair.francis@opensource.wdc.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alistair.francis@wdc.com \
--cc=alistair23@gmail.com \
--cc=arnd@arndb.de \
--cc=atish.patra@wdc.com \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).