linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Steven Rostedt" <rostedt@goodmis.org>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Arnaldo Carvalho de Melo" <acme@redhat.com>,
	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: Wed, 04 Feb 2009 17:48:49 +0100	[thread overview]
Message-ID: <4989C6F1.3080900@linux.vnet.ibm.com> (raw)
In-Reply-To: <20090203153139.GI29046@elte.hu>

Ingo Molnar wrote:
> * Peter Oberparleiter <oberpar@linux.vnet.ibm.com> wrote:
>> Enable the use of GCC's coverage testing tool gcov [1] with the Linux
>> kernel. gcov may be useful for:
> 
> Nice tool - with one general observation: i'd really prefer if this was 
> properly integrated with ftrace.

I've tried to read up on ftrace and here's what I understood ftrace and
gcov have in common:

- works by inserting probes
- probes gather information when called
- data gathered is presented to user space

As for differences:

ftrace:
- traces function calls
- probing code is provided by the kernel
- presents textual data in a single file
- can enable/disable tracing as a whole or per function
- presents controls to choose a single tracer to be active

gcov:
- traces basic block transitions
- probing code is provided by gcc
- data is presented as binary file + symbolic link per compiled object
  file (including directory structure)
- probing code cannot be disabled, only data can be reset

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

If I understand you correctly, you want to be able to enable/disable
tracing per compiled object file, possibly also choose active tracers
per file. The problem I see with this approach is that with gcov,
controls for a file are created when the gcc generated constructor
function for that file is called. They also have preset names (.gcda
and .gcno files).

I don't think it's feasible to enable gcov compile flags for the entire
kernel when only a non-gcov tracer needs to be enabled. So for that, a
new mechanism is needed which registers all object files. In can imagine
that such a mechanism may be installed using some kbuild magic, but then
there's still no guarantee that controls are provided for the same set
of files that are registered with the gcov tracer.

> 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.

>From what I've understood about the ftrace mechanism, its currently far
from the point where another tracing mechanism based on a substantially
different design approach can be integrated without a major interface
rework.

As far as user-space tools are concerned - the gcov-kernel support is
designed to be used with the gcov tool (which has been around for some
time already). The only other tool which I know of that uses the
data provided by the gcov-kernel support is lcov (which is also an
established tool). These tools are there already, so I don't see a need
to hurry with merging gcov/ftrace and whatever other mechanism might fit
(oprofile and kprobes come to mind).

To summarize my point of view: if it's only about moving the gcov
directory from / to /tracing then that can easily be done. If it's
about extending ftrace's control and presentation file structure
as well as its API to support non-function call based tracers and
per-object file control and presentation then that's a very long
way to go and I would rather not delay the inclusion of the gcov
kernel infrastructure that much.


  reply	other threads:[~2009-02-04 16:49 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
2009-02-04 16:48   ` Peter Oberparleiter [this message]
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=4989C6F1.3080900@linux.vnet.ibm.com \
    --to=oberpar@linux.vnet.ibm.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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).