All of lore.kernel.org
 help / color / mirror / Atom feed
* + kbuild-use-cflags_gcov-in-the-prefer-atomic-try-run-test.patch added to mm-nonmm-unstable branch
@ 2026-10-02  0:51 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-02  0:51 UTC (permalink / raw)
  To: mm-commits, zaslonko, oberpar, nsc, nathan, masahiroy, arnd,
	khorenko, akpm


The patch titled
     Subject: kbuild: use $(CFLAGS_GCOV) in the prefer-atomic try-run test
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     kbuild-use-cflags_gcov-in-the-prefer-atomic-try-run-test.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/kbuild-use-cflags_gcov-in-the-prefer-atomic-try-run-test.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Konstantin Khorenko <khorenko@virtuozzo.com>
Subject: kbuild: use $(CFLAGS_GCOV) in the prefer-atomic try-run test
Date: Thu, 01 Oct 2026 18:57:11 +0200

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>
---

 Makefile |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/Makefile~kbuild-use-cflags_gcov-in-the-prefer-atomic-try-run-test
+++ a/Makefile
@@ -1184,11 +1184,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 ; \
_

Patches currently in -mm which might be from khorenko@virtuozzo.com are

selftests-core-fix-unshare_test-with-large-fsnr_open.patch
kbuild-use-cflags_gcov-in-the-prefer-atomic-try-run-test.patch
kbuild-move-gcov-flags-to-scripts-makefilegcov.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-02  0:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-02  0:51 + kbuild-use-cflags_gcov-in-the-prefer-atomic-try-run-test.patch added to mm-nonmm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.