From patchwork Wed Oct 18 13:45:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10014731 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C4C3560211 for ; Wed, 18 Oct 2017 13:47:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2FAF28B58 for ; Wed, 18 Oct 2017 13:47:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A68BA28B5D; Wed, 18 Oct 2017 13:47:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2D76428B58 for ; Wed, 18 Oct 2017 13:47:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4ofX-0005Wx-If; Wed, 18 Oct 2017 13:45:59 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e4ofW-0005Wo-5h for xen-devel@lists.xenproject.org; Wed, 18 Oct 2017 13:45:58 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id E0/EB-16147-51B57E95; Wed, 18 Oct 2017 13:45:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRWlGSWpSXmKPExsXS6fjDS1c4+nm kwcbbOhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a0Y//YCv6JVRy7P4elgfG1UBcjJ4eQQJ7E 99YudhCbV8BOYsODBjBbQsBQ4vTCmywgNouAqsSark+MIDabgLpE27PtrF2MHBwiAgYS544md TFycTALXGWSaFq8EqxXWEBN4s7rPnaQGl4BQYm/O4RBwswCWhIPf91igbC1JZYtfM0MUsIsIC 2x/B/HBEaeWQgNs5A0zELSMAuhYQEjyypG9eLUorLUIl0zvaSizPSMktzEzBxdQwNjvdzU4uL E9NScxKRiveT83E2MwFCqZ2Bg3MF4pc35EKMkB5OSKK/ugWeRQnxJ+SmVGYnFGfFFpTmpxYcY NTg4BLbtWn2BUYolLz8vVUmCVyPqeaSQYFFqempFWmYOMNhhSiU4eJREeE1A0rzFBYm5xZnpE KlTjLocHTfv/mESApshJc7LA1IkAFKUUZoHNwIWeZcYZaWEeRkZGBiEeApSi3IzS1DlXzGKcz AqCfPag0zhycwrgdv0CugIJqAj1jk9ATmiJBEhJdXAKHTgzaMkz9KJddq+JeU96snbn/589O5 pzKTlXvZVS5ZPPhDkGnfRIff0FTXjS+E3Wc2vvIrd9WCG2gmO1ZIpwj3OE3a8+1FyQep0ZURn O9fSUL3yF9NZlm7y1rl0Sjfod8d03b8H/c91N8cu1jrc9fSs5xxxVf37wR/XmtUkZmgp8elV6 afGKrEUZyQaajEXFScCACxocYe3AgAA X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1508334353!110917332!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24561 invoked from network); 18 Oct 2017 13:45:55 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-8.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 18 Oct 2017 13:45:55 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Wed, 18 Oct 2017 07:45:53 -0600 Message-Id: <59E777310200007800187B54@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.2 Date: Wed, 18 Oct 2017 07:45:53 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Content-Disposition: inline Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall Subject: [Xen-devel] [PATCH] gcov: support gcc 7.x X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Taking Linux commit 0538421343 ("gcov: support GCC 7.1") as reference, enable gcc 7 support requiring __gcov_exit() and having 9 counters. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Acked-by: Wei Liu --- Considering that gcc 7 has been out for a while, I think we shouldn't ship 4.10 with not even building gcov when using that compiler. --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -51,11 +51,17 @@ config GCOV_FORMAT_AUTODETECT ---help--- Automatically select gcov format based on gcc version. +config GCOV_FORMAT_7 + bool "GCC 7 format" + ---help--- + Select this option to use the format specified in GCC 7. + Works in gcc version range [7, ...). + config GCOV_FORMAT_5 bool "GCC 5 format" ---help--- Select this option to use the format specified in GCC 5. - Works in gcc version range [5, ...). + Works in gcc version range [5, 7). config GCOV_FORMAT_4_9 bool "GCC 4.9 format" --- a/xen/common/gcov/Makefile +++ b/xen/common/gcov/Makefile @@ -3,7 +3,9 @@ obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_3_4 obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_4_7.o obj-$(CONFIG_GCOV_FORMAT_4_9) += gcc_4_9.o obj-$(CONFIG_GCOV_FORMAT_5) += gcc_5.o +obj-$(CONFIG_GCOV_FORMAT_7) += gcc_7.o obj-$(CONFIG_GCOV_FORMAT_AUTODETECT) += $(call cc-ifversion,lt,0x040700, \ gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \ gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \ - gcc_4_9.o, gcc_5.o))) + gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \ + gcc_5.o, gcc_7.o)))) --- a/xen/common/gcov/gcc_5.c +++ b/xen/common/gcov/gcc_5.c @@ -1,6 +1,6 @@ /* * This code provides functions to handle gcc's profiling data format - * introduced with gcc 4.7. + * introduced with gcc 5. * * For a better understanding, refer to gcc source: * gcc/gcov-io.h @@ -14,7 +14,7 @@ #include "gcov.h" -#if GCC_VERSION < 50000 +#if GCC_VERSION < 50000 || GCC_VERSION >= 70000 #error "Wrong version of GCC used to compile gcov" #endif --- /dev/null +++ b/xen/common/gcov/gcc_7.c @@ -0,0 +1,30 @@ +/* + * This code provides functions to handle gcc's profiling data format + * introduced with gcc 7. + * + * For a better understanding, refer to gcc source: + * gcc/gcov-io.h + * libgcc/libgcov.c + * + * Uses gcc-internal data definitions. + */ + +#include "gcov.h" + +#if GCC_VERSION < 70000 +#error "Wrong version of GCC used to compile gcov" +#endif + +#define GCOV_COUNTERS 9 + +#include "gcc_4_7.c" + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ --- a/xen/common/gcov/gcov_base.c +++ b/xen/common/gcov/gcov_base.c @@ -31,6 +31,11 @@ void __init __gcov_init(struct gcov_info * These functions may be referenced by gcc-generated profiling code but serve * no function for Xen. */ +void __gcov_exit(void) +{ + /* Unused. */ +} + void __gcov_flush(void) { /* Unused. */