* [PATCH] gcov: add support for GCC 14
@ 2024-06-10 9:27 Peter Oberparleiter
2024-06-10 13:41 ` Chuck Lever
0 siblings, 1 reply; 4+ messages in thread
From: Peter Oberparleiter @ 2024-06-10 9:27 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, allison.henderson, chuck.lever, oberpar
Using gcov on kernels compiled with GCC 14 results in truncated 16-byte
long .gcda files with no usable data. To fix this, update GCOV_COUNTERS
to match the value defined by GCC 14.
Tested with GCC versions 14.1.0 and 13.2.0.
Reported-by: Allison Henderson <allison.henderson@oracle.com>
Reported-by: Chuck Lever III <chuck.lever@oracle.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
---
kernel/gcov/gcc_4_7.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
index 74a4ef1da9ad..fd75b4a484d7 100644
--- a/kernel/gcov/gcc_4_7.c
+++ b/kernel/gcov/gcc_4_7.c
@@ -18,7 +18,9 @@
#include <linux/mm.h>
#include "gcov.h"
-#if (__GNUC__ >= 10)
+#if (__GNUC__ >= 14)
+#define GCOV_COUNTERS 9
+#elif (__GNUC__ >= 10)
#define GCOV_COUNTERS 8
#elif (__GNUC__ >= 7)
#define GCOV_COUNTERS 9
--
2.40.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gcov: add support for GCC 14
2024-06-10 9:27 [PATCH] gcov: add support for GCC 14 Peter Oberparleiter
@ 2024-06-10 13:41 ` Chuck Lever
2024-06-10 17:45 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2024-06-10 13:41 UTC (permalink / raw)
To: Peter Oberparleiter; +Cc: akpm, linux-kernel, allison.henderson
On Mon, Jun 10, 2024 at 11:27:43AM +0200, Peter Oberparleiter wrote:
> Using gcov on kernels compiled with GCC 14 results in truncated 16-byte
> long .gcda files with no usable data. To fix this, update GCOV_COUNTERS
> to match the value defined by GCC 14.
>
> Tested with GCC versions 14.1.0 and 13.2.0.
>
> Reported-by: Allison Henderson <allison.henderson@oracle.com>
> Reported-by: Chuck Lever III <chuck.lever@oracle.com>
> Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
> ---
> kernel/gcov/gcc_4_7.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
> index 74a4ef1da9ad..fd75b4a484d7 100644
> --- a/kernel/gcov/gcc_4_7.c
> +++ b/kernel/gcov/gcc_4_7.c
> @@ -18,7 +18,9 @@
> #include <linux/mm.h>
> #include "gcov.h"
>
> -#if (__GNUC__ >= 10)
> +#if (__GNUC__ >= 14)
> +#define GCOV_COUNTERS 9
> +#elif (__GNUC__ >= 10)
> #define GCOV_COUNTERS 8
> #elif (__GNUC__ >= 7)
> #define GCOV_COUNTERS 9
> --
> 2.40.1
>
With "gcc (GCC) 14.1.1 20240522 (Red Hat 14.1.1-4)" on Fedora 40:
lines: 58.2% (2350 out of 4036)
functions: 72.2% (197 out of 273)
branches: 35.5% (1037 out of 2923)
calls: 0.0% (0 out of 0)
All were 0% previously.
Tested-by: Chuck Lever <chuck.lever@oracle.com>
--
Chuck Lever
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gcov: add support for GCC 14
2024-06-10 13:41 ` Chuck Lever
@ 2024-06-10 17:45 ` Andrew Morton
2024-06-12 9:14 ` Peter Oberparleiter
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2024-06-10 17:45 UTC (permalink / raw)
To: Chuck Lever; +Cc: Peter Oberparleiter, linux-kernel, allison.henderson
On Mon, 10 Jun 2024 09:41:19 -0400 Chuck Lever <chuck.lever@oracle.com> wrote:
> On Mon, Jun 10, 2024 at 11:27:43AM +0200, Peter Oberparleiter wrote:
> > Using gcov on kernels compiled with GCC 14 results in truncated 16-byte
> > long .gcda files with no usable data. To fix this, update GCOV_COUNTERS
> > to match the value defined by GCC 14.
> >
> > Tested with GCC versions 14.1.0 and 13.2.0.
> >
>
> ...
>
> Tested-by: Chuck Lever <chuck.lever@oracle.com>
I assume this problem will affect people who use gcc-14 to compile
older kernels, so I have added cc:stable to this patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gcov: add support for GCC 14
2024-06-10 17:45 ` Andrew Morton
@ 2024-06-12 9:14 ` Peter Oberparleiter
0 siblings, 0 replies; 4+ messages in thread
From: Peter Oberparleiter @ 2024-06-12 9:14 UTC (permalink / raw)
To: Andrew Morton, Chuck Lever; +Cc: linux-kernel, allison.henderson
On 10.06.2024 19:45, Andrew Morton wrote:
> On Mon, 10 Jun 2024 09:41:19 -0400 Chuck Lever <chuck.lever@oracle.com> wrote:
>> On Mon, Jun 10, 2024 at 11:27:43AM +0200, Peter Oberparleiter wrote:
>>> Using gcov on kernels compiled with GCC 14 results in truncated 16-byte
>>> long .gcda files with no usable data. To fix this, update GCOV_COUNTERS
>>> to match the value defined by GCC 14.
>>>
>>> Tested with GCC versions 14.1.0 and 13.2.0.
>>>
>>
>> ...
>>
>> Tested-by: Chuck Lever <chuck.lever@oracle.com>
>
> I assume this problem will affect people who use gcc-14 to compile
> older kernels, so I have added cc:stable to this patch.
Yes, adding this fix also to stable kernels makes sense.
--
Peter Oberparleiter
Linux on IBM Z Development - IBM Germany R&D
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-12 9:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-10 9:27 [PATCH] gcov: add support for GCC 14 Peter Oberparleiter
2024-06-10 13:41 ` Chuck Lever
2024-06-10 17:45 ` Andrew Morton
2024-06-12 9:14 ` Peter Oberparleiter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome