linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Peter Oberparleiter" <oberpar@linux.vnet.ibm.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Arnaldo Carvalho de Melo" <acme@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>,
	Huang Ying <ying.huang@intel.com>,
	Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH 3/4] gcov: add gcov profiling infrastructure
Date: Tue, 3 Feb 2009 16:31:39 +0100	[thread overview]
Message-ID: <20090203153139.GI29046@elte.hu> (raw)
In-Reply-To: <49883CD7.2060602@linux.vnet.ibm.com>


* Peter Oberparleiter <oberpar@linux.vnet.ibm.com> wrote:

> From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
> 
> Enable the use of GCC's coverage testing tool gcov [1] with the Linux
> kernel. gcov may be useful for:
> 
>  * debugging (has this code been reached at all?)
>  * test improvement (how do I change my test to cover these lines?)
>  * minimizing kernel configurations (do I need this option if the
>    associated code is never run?)
> 
> The profiling patch incorporates the following changes:
> 
>  * change kbuild to include profiling flags
>  * provide functions needed by profiling code
>  * present profiling data as files in debugfs
> 
> Note that on some architectures, enabling gcc's profiling option
> "-fprofile-arcs" for the entire kernel may trigger compile/link/
> run-time problems, some of which are caused by toolchain bugs and
> others which require adjustment of architecture code.
> 
> For this reason profiling the entire kernel is initially restricted
> to those architectures for which it is known to work without changes.
> This restriction can be lifted once an architecture has been tested
> and found compatible with gcc's profiling. Profiling of single files
> or directories is still available on all platforms (see config help
> text).
> 
> 
> [1] http://gcc.gnu.org/onlinedocs/gcc/Gcov.html
> 
> Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
> ---
> 
>  Documentation/gcov.txt              |  246 ++++++++++++++
>  Documentation/kernel-parameters.txt |    7 
>  Makefile                            |   11 
>  arch/Kconfig                        |    1 
>  init/main.c                         |    8 
>  kernel/Makefile                     |    1 
>  kernel/gcov/Kconfig                 |   48 ++
>  kernel/gcov/Makefile                |    3 
>  kernel/gcov/base.c                  |  145 ++++++++
>  kernel/gcov/fs.c                    |  620 ++++++++++++++++++++++++++++++++++++
>  kernel/gcov/gcc_3_4.c               |  419 ++++++++++++++++++++++++
>  kernel/gcov/gcov.h                  |  128 +++++++
>  scripts/Makefile.lib                |    9 
>  13 files changed, 1641 insertions(+), 5 deletions(-)

Nice tool - with one general observation: i'd really prefer if this was 
properly integrated with ftrace.

In particular the per object file controls are nice - those might be useful 
to seed ftrace filters as well.

So there's good synergy possible and we should reach that synergy before 
this goes upstream instead of putting it into a separate debugfs position 
with incompatible flags and concepts. Especially since user-space tools will 
pick up the gcov data so this gets hardcoded compatibility-wise very quickly 
and changing it after the fact will be harder.

Yes, it's more work and it means extending both the ftrace code and the gcov 
code - but it's very much worth it.

	Ingo

  reply	other threads:[~2009-02-03 15:32 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 12:47 [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-02-03 15:31 ` Ingo Molnar [this message]
2009-02-04 16:48   ` Peter Oberparleiter
2009-02-26  2:40 ` Li Wei
2009-02-26 10:00   ` Peter Oberparleiter
2009-02-26 10:33     ` Li Wei
2009-02-26 12:57       ` Peter Oberparleiter
2009-02-26 10:11 ` Li Wei
2009-02-26 11:46   ` Peter Oberparleiter
2009-02-26 12:08     ` Li Wei
2009-02-26 12:55       ` Peter Oberparleiter
  -- strict thread matches above, loose matches on Subject: below --
2009-02-26 13:52 Peter Oberparleiter
2009-05-07 12:45 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-05-07 12:45 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-05-07 13:46   ` Ingo Molnar
2009-05-07 13:49     ` Ingo Molnar
2009-05-08 11:10     ` Peter Oberparleiter
2009-05-11 13:17       ` Ingo Molnar
2009-05-12 13:09         ` Peter Oberparleiter
2009-05-12 13:35           ` Ingo Molnar
2009-05-08 15:44 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-05-08 15:44 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-05-12 15:38 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-05-12 15:38 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-05-19 14:24 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-05-19 14:24 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-05-19 15:00   ` Ingo Molnar
2009-05-22  8:55     ` Peter Oberparleiter
2009-05-22  9:22       ` Andi Kleen
2009-06-02 11:43 [PATCH 0/4] gcov kernel support Peter Oberparleiter
2009-06-02 11:44 ` [PATCH 3/4] gcov: add gcov profiling infrastructure Peter Oberparleiter
2009-06-02 22:03   ` Andrew Morton
2009-06-03  2:34     ` Michael Ellerman
2009-06-03 11:57     ` Peter Oberparleiter
2009-06-03 15:26       ` Peter Oberparleiter
2009-06-03 16:01         ` Michael Ellerman
2009-06-03 21:39         ` Andrew Morton
2009-06-04  8:26           ` Peter Oberparleiter
2009-06-04  8:40             ` Andrew Morton
2009-06-05 13:05           ` Peter Oberparleiter
2009-06-04  9:08         ` Amerigo Wang
2009-06-05  9:23           ` Peter Oberparleiter
2009-06-05  9:34             ` Andrew Morton
2009-06-05 10:12               ` Peter Oberparleiter
2009-06-06  8:30                 ` Michael Ellerman
2009-06-08  8:24                   ` Peter Oberparleiter
2009-06-05  9:55             ` Amerigo Wang

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=20090203153139.GI29046@elte.hu \
    --to=mingo@elte.hu \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oberpar@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=sam@ravnborg.org \
    --cc=ying.huang@intel.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;
as well as URLs for NNTP newsgroup(s).