public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: gcov: enable GCOV_PROFILE_ALL for x86_64
Date: Tue, 23 Jun 2009 09:42:44 +0200	[thread overview]
Message-ID: <4A408774.9010401@linux.vnet.ibm.com> (raw)
In-Reply-To: <20090622105609.GA17456@elte.hu>

Ingo Molnar wrote:
> the GCOV code cannot be enabled in distros right now, due to the 
> high compiler-generated overhead, and due to the fact that the gcov 
> data structures used are single threaded. (which makes a gcov 
> enabled kernel very slow on SMP, due to the global cacheline 
> bounces)

I definitely agree that the gcov kernel support shouldn't be active on 
distro kernels. In my opinion that is also not a strict requirement for 
code coverage testing. If you're only looking at the resulting overall 
coverage rate, than yes, having the mechanism active all the time would 
be a good thing. But the real use of code coverage testing lies in being 
able to look at what parts of the code are not hit by a test case. That 
requires preparation (getting the source) and focus on one kernel 
version. So in my opinion, the extra effort of building and installing 
the instrumented kernel is not a limiting factor.

> IMO it would be _much_ better to implement hardware-assisted 
> call-graph tracking:
> 
>  - Use the BTS (Branch Trace Store) facilities to hardware-sample 
>    all branches+calls (optionally, dynamically enable-able)
> 
>  - Post-process the raw branch trace information (in the kernel
>    BTS-overflow irq handler) to calculate call-coverage information.
> 
> Unlike the unconditional GCC based GCOV stuff that is currently 
> upstream, BTS tracing is supported by a large range of hardware and 
> it can be enabled _transparently_, so it could be built in and 
> enabled by distros too, to test code coverage.

This is a very interesting idea. You could get branch level coverage 
information out of this. Some open questions that I could think of:
* how to map branch addresses to source code lines
* how to determine how many branches there are during initialization to 
allocate enough resources

> Would you be interested in looking at (and implementing) this?

While it sounds tempting, I don't think that I can spare the time to 
effectively work on this, so I'll have to decline.


      reply	other threads:[~2009-06-23  7:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200906182200.n5IM0jFq007278@hera.kernel.org>
2009-06-20 10:14 ` gcov: enable GCOV_PROFILE_ALL for x86_64 Ingo Molnar
2009-06-22 11:28   ` Peter Oberparleiter
2009-06-22 10:56     ` Ingo Molnar
2009-06-23  7:42       ` Peter Oberparleiter [this message]

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=4A408774.9010401@linux.vnet.ibm.com \
    --to=oberpar@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.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