LKML Archive on lore.kernel.org
 help / color / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gcov: support GCC 7.1
Date: Thu, 24 Nov 2016 13:46:18 +0100
Message-ID: <e63a3c59-0149-c97e-4084-20ca8f146b26@suse.cz> (raw)
In-Reply-To: <85a7ed9a-4915-49d9-f17b-888b838107c6@linux.vnet.ibm.com>

On 11/09/2016 10:21 AM, Peter Oberparleiter wrote:
> On 31.10.2016 10:35, Martin Liška wrote:
>> Starting from GCC 7.1, __gcov_exit is a new symbol expected
>> to be implemented in a profiling runtime.
> 
> I tested your patch with kernel 4.9-rc4 compiled with GCC 7.0.0 20161107
> (experimental) and validated that it fixes the build error due to a
> missing __gcov_exit symbol.
> 
> An attempt to read from one of the .gcda files generated by a kernel
> compiled this way resulted in a crash though. It appears that the number
> of GCOV_COUNTERS has changed again for GCC 7.x and must be adjusted in
> the kernel as well. Could you add that to your patch as well?

Hello.

Sorry, this is fixed in second version of the patch.

> 
> Given that GCC 7.1 has not yet been released, I'm wondering if it is
> safe to program against interfaces that have not yet been fully
> finalized. Can you provide an indication on whether these gcov-related
> aspects of GCC might still be changed until release?

Well, we just flipped to stage3 which means that any new features should
be added to current master. If you prefer we can commit the patch after
a release of 7.1 will be done?

> 
> As a side note, please post your patches inline instead of as attachment
> as that helps quoting them in replies. See also
> linux/Documentation/SubmittingPatches.
> 

Sure, thanks for info. I'm attaching new version:

Starting from GCC 7.1, __gcov_exit is a new symbol expected
to be implemented in a profiling runtime. Update number of profile
counters.

Signed-off-by: Martin Liska <mliska@suse.cz>
---
 kernel/gcov/base.c    | 6 ++++++
 kernel/gcov/gcc_4_7.c | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/kernel/gcov/base.c b/kernel/gcov/base.c
index 2f9df37..85dca5d 100644
--- a/kernel/gcov/base.c
+++ b/kernel/gcov/base.c
@@ -98,6 +98,12 @@ void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters)
 }
 EXPORT_SYMBOL(__gcov_merge_icall_topn);
 
+void __gcov_exit (void)
+{
+	/* Unused. */
+}
+EXPORT_SYMBOL(__gcov_exit);
+
 /**
  * gcov_enable_events - enable event reporting through gcov_event()
  *
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
index 6a5c239..46a18e7 100644
--- a/kernel/gcov/gcc_4_7.c
+++ b/kernel/gcov/gcc_4_7.c
@@ -18,7 +18,9 @@
 #include <linux/vmalloc.h>
 #include "gcov.h"
 
-#if (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1)
+#if (__GNUC__ >= 7)
+#define GCOV_COUNTERS			9
+#elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1)
 #define GCOV_COUNTERS			10
 #elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9
 #define GCOV_COUNTERS			9
-- 
2.10.2

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-31  9:35 Martin Liška
2016-11-09  9:21 ` Peter Oberparleiter
2016-11-24 12:46   ` Martin Liška [this message]
2016-12-08 12:52     ` Peter Oberparleiter
2017-05-08 10:54       ` Peter Oberparleiter

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=e63a3c59-0149-c97e-4084-20ca8f146b26@suse.cz \
    --to=mliska@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oberpar@linux.vnet.ibm.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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git