missing DTrace FBT return probes

Bruce Evans brde at optusnet.com.au
Thu Jun 6 09:47:30 UTC 2013



On Wed, 5 Jun 2013, Ryan Stone wrote:

> On Wed, Jun 5, 2013 at 5:50 PM, Navdeep Parhar <np at 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


More information about the freebsd-arch mailing list