From owner-freebsd-arch@FreeBSD.ORG Wed Jun 5 22:52:58 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9F32AF79; Wed, 5 Jun 2013 22:52:58 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 69412188D; Wed, 5 Jun 2013 22:52:58 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id C7889359320; Thu, 6 Jun 2013 00:52:56 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id A5EF628493; Thu, 6 Jun 2013 00:52:56 +0200 (CEST) Date: Thu, 6 Jun 2013 00:52:56 +0200 From: Jilles Tjoelker To: Navdeep Parhar Subject: Re: missing DTrace FBT return probes Message-ID: <20130605225256.GA88585@stack.nl> References: <51AFB2B3.5050105@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51AFB2B3.5050105@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: 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: Wed, 05 Jun 2013 22:52:58 -0000 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