decoding of multi-byte nops in dtrace

Andriy Gapon avg at FreeBSD.org
Tue Jun 12 05:37:45 UTC 2012


on 11/06/2012 06:49 perryh at pluto.rain.com said the following:
> Sounds as if DTrace could use an improvement to recognize and handle
> the tail call optimization, maybe something along the lines of:
> 
>     If a function has no otherwise-determined return probe
>     and it contains a jump to the entry point of another function
>     then it inherits that other function's return probe.
> 
> I'd expect that to handle cases like
> 
>     int bar(...)
>     {
>         ...
>         return baz;
>     }
> 
>     int foo(...)
>     {
>         ...
>         return bar(...);
>     }
> 
> (although probably not cases where the return in foo calls a
> function pointer).  And no, I am not volunteering to add it --
> ENOTIME :(

(Open)Solaris fdt code for sparc already handles this case (last instruction in
a function being a call), but not any other implementation.
Not sure if that is for technical reasons or if nobody just bothered.

-- 
Andriy Gapon


More information about the freebsd-hackers mailing list