Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2013 19:47:18 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Ryan Stone <rysto32@gmail.com>
Cc:        Navdeep Parhar <np@FreeBSD.org>, freebsd-arch@FreeBSD.org
Subject:   Re: missing DTrace FBT return probes
Message-ID:  <20130606191306.P2408@besplex.bde.org>
In-Reply-To: <CAFMmRNzj2LhsdxankJV5CT6yHy8J%2BzyL-YBzFRUSKz%2Bq-ZTSNw@mail.gmail.com>
References:  <51AFB2B3.5050105@FreeBSD.org> <CAFMmRNzj2LhsdxankJV5CT6yHy8J%2BzyL-YBzFRUSKz%2Bq-ZTSNw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On Wed, 5 Jun 2013, Ryan Stone wrote:

> On Wed, Jun 5, 2013 at 5:50 PM, Navdeep Parhar <np@freebsd.org> wrote:
>
>> A large number of kernel functions have an FBT entry probe but no return
>> probe.  I believe this is due to tail call optimization by the compiler.
>> Should we disable this optimization for kernel configs that have DTrace
>> support?  The missing return probes make it very difficult to write
>> DTrace scripts that want to set flags etc. at function entry and then
>> clean them up on return.
>> ...
>
> I would be in favour of turning this on unconditionally, along with
> -fno-inline-functions-called-once and -fno-omit-frame-pointer.

Also -O2.  But -fno-inline-functions-called-once isn't even supported
by clang, and -O for clang is more like -O3 for gcc (it does excessive
inlining of even more than functions called once).
-fno-omit-frame-pointer is the default for gcc by apparently not for
clang.

> All of the
> optimizations are of dubious value and significantly impact debugging tools
> like dtrace and pmc.

Also stack traces in panics and debuggers, debuggers generally (they can
rarely find variables in inline functions, or even step over an inline
function like a non-inline function), and profiling.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130606191306.P2408>