From owner-freebsd-arch@FreeBSD.ORG Thu Jun 6 09:47:30 2013 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5541566D; Thu, 6 Jun 2013 09:47:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail17.syd.optusnet.com.au (mail17.syd.optusnet.com.au [211.29.132.198]) by mx1.freebsd.org (Postfix) with ESMTP id A41A01450; Thu, 6 Jun 2013 09:47:29 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail17.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r569lIrv014403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Jun 2013 19:47:19 +1000 Date: Thu, 6 Jun 2013 19:47:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ryan Stone Subject: Re: missing DTrace FBT return probes In-Reply-To: Message-ID: <20130606191306.P2408@besplex.bde.org> References: <51AFB2B3.5050105@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=eqSHVfVX c=1 sm=1 a=X5W8Q6W-oCAA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=zqPWLHequagA:10 a=6I5d2MoRAAAA:8 a=jf9xk2ctTmAQp9jb1XEA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: Navdeep Parhar , freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2013 09:47:30 -0000 On Wed, 5 Jun 2013, Ryan Stone wrote: > On Wed, Jun 5, 2013 at 5:50 PM, 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. >> ... > > 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