From owner-freebsd-arch@FreeBSD.ORG Thu Nov 13 18:44:19 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 599DB958 for ; Thu, 13 Nov 2014 18:44:19 +0000 (UTC) Received: from mail-pd0-x22f.google.com (mail-pd0-x22f.google.com [IPv6:2607:f8b0:400e:c02::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24E59378 for ; Thu, 13 Nov 2014 18:44:19 +0000 (UTC) Received: by mail-pd0-f175.google.com with SMTP id y13so15011514pdi.6 for ; Thu, 13 Nov 2014 10:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=1WMrlrwSsNse1iW/LQMH/enyga9GmNquUGpNGvBbY6E=; b=fq1pMA0vupS0lasbSGi7Xz+kDzQtW/7D6XWVVblIQrX0PyZ5uJlyn0PGUE2p1frP5K Jvl7Ut9IOXZhVhVg9uuWCVapBic6LsiDpJp706Ac59etI0oJTwb65fzdQ684M+1srKJe uJtVWZLwiDKtcMgLSZDrxApQdPl/EiDq3RcxqG/kz1yC/4+iDUuVsh8gDl8J6QwZt3kD Mg/46ae9u8wmJMC5WswA5WZGB3ZelfzdyaehoBLk9eHcP5IwaOS6mbgwSubPmu69Jj/A sFExA7KHS4LVqplUdJ92n8z51PKEPELZ1+71/K0U7zqm/8E92zlwWnyCIV+CnBjaMu9s JAXg== X-Received: by 10.70.89.41 with SMTP id bl9mr4609739pdb.55.1415904258344; Thu, 13 Nov 2014 10:44:18 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id ev8sm25549929pdb.28.2014.11.13.10.44.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Nov 2014 10:44:17 -0800 (PST) Sender: Navdeep Parhar Message-ID: <5464FBFF.6020200@FreeBSD.org> Date: Thu, 13 Nov 2014 10:44:15 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "Grier, James" , "freebsd-arch@freebsd.org" Subject: Re: missing DTrace FBT return probes References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2014 18:44:19 -0000 On 11/13/14 08:33, Grier, James wrote: > On Wed, Jun 5, 2013 at 5:50 PM, Navdeep Parhar 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