public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: PATCH: Turn on -fomit-frame-pointer by default for 32bit  Linux/x86
@ 2010-08-04 18:52 Paul Pluzhnikov
  2010-08-04 19:13 ` H.J. Lu
  0 siblings, 1 reply; 16+ messages in thread
From: Paul Pluzhnikov @ 2010-08-04 18:52 UTC (permalink / raw)
  To: gcc-patches; +Cc: H.J. Lu"

I do not have an opinion of whether -O2 should or should not omit frame
pointers, but ...

On Mon, 2 Aug 2010 10:54:59 -0700, H.J. Lu <hjl.tools@gmail.com> wrote:

> We definitely should help our users deal with this change.
> I only propose this for Linux/x86 where backstrace in glibc
> supports unwind table. We can show them how to use
> backstrace in glibc

Unfortunately, backtrace() in glibc is not currently (glibc-2.11) usable
for getting stack traces from places that developers at Google care about;
namely from within malloc and from signal handlers.

If this patch was to go in, we'll just have to add -fno-omit-frame-pointer
for our 32-bit compiles (we already do that for 64-bit ones).

I suspect that above two "use cases" (heap operations and signal handlers)
cover vast majority of users who record stack traces, and the "just use glibc
backtrace" advice will "just not work" for them.

I can provide details, but the executive summary is that in order to allow
backtraces from malloc and from signal handlers, we use libunwind, and
even then we've had to patch glibc in some unpleasant ways, which will
not be acceptable upstream, and which (I suspect) most other users can't
afford to do.  And even after all that patching our solution is not
(yet) robust enough for general use across Google fleet, so we are using
frame-based unwinder for now.

Cheers,
-- 
Paul Pluzhnikov

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-08-05  7:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-04 18:52 PATCH: Turn on -fomit-frame-pointer by default for 32bit Linux/x86 Paul Pluzhnikov
2010-08-04 19:13 ` H.J. Lu
2010-08-04 19:24   ` Paul Pluzhnikov
2010-08-04 19:25   ` Xinliang David Li
2010-08-04 20:39   ` Andi Kleen
2010-08-04 20:57     ` David Daney
2010-08-04 21:09       ` Paul Pluzhnikov
2010-08-04 21:16         ` Andi Kleen
2010-08-04 22:07           ` Paul Pluzhnikov
2010-08-04 22:16             ` Andi Kleen
2010-08-04 22:45             ` David Daney
2010-08-05  7:00               ` Andi Kleen
2010-08-04 21:22         ` PATCH: Turn on -fomit-frame-pointer by default for 32bit Linux/x86 II Andi Kleen
2010-08-04 23:11         ` PATCH: Turn on -fomit-frame-pointer by default for 32bit Linux/x86 Richard Henderson
2010-08-05  7:23           ` Andi Kleen
2010-08-04 21:13       ` Andi Kleen

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 read-only IMAP folder(s) and NNTP newsgroup(s).