Re: Do we use -fno-omit-frame-pointers by accident?

Joe Schaefer <[email protected]> Thu, 18 Jun 2026 18:46:15 -0400
Newsgroups gmane.os.freebsd.devel.hackers
Message-ID <CAOzHqcKmvkvAhoO++84PpX30VbenRVh8p=nYtRLXxdhDiMEUmA@mail.gmail.com>
Do you like it when dtrace generates symbolized stack traces? Then you want
this flag.

On Thu, Jun 18, 2026 at 4:54 PM Martin Cracauer <[email protected]> wrote:

> I was about to propose on BSDCan to turn on -fno-omit-frame-pointer
> for the base system userland and most ports.[*]
>
> So I went benchmarking the performance impact.
>
> I discovered that CFLAGS+=-fno-omit-frame-pointer changes nothing
> about our binaries and shared libraries.  CFLAGS+=-fomit-frame-pointer
> makes them a little smaller.  So it looks like we default to having
> frame pointers... somehow.  I verified in the compiler stdout that the
> flags I set are in fact in effect.
>
> Sizes for 16-current 283959bbe0863917c4fc3200a92d1055a4c89bdc /bin/sh:
>
>    text    data     bss     dec     hex filename
> - default:
>  164503    3712    5520  173735   2a6a7
> - -fomit-frame-pointer
>  163831    3712    6192  173735   2a6a7
> - -fno-omit-frame-pointer
>  164503    3712    5520  173735   2a6a7
>
>
> [*] The reason why I bring this up now is that Ubuntu is doing the
> work for use of determining which pieces of software have actually too
> high overhead with FPs.  Such as the CPython interpreter.  Depending
> on further benchmarking the base userland this changes the
> effort/benefit balance.
>
> More words here:
>
> https://docs.google.com/presentation/d/17AGf6a0IxIzqcgd4-5FWdQhLzBV9DfLEhNTm-xL0vyc/edit?usp=sharing
>
> Martin
> --
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> Martin Cracauer <[email protected]>   http://www.cons.org/cracauer/
>
>