xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: George Dunlap <george.dunlap@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Ian Jackson <ian.jackson@eu.citrix.com>,
	philippe.gabriel@citrix.com,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3] gcov: add new interface and 3.4 and 4.7 format support
Date: Wed, 12 Oct 2016 14:34:08 +0100	[thread overview]
Message-ID: <eaa40265-3b7d-0427-02be-f0a9d276f39e@citrix.com> (raw)
In-Reply-To: <91e9a42b-f444-735f-759f-6abb7eaa1b89@citrix.com>

On 12/10/16 14:26, George Dunlap wrote:
> On 12/10/16 14:24, George Dunlap wrote:
>> On 12/10/16 14:06, Wei Liu wrote:
>>> On Wed, Oct 12, 2016 at 06:42:53AM -0600, Jan Beulich wrote:
>>>>>>> On 11.10.16 at 12:31, <wei.liu2@citrix.com> wrote:
>>>>> --- /dev/null
>>>>> +++ b/xen/common/gcov/gcc_4_7.c
>>>>> @@ -0,0 +1,205 @@
>>>>> +/*
>>>>> + *  This code provides functions to handle gcc's profiling data format
>>>>> + *  introduced with gcc 4.7.
>>>>> + *
>>>>> + *  This file is based heavily on gcc_3_4.c file.
>>>>> + *
>>>>> + *  For a better understanding, refer to gcc source:
>>>>> + *  gcc/gcov-io.h
>>>>> + *  libgcc/libgcov.c
>>>>> + *
>>>>> + *  Uses gcc-internal data definitions.
>>>>> + *
>>>>> + *  Imported from Linux and modified for Xen by
>>>>> + *    Wei Liu <wei.liu2@citrix.com>
>>>>> + */
>>>>> +
>>>>> +#include <xen/string.h>
>>>>> +
>>>>> +#include "gcov.h"
>>>>> +
>>>>> +#if GCC_VERSION < 40700
>>>>> +#error "Wrong version of GCC used to compile gcov"
>>>>> +#endif
>>>>> +
>>>>> +#if (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1)
>>>>> +#define GCOV_COUNTERS                   10
>>>>> +#elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9
>>>>> +#define GCOV_COUNTERS                   9
>>>>> +#else
>>>>> +#define GCOV_COUNTERS                   8
>>>>> +#endif
>>>> I'm sorry for not having pointed this out on v2 (I had noticed it,
>>>> but then didn't finish analyzing the situation), but I'm afraid this
>>>> together with ...
>>>>
>>>>> +struct gcov_info {
>>>>> +    unsigned int version;
>>>>> +    struct gcov_info *next;
>>>>> +    unsigned int stamp;
>>>>> +    const char *filename;
>>>>> +    void (*merge[GCOV_COUNTERS])(gcov_type *, unsigned int);
>>>>> +    unsigned int n_functions;
>>>>> +    struct gcov_fn_info **functions;
>>>>> +};
>>>> ... this structure's trailing fields actually getting used by the code
>>>> won't work well when changing compiler versions without cleaning
>>>> the tree.  I think instead you need thin gcc_5.c and gcc_4_9.c
>>>> #define-ing their GCOV_COUNTERS and then #include-ing this
>>>> shared source file. Plus btw, I don't think gcc 5.0.x (the
>>>> development variant of 5.x) would use anything different from
>>>> 5.1.x or 5.2.x; in fact use of __GNUC_MINOR__ should not
>>>> normally be necessary anymore with gcc 5+.
>>>>
>>> Right. I will do something about this. Thanks for catching this.
>>>
>>>> And then - how is all of this supposed to be working in conjucntion
>>>> with live patching, where the patch may have been created by yet
>>>> another compiler version?
>>>>
>>> There is a version field in gcov_info, so we can compare that and reject
>>> incompatible version.
>>>
>>> We need to use hooks in livepatching to call the constructor /
>>> destructor when applying / reverting a live-patch.  We might need to be
>>> cautious about locks or whatever, but I'm sure it can be figured out.
>>>
>>> But I have no idea how useful it would be to use gcov and livepatching
>>> together.  For now the easiest thing to do is to
>>>
>>>    depends on !LIVEPATCH
>>>
>>> in Kconfig.
>> Wouldn't it be just as easy, and more useful, to set a "has been
>> livepatched" flag, and return errors for all gcov hypercalls if its' set?
>>
>> I would expect most users to want to build a single hypervisor that can
>> be used for both gcov testing and live patching (under different
>> circumstances).
> I mean software provider, not user, of course.  That's what I would want
> for CentOS, and I'm sure that's what the XenServer (and probably Oracle)
> guys want as well.

GCOV is majority invasive, both in terms of performance (every basic
block needs to do a locked increment of a counter) and data size
(metadata for all basic blocks).

No software vendor is ever going to have it enabled in a production
scenario.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-10-12 13:34 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  9:40 [PATCH v2 0/9] Rework gcov support in Xen Wei Liu
2016-10-10  9:40 ` [PATCH v2 1/9] Kconfig: use tab instead of space Wei Liu
2016-10-10 11:21   ` Jan Beulich
2016-10-10  9:40 ` [PATCH v2 2/9] Kconfig: add BROKEN config Wei Liu
2016-10-10 11:22   ` Jan Beulich
2016-10-10  9:40 ` [PATCH v2 3/9] xen: delete gcno files in clean target Wei Liu
2016-10-10 11:23   ` Jan Beulich
2016-10-10  9:40 ` [PATCH v2 4/9] xen, tools: rip out old gcov implementation Wei Liu
2016-10-10 11:24   ` Jan Beulich
2016-10-10  9:40 ` [PATCH v2 5/9] gcov: add new interface and 3.4 and 4.7 format support Wei Liu
2016-10-10 11:56   ` Jan Beulich
2016-10-10 12:23     ` Andrew Cooper
2016-10-10 12:56       ` Jan Beulich
2016-10-10 13:12         ` Wei Liu
2016-10-10 13:11     ` Wei Liu
2016-10-10 14:43       ` Wei Liu
2016-10-11 10:31   ` [PATCH v3] " Wei Liu
2016-10-12 12:42     ` Jan Beulich
2016-10-12 13:06       ` Wei Liu
2016-10-12 13:11         ` Jan Beulich
2016-10-12 13:24         ` George Dunlap
2016-10-12 13:26           ` George Dunlap
2016-10-12 13:31             ` Wei Liu
2016-10-12 13:33             ` Jan Beulich
2016-10-12 13:34             ` Andrew Cooper [this message]
2016-10-12 13:41               ` George Dunlap
2016-10-12 13:43                 ` Andrew Cooper
2016-10-12 13:29           ` Konrad Rzeszutek Wilk
2016-10-12 13:40             ` Wei Liu
2016-10-12 13:46               ` Konrad Rzeszutek Wilk
2016-10-12 13:50                 ` Wei Liu
2016-10-12 13:23       ` Konrad Rzeszutek Wilk
2016-10-12 13:31         ` Jan Beulich
2016-10-12 13:44           ` Konrad Rzeszutek Wilk
2016-10-12 14:08             ` Jan Beulich
2016-10-12 14:17             ` Martin Pohlack
2016-10-12 16:21               ` Konrad Rzeszutek Wilk
2016-10-13  8:05                 ` Martin Pohlack
2016-10-12 15:33       ` Wei Liu
2016-10-12 15:42         ` Jan Beulich
2016-10-12 17:07           ` Wei Liu
2016-10-13  8:29             ` Jan Beulich
2016-10-13  8:49               ` Wei Liu
2016-10-13  9:15                 ` Jan Beulich
2016-10-13  9:20                   ` Wei Liu
2016-10-10  9:40 ` [PATCH v2 6/9] gcov: userspace tools to extract and split gcov data Wei Liu
2016-10-10 15:44   ` Ian Jackson
2016-10-10  9:40 ` [PATCH v2 7/9] Config.mk: expand cc-ver a bit Wei Liu
2016-10-10 11:57   ` Jan Beulich
2016-10-10  9:40 ` [PATCH v2 8/9] Config.mk: introduce cc-ifversion Wei Liu
2016-10-10 12:00   ` Jan Beulich
2016-10-10 13:18     ` Wei Liu
2016-10-10 13:22       ` Jan Beulich
2016-10-10 13:24         ` Wei Liu
2016-10-10  9:40 ` [PATCH v2 9/9] gcov: provide the capability to select gcov format automatically Wei Liu
2016-10-10 12:00   ` Jan Beulich
2016-10-10 15:47 ` [PATCH v2 0/9] Rework gcov support in Xen Ian Jackson
2016-10-10 15:58   ` Jan Beulich

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=eaa40265-3b7d-0427-02be-f0a9d276f39e@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=philippe.gabriel@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).