Date: Thu, 13 Nov 2014 10:44:15 -0800 From: Navdeep Parhar <np@FreeBSD.org> To: "Grier, James" <Grier@netapp.com>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org> Subject: Re: missing DTrace FBT return probes Message-ID: <5464FBFF.6020200@FreeBSD.org> In-Reply-To: <AD83D10D-C58C-4A6F-93B7-62592C973919@netapp.com> References: <AD83D10D-C58C-4A6F-93B7-62592C973919@netapp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 11/13/14 08:33, Grier, James wrote: > On Wed, Jun 5, 2013 at 5:50 PM, Navdeep Parhar <np at freebsd.org> wrot= e: > A large number of kernel functions have an FBT entry probe but no re= turn >> probe. I believe this is due to tail call optimization by the compiler= =2E >> Should we disable this optimization for kernel configs that have DTrac= e >> 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. >> >> A quick sample from a recent HEAD shows ~4000 out of ~27000 functions >> are missing return probes. See the list of functions in these files >> (the ones listed in entry-only.txt do not have return probes). >> >> http://people.freebsd.org/~np/entry-only.txt >> http://people.freebsd.org/~np/entry.txt >> http://people.freebsd.org/~np/return.txt >> >> Regards, >> Navdeep > > By trial and error, I discovered that it=E2=80=99s =E2=80=98-funit-at-a= -time=E2=80=99 that does the dirty work, so > using =E2=80=98-fno-unit-at-a-time=E2=80=99 with -O2 we get all the ret= urn fbt probes. I haven=E2=80=99t determined > the performance impact of this. Hmm, I thought it was -fno-optimize-sibling-calls that controlled this=20 particular optimization. These days I compile my debug kernels with -O0. There is a very=20 significant performance impact but it makes kgdb and DTrace very happy. Regards, Navdeep
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5464FBFF.6020200>