public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
To: michal.simek@petalogix.com
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>,
	"subrata@linux.vnet.ibm.com" <subrata@linux.vnet.ibm.com>
Subject: Re: Gcov and lcov
Date: Wed, 26 Aug 2009 14:27:17 +0200	[thread overview]
Message-ID: <4A952A25.40208@linux.vnet.ibm.com> (raw)
In-Reply-To: <4A940A11.2040706@petalogix.com>

Hi,

Michal Simek wrote:
> First of all there should be DEBUG_FS instead of DEBUG in documentation.
> diff --git a/Documentation/gcov.txt b/Documentation/gcov.txt
> index 40ec633..e7ca647 100644
> --- a/Documentation/gcov.txt
> +++ b/Documentation/gcov.txt
> @@ -47,7 +47,7 @@ Possible uses:
> 
>  Configure the kernel with:
> 
> -        CONFIG_DEBUGFS=y
> +        CONFIG_DEBUG_FS=y
>          CONFIG_GCOV_KERNEL=y

Thanks for pointing this out. This was reported before and will be fixed 
in a future kernel release.

> I am missing any option to be possible to stop capture coveradge data.

There is currently no way to turn gcov-based profiling off during run-time.

> I am running in on Microblaze and it takes me a lot of time to grap all
> gcda data from debugfs.

If you don't need coverage data for all of the kernel source, you can 
turn off option CONFIG_GCOV_PROFILE_ALL and only enable profiling for 
those directories or files which are of interest to you. This should 
greatly reduce the number of files that you need to copy and also the 
overall kernel-slowdown.

See the help text for configuration option CONFIG_GCOV_KERNEL for a 
description of how to turn profiling on for single directories or files.

> Then I would like to use lcov and generate html sites. This could be
> possible but I haven't found
> a way how to do it.
> 
> I used lcov --capture --directory . --output-file out
> 
> There is this mishmash in version string
> /home/projects/xils/_full/software/linux-monstr_eu-commit/kernel/spinlock.gcno:version
> '401*', prefer '401p'
> /home/projects/xils/_full/software/linux-monstr_eu-commit/kernel/spinlock.gcda:version
> '401*', prefer version '401p'
> 
> and then genhtml out which end with fault because my out file contain
> wrong patches where is part of path repeated.
> arch/microblaze/kernel/arch/microblaze/kernel

The warning messages you are seeing indicate that the version of gcov 
used for analyzing and the version of gcc used for compiling differ. You 
need to specify the correct gcov tool binary (the one that comes with 
the compiler used to compile the kernel) by using lcov's --gcov-tool option.

Also current lcov releases only contain support for the gcov-kernel 
infrastructure as provided by the external gcov-kernel patch. I added 
support for the new upstream infrastructure to the CVS version[*] of lcov.

Using the CVS version, you can do the following:

On the test machine:
	lcov -c --to-package coveragedata

This will create a file coveragedata which includes all .gcda files. 
Copy this file to the build machine and do:
	lcov -c --from-package coveragedata -o data.info

This will allow you to do the actual analysis of coverage data on the 
build machine. See the man page for lcov for a detailed description of 
this approach.


Regards,
   Peter Oberparleiter

[*] See http://ltp.sourceforge.net/coverage/lcov.php for instructions on 
how to obtain the CVS version of lcov


      reply	other threads:[~2009-08-26 12:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-25 15:58 Gcov and lcov Michal Simek
2009-08-26 12:27 ` 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=4A952A25.40208@linux.vnet.ibm.com \
    --to=oberpar@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@petalogix.com \
    --cc=subrata@linux.vnet.ibm.com \
    /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