1 |
On Mon, 27 Jul 2009 02:05:48 +0300 |
2 |
Mart Raudsepp <leio@g.o> wrote: |
3 |
|
4 |
> On Fri, 2009-07-24 at 12:04 +0300, Samuli Suominen wrote: |
5 |
> > Would it be OK if I change |
6 |
> > |
7 |
> > [- ] profile - Adds support for software performance analysis (will |
8 |
> > likely vary from ebuild to ebuild) |
9 |
> > |
10 |
> > To |
11 |
> > |
12 |
> > [- ] profile - Adds support for software performance analysis |
13 |
> > (WARNING: DON'T ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING.) |
14 |
> > |
15 |
> > Or something similar? Suggestions welcome. People seem to add it |
16 |
> > randomly in combination with -fomit-frame-pointer which breaks with -pg |
17 |
> > as expected. |
18 |
> |
19 |
> Note that -fomit-frame-pointer is the default with stable gcc (4.3 at |
20 |
> least) on many architectures - some of those that can still debug with |
21 |
> gdb without frame pointers thanks to location lists generated to debug |
22 |
> sections by default with -g on those platforms. This includes at least |
23 |
> amd64, and I believe x86. |
24 |
|
25 |
For x86/amd64 -fomit-frame-pointer is enabled at -O1 and higher only if |
26 |
TARGET_64BIT is true. Not sure about other archs but you can check with |
27 |
something like... |
28 |
|
29 |
dirtyepic@halo ~ $ echo "int main() { return 0; }" > test.c |
30 |
dirtyepic@halo ~ $ gcc -c test.c -Q -O2 --help=optimizers | grep fomit |
31 |
-fomit-frame-pointer [enabled] |
32 |
|
33 |
> However it might not default enable in combination with -pg, not sure |
34 |
> about that. Lets say this is a call for testing that, as combinatory |
35 |
> CFLAGS enabling -fomit-frame-pointer is your reasoning here. |
36 |
|
37 |
FRAME_POINTER_REQUIRED is defined when profiling is enabled, so |
38 |
-fomit-frame-pointer by default will be disabled. If -fomit-frame-pointer |
39 |
and -pg are both explicitly given on the command line it's an error. |
40 |
|
41 |
I think the best practise is to strip -fomit-frame-pointer when USE=profile. |
42 |
Pretty much everyone has it in their CFLAGS (useful or not), and relatively |
43 |
few packages have the option of building with profiling info. Adding a |
44 |
warning wouldn't hurt anything though. Or just change the description to |
45 |
something that doesn't sound as cool. "Build with extra debugging |
46 |
information for code coverage and branch analysis." or something. |
47 |
|
48 |
|
49 |
-- |
50 |
gcc-porting, Character is what you are in the dark. |
51 |
treecleaner, |
52 |
wxwidgets @ gentoo EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662 |