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

Re: [PATCH] coverage: update gcov info for newer versions of gcc


  • To: Javi Merino <javi.merino@xxxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 7 Sep 2023 16:41:59 +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=K8MqWQShLtJZF65BGOTIhLMTvQRDxJAdNyLYZVK8wYM=; b=U10HBwkkxKKzM1it4BR931RLXKOaaImxpZICcI3l7lh3D5ptQQmqefQD7ma/PL5LURWyyC6FjxdTIHk4VDgqCzy8Hfof6uCFD5fqh9pWmt3CsU4AG+9hQbxKEFpUh20JJaukC04blJe4ZocFCqY4kFl8ibaO6yOpp06Ob36OEk8TGRZwbncS3EFSUAAtkSLQnk4eiPlhRNXZxuA85Akb1/wisVVoWMOn5yxVAcxlloYsw2ZilBSf5++0KXFK+9mTB6UxH2rH75jcTCS3NsdU+Jd0Tmb/qjp28pJzDclf9O9JLKfJEtc2PjzpWgp6hDqFPsvcmPazkt85zci+n3WHqg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZZrJS4J97EsvkkAQhE6+FKxMYS+7Z0+8IWto9wsir3aPNrDsg2SCJj8xCaaOLypo91MQmjaDIvOWWH2ziPvXx09f36eh4ypw7+6J5LUj9MAhFG+P8SHDXKTUmbeBRjzd8bhrMh+o9LQMHOaycxMa5uogvpthFgzYVCb44KRXNmI9ol4ZSV9AFiX3o0wBRlLJzB/bKO861ic9ecoKHKyOCov7j12bWrEEk6r2JPRnzJ6AqlVZBKqor7B7q43Iyi5rrZpGLfayHPLlbx8E4u9nD6t0cOHpfm4mBRA2if/YUGqA+3W7Hd0zo92aOmR0F2dO/WMzrjXGs/lPJ6HCw0lS3Q==
  • 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>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 07 Sep 2023 14:42:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.09.2023 17:11, Javi Merino wrote:
> --- a/xen/common/coverage/Makefile
> +++ b/xen/common/coverage/Makefile
> @@ -5,7 +5,9 @@ obj-y += $(call cc-ifversion,-lt,0407, \
>               gcc_3_4.o, $(call cc-ifversion,-lt,0409, \
>               gcc_4_7.o, $(call cc-ifversion,-lt,0500, \
>               gcc_4_9.o, $(call cc-ifversion,-lt,0700, \
> -             gcc_5.o, gcc_7.o))))
> +             gcc_5.o, $(call cc-ifversion,-lt,1000, \
> +             gcc_7.o,  $(call cc-ifversion,-lt,1200, \
> +             gcc_10.o, gcc_12.o))))))

This is getting unwieldy, so I think we ought to try to limit the number
of different files we have. Already gcc_4_9.c and gcc_7.c specify the
same GCOV_COUNTERS and differ only in the version checks (which could be
combined). Therefore ...

> --- /dev/null
> +++ b/xen/common/coverage/gcc_10.c
> @@ -0,0 +1,31 @@
> +/*
> + *  This code provides functions to handle gcc's profiling data format
> + *  introduced with gcc 10.
> + *
> + *  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 < 100000 || GCC_VERSION > 120000
> +#error "Wrong version of GCC used to compile gcov"
> +#endif
> +
> +#define GCOV_COUNTERS 8
> +#define GCOV_UNIT_SIZE 1
> +
> +#include "gcc_4_7.c"

... this could simply re-use gcc_4_7.c directly, with just the version
check there suitably tweaked.

> --- a/xen/common/coverage/gcc_4_7.c
> +++ b/xen/common/coverage/gcc_4_7.c
> @@ -27,6 +27,7 @@
>  #  error "Wrong version of GCC used to compile gcov"
>  # endif
>  #define GCOV_COUNTERS 8
> +#define GCOV_UNIT_SIZE 1
>  #endif

If further this became a separate #ifdef, ...

> --- a/xen/common/coverage/gcc_4_9.c
> +++ b/xen/common/coverage/gcc_4_9.c
> @@ -19,6 +19,7 @@
>  #endif
>  
>  #define GCOV_COUNTERS 9
> +#define GCOV_UNIT_SIZE 1
>  
>  #include "gcc_4_7.c"
>  
> --- a/xen/common/coverage/gcc_5.c
> +++ b/xen/common/coverage/gcc_5.c
> @@ -19,6 +19,7 @@
>  #endif
>  
>  #define GCOV_COUNTERS 10
> +#define GCOV_UNIT_SIZE 1
>  
>  #include "gcc_4_7.c"
>  

... touching these two files could be avoided altogether.

Henry - afaict this was submitted after the feature submission deadline,
so you may want to consider giving it an exception.

Jan



 


Rackspace

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