From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: devel@openvz.org, Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: [Devel] [PATCH hci-8.1 1/2] ms/kbuild: use $(CFLAGS_GCOV) in the prefer-atomic try-run test
Date: Mon, 19 Oct 2026 20:26:50 +0200 [thread overview]
Message-ID: <20261019-b4-prep-khorenko-vstor-148131-gcov-followups-v1-1-2932ec685608@virtuozzo.com> (raw)
In-Reply-To: <20261019-b4-prep-khorenko-vstor-148131-gcov-followups-v1-0-2932ec685608@virtuozzo.com>
Patch series "kbuild: GCOV cleanups following the prefer-atomic fix".
Two cleanups Peter Oberparleiter suggested while reviewing commit
56cb9b7d96b2 ("gcov: use atomic counter updates to fix concurrent access
crashes"):
https://lore.kernel.org/e1b6e768-51af-468b-a729-0ed3fceef2f1@linux.ibm.com
Patch 1 makes the prefer-atomic try-run test reuse $(CFLAGS_GCOV) instead
of spelling the flags out again, so the test compiles with the exact GCOV
flags, -fno-tree-loop-im included.
Patch 2 moves the CFLAGS_GCOV block into scripts/Makefile.gcov, included
via include-$(CONFIG_GCOV_KERNEL) like the other instrumentation
makefiles. The try-run also stops running on builds without GCOV.
This patch (of 2):
Reference $(CFLAGS_GCOV) in the try-run test introduced by
commit 56cb9b7d96b2 ("gcov: use atomic counter updates to fix
concurrent access crashes"), otherwise it can miss potential future
changes in the list of flags used for GCOV profiling like it misses
-fno-tree-loop-im at the moment.
The outcome of the test is unchanged: -fno-tree-loop-im does not affect
the undefined symbols the test compares.
Link: https://lore.kernel.org/20261001-b4-prep-gcov-v1-0-794792e06f24@virtuozzo.com
Link: https://lore.kernel.org/20261001-b4-prep-gcov-v1-1-794792e06f24@virtuozzo.com
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Suggested-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nsc@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Mikhail Zaslonko <zaslonko@linux.ibm.com>
(cherry picked from commit 4719c9264131b88fef209dc3342c23d3ac5356bd)
Picked from the akpm/mm tree, branch mm-nonmm-stable: not in Linus's
tree yet.
https://virtuozzo.atlassian.net/browse/VSTOR-148131
Feature: fix ms/gcov
Assisted-by: LLM
Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
Makefile | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 288224078377f..3524889b5bb5f 100644
--- a/Makefile
+++ b/Makefile
@@ -1041,11 +1041,11 @@ CFLAGS_GCOV += -fno-tree-loop-im
# undefined symbols (e.g. libatomic calls that the kernel cannot link).
CFLAGS_GCOV += $(call try-run,\
echo 'long long x; void f(void){x++;}' | \
- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -w -fprofile-arcs \
- -ftest-coverage -x c - -c -o "$$TMP.base" && \
+ $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -w $(CFLAGS_GCOV) \
+ -x c - -c -o "$$TMP.base" && \
echo 'long long x; void f(void){x++;}' | \
- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -w -fprofile-arcs \
- -ftest-coverage -fprofile-update=prefer-atomic \
+ $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -w $(CFLAGS_GCOV) \
+ -fprofile-update=prefer-atomic \
-x c - -c -o "$$TMP" && \
$(NM) "$$TMP.base" | grep ' U ' > "$$TMP.ubase" || true ; \
$(NM) "$$TMP" | grep ' U ' > "$$TMP.utest" || true ; \
--
2.43.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-10-19 18:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 18:26 [Devel] [PATCH hci-8.1 0/2] ms/kbuild: GCOV follow-ups to the prefer-atomic fix Konstantin Khorenko
2026-10-19 18:26 ` Konstantin Khorenko [this message]
2026-10-19 18:29 ` [Devel] [PATCH hci-8.1 1/2] ms/kbuild: use $(CFLAGS_GCOV) in the prefer-atomic try-run test no-reply
2026-10-19 18:26 ` [Devel] [PATCH hci-8.1 2/2] ms/kbuild: move GCOV flags to scripts/Makefile.gcov Konstantin Khorenko
2026-10-19 18:30 ` no-reply
2026-10-19 19:54 ` [Devel] [PATCH hci-8.1 0/2] ms/kbuild: GCOV follow-ups to the prefer-atomic fix Konstantin Khorenko
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=20261019-b4-prep-khorenko-vstor-148131-gcov-followups-v1-1-2932ec685608@virtuozzo.com \
--to=khorenko@virtuozzo.com \
--cc=devel@openvz.org \
/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