Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2013 00:52:56 +0200
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Navdeep Parhar <np@FreeBSD.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: missing DTrace FBT return probes
Message-ID:  <20130605225256.GA88585@stack.nl>
In-Reply-To: <51AFB2B3.5050105@FreeBSD.org>
References:  <51AFB2B3.5050105@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 05, 2013 at 02:50:43PM -0700, Navdeep Parhar 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.

> 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

This list is so long that the impact on kernel stack consumption may be
large. Disabling the optimization might cause stack overflows. So it
would be best to leave the optimization either on or off for a
particular platform.

Perhaps the return probe could be inserted before the tail call. This is
still wrong but at least entry and return are matched this way.

-- 
Jilles Tjoelker



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