From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH 2/4] cover: Adding support for coverage information Date: Thu, 7 Feb 2013 11:59:39 +0000 Message-ID: <5113972B.3090802@eu.citrix.com> References: <1360236482-25452-1-git-send-email-frediano.ziglio@citrix.com> <1360236482-25452-3-git-send-email-frediano.ziglio@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1360236482-25452-3-git-send-email-frediano.ziglio@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Frediano Ziglio Cc: Konrad Rzeszutek Wilk , "Keir (Xen.org)" , Ian Campbell , Jan Beulich , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 07/02/13 11:28, Frediano Ziglio wrote: > diff --git a/xen/common/gcov/gcov.c b/xen/common/gcov/gcov.c > new file mode 100644 > index 0000000..733d020 > --- /dev/null > +++ b/xen/common/gcov/gcov.c > @@ -0,0 +1,74 @@ > +/* > + * This code maintains a list of active profiling data structures. > + * > + * Copyright IBM Corp. 2009 > + * Author(s): Peter Oberparleiter > + * > + * Uses gcc-internal data definitions. > + * Based on the gcov-kernel patch by: > + * Hubertus Franke > + * Nigel Hinds > + * Rajan Ravindran > + * Peter Oberparleiter > + * Paul Larson > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +static struct gcov_info *info_list; > +static unsigned num_info = 0; This is a bit of a nit, but you seem to remove this variable in the next patch, which is bad form. If it's not necessary, just don't add it in this patch. > + > +/* > + * __gcov_init is called by gcc-generated constructor code for each object > + * file compiled with -fprofile-arcs. > + * > + * Although this function is called only during initialization is called from > + * a .text section which is still present after initialization so not declare > + * as __init. > + */ > +void __gcov_init(struct gcov_info *info) > +{ > + /* add new profiling data structure to list */ > + info->next = info_list; > + info_list = info; > + ++num_info; Ditto. -George