lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 3 Feb 2009 16:31:39 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>
Cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Andi Kleen <andi@...stfloor.org>,
	Huang Ying <ying.huang@...el.com>,
	Sam Ravnborg <sam@...nborg.org>
Subject: Re: [PATCH 3/4] gcov: add gcov profiling infrastructure


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

> From: Peter Oberparleiter <oberpar@...ux.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@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ