From: Mark Rutland <mark.rutland@arm.com>
To: mingo@kernel.org
Cc: arnd@arndb.de, aryabinin@virtuozzo.com, boqun.feng@gmail.com,
catalin.marinas@arm.com, dvyukov@google.com, glider@google.com,
linuxdrivers@attotech.com, linux-kernel@vger.kernel.org,
mark.rutland@arm.com, peterz@infradead.org, will.deacon@arm.com,
linux-arm-kernel@lists.infradead.org
Subject: [PATCHv3 5/6] atomics: check generated headers are up-to-date
Date: Tue, 4 Sep 2018 11:48:29 +0100 [thread overview]
Message-ID: <20180904104830.2975-6-mark.rutland@arm.com> (raw)
In-Reply-To: <20180904104830.2975-1-mark.rutland@arm.com>
Now that all the generated atomic headers are in place, it would be good
to ensure that:
a) the headers are up-to-date when scripting changes.
b) developers don't directly modify the generated headers.
To ensure both of these properties, let's add a Kbuild step to check
that the generated headers are up-to-date.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
---
Kbuild | 18 ++++++++++++++++--
scripts/atomic/check-atomics.sh | 19 +++++++++++++++++++
2 files changed, 35 insertions(+), 2 deletions(-)
create mode 100755 scripts/atomic/check-atomics.sh
diff --git a/Kbuild b/Kbuild
index 005304205482..47c9fe175bd9 100644
--- a/Kbuild
+++ b/Kbuild
@@ -6,7 +6,8 @@
# 2) Generate timeconst.h
# 3) Generate asm-offsets.h (may need bounds.h and timeconst.h)
# 4) Check for missing system calls
-# 5) Generate constants.py (may need bounds.h)
+# 5) check atomics headers are up-to-date
+# 6) Generate constants.py (may need bounds.h)
#####
# 1) Generate bounds.h
@@ -72,7 +73,20 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
$(call cmd,syscalls)
#####
-# 5) Generate constants for Python GDB integration
+# 5) Check atomic headers are up-to-date
+#
+
+always += old-atomics
+targets += old-atomics
+
+quiet_cmd_atomics = CALL $<
+ cmd_atomics = $(CONFIG_SHELL) scripts/atomic/check-atomics.sh
+
+old-atomics: scripts/atomic/check-atomics.sh FORCE
+ $(call cmd,atomics)
+
+#####
+# 6) Generate constants for Python GDB integration
#
extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py
diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh
new file mode 100755
index 000000000000..c30101cddf2d
--- /dev/null
+++ b/scripts/atomic/check-atomics.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+#
+# Check if atomic headers are up-to-date
+
+ATOMICDIR=$(dirname $0)
+ATOMICTBL=${ATOMICDIR}/atomics.tbl
+LINUXDIR=${ATOMICDIR}/../..
+
+cat <<EOF |
+gen-atomic-instrumented.sh asm-generic/atomic-instrumented.h
+gen-atomic-long.sh asm-generic/atomic-long.h
+gen-atomic-fallback.sh linux/atomic-fallback.h
+EOF
+while read script header; do
+ if ! (${ATOMICDIR}/${script} ${ATOMICTBL} | diff - ${LINUXDIR}/include/${header} > /dev/null); then
+ printf "warning: include/${header} is out-of-date.\n"
+ fi
+done
--
2.11.0
next prev parent reply other threads:[~2018-09-04 10:49 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-04 10:48 [PATCHv3 0/6] atomics: generate atomic headers / instrument arm64 Mark Rutland
2018-09-04 10:48 ` [PATCHv3 1/6] atomics: add common header generation files Mark Rutland
2018-11-01 9:54 ` [tip:locking/core] locking/atomics: Add " tip-bot for Mark Rutland
2018-11-01 10:06 ` tip-bot for Mark Rutland
2018-11-15 23:03 ` [PATCHv3 1/6] atomics: add " Andrew Morton
2018-11-15 23:10 ` Andrew Morton
2018-11-16 2:51 ` Mark Rutland
2018-11-21 22:34 ` Andrew Morton
2018-09-04 10:48 ` [PATCHv3 2/6] atomics: switch to generated fallbacks Mark Rutland
2018-11-01 9:55 ` [tip:locking/core] locking/atomics: Switch " tip-bot for Mark Rutland
2018-11-01 10:07 ` tip-bot for Mark Rutland
2018-09-04 10:48 ` [PATCHv3 3/6] atomics: switch to generated atomic-long Mark Rutland
2018-11-01 9:55 ` [tip:locking/core] locking/atomics: Switch " tip-bot for Mark Rutland
2018-11-01 10:08 ` tip-bot for Mark Rutland
2018-09-04 10:48 ` [PATCHv3 4/6] atomics: switch to generated instrumentation Mark Rutland
2018-11-01 9:56 ` [tip:locking/core] locking/atomics: Switch " tip-bot for Mark Rutland
2018-11-01 10:08 ` tip-bot for Mark Rutland
2018-09-04 10:48 ` Mark Rutland [this message]
2018-11-01 9:57 ` [tip:locking/core] locking/atomics: Check generated headers are up-to-date tip-bot for Mark Rutland
2018-11-01 10:09 ` tip-bot for Mark Rutland
2018-11-21 8:02 ` Ingo Molnar
2018-11-21 11:40 ` Mark Rutland
2018-11-28 8:30 ` Ingo Molnar
2018-09-04 10:48 ` [PATCHv3 6/6] arm64: use instrumented atomics Mark Rutland
2018-11-01 9:57 ` [tip:locking/core] arm64: Use " tip-bot for Mark Rutland
2018-11-01 10:09 ` [tip:locking/core] arm64, locking/atomics: " tip-bot for Mark Rutland
2018-10-08 17:15 ` [PATCHv3 0/6] atomics: generate atomic headers / instrument arm64 Mark Rutland
2018-10-19 10:27 ` Will Deacon
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=20180904104830.2975-6-mark.rutland@arm.com \
--to=mark.rutland@arm.com \
--cc=arnd@arndb.de \
--cc=aryabinin@virtuozzo.com \
--cc=boqun.feng@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxdrivers@attotech.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=will.deacon@arm.com \
/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).