[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v2 2/2] coverage: update gcov info for newer versions of gcc


  • To: Javi Merino <javi.merino@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 11 Sep 2023 10:00:14 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=75BNbPyAY1wdDn9ABHQ42HIRMsPtHGo3oyWMPHCkA8I=; b=BX5yBm9uMju7HHlxXz7zgv/yHWMbvbDJs5tVqqJJnmdQeybfTs3aySS+goKB25/u0WzcoEbEddDjj5c1gbU+S5FKxfhq4orJQsUHZITE5ACVaFOzM0MsIP93ijZMdAgbIONHYl1gkx3Neq+EGGuZSkeAw6B0y7M+HW8SayxneSZDMJEVYFsgdvpl+Jt1UVDHbRWIHC/Sn/InHd+/f9OEtap1m/OKdRYA9RCRrTpaTA7bHfmPL1ilZD34tysGBXf6uLKvpxs0y29P8W0OMQ0x82JY0kd2DZjD6jIhWs1TD+ujlr14RS2BMXjK+huIHhdPNYXWyAkpSXWqiFIua0p0DA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=enV+fEx0TXQcBQrThKaCm8SFQ0Q0Gfw11r2HjITkxa7I3PrTk+IgQmhvB2JwzaIsxhCFPsX2p8nqOstI+pBpzgUnVAwX/WNOCWZYf1Vg36/fn4IlAAJYsUOKpVH5IkQlLXwjnpgOY5rdTdKwcWGvs6b9LIq2Gkt3Eby4T5XVswJIbQaispwEsFkdCZdODTwlWCXZAaSZaJyZ3+MAa+9qBa/Xtd5OMfqWSxRG8SqglLJjebEiR06Am5SRRNtuXXrFEHiBQRZh1wmz5vqhjW+ZoCCGW4uFfBVnQ48XqXbTpeFk/MfG5Erky4ZSNCX6YgbFS6oTm7X7lE+SznENcrCkig==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 11 Sep 2023 08:00:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.09.2023 18:20, Javi Merino wrote:
> Shamelessly copy changes to gcov_info structures from linux so that we
> can capture coverage for xen built with newer compilers.
> 
> Signed-off-by: Javi Merino <javi.merino@xxxxxxxxx>
> ---
>  xen/common/coverage/gcc_4_7.c | 24 +++++++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/common/coverage/gcc_4_7.c b/xen/common/coverage/gcc_4_7.c
> index ddbc9f4bb0..8f6e287474 100644
> --- a/xen/common/coverage/gcc_4_7.c
> +++ b/xen/common/coverage/gcc_4_7.c
> @@ -24,14 +24,23 @@
>  #define GCOV_COUNTERS 9
>  #elif GCC_VERSION >= 50000 && GCC_VERSION < 70000
>  #define GCOV_COUNTERS 10
> -#elif GCC_VERSION >= 70000
> +#elif GCC_VERSION >= 70000 && GCC_VERSION < 100000
>  #define GCOV_COUNTERS 9
> +#elif GCC_VERSION >= 100000
> +#define GCOV_COUNTERS 8
>  #else
>  #error "Wrong version of GCC used to compile gcov"
>  #endif

This would need adjustment if patch 1 is adjusted as suggested, then ...

>  #define GCOV_TAG_FUNCTION_LENGTH        3
>  
> +#if GCC_VERSION >= 120000
> +/* Since GCC 12.1, sizes are in BYTES and not in WORDS (4B). */
> +#define GCOV_UNIT_SIZE 4
> +#else
> +#define GCOV_UNIT_SIZE 1
> +#endif

... making the earlier group also match this one (which already works
downwards in version number space).

As to the comments (here and below): Since the version check is for
12.0, may I suggest to simply say "gcc 12" everywhere?

> @@ -89,6 +98,10 @@ struct gcov_info {
>      unsigned int version;
>      struct gcov_info *next;
>      unsigned int stamp;
> +#if (GCC_VERSION >= 120000)

Nit: Here any below parentheses likely want omitting, to match there
being none further up. Preferably with the adjustments (which again
I'd be okay doing while committing, so long as you agree)
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.