From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 11 04:01:15 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 787331065670; Mon, 11 Jun 2012 04:01:15 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (unknown [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 37D508FC0C; Mon, 11 Jun 2012 04:01:15 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id q5B41AmG027130 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 10 Jun 2012 21:01:11 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.14.2/Submit) with UUCP id q5B41AP9027129; Sun, 10 Jun 2012 21:01:10 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 ([192.168.200.81]) by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA15405; Sun, 10 Jun 12 20:50:26 PDT Date: Sun, 10 Jun 2012 20:49:15 -0700 From: perryh@pluto.rain.com To: rysto32@gmail.com, avg@freebsd.org Message-Id: <4fd5cd2b.SwlSDIgKvkib2N6C%perryh@pluto.rain.com> References: <4FD490D5.1070207@FreeBSD.org> <20120610152721.3b627896@fabiankeil.de> <4FD4CD8B.1080803@FreeBSD.org> <4FD5109D.5090107@FreeBSD.org> In-Reply-To: <4FD5109D.5090107@FreeBSD.org> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-listen@fabiankeil.de Subject: Re: decoding of multi-byte nops in dtrace X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 04:01:15 -0000 Andriy Gapon wrote: > on 10/06/2012 23:40 Ryan Stone said the following: > > On Sun, Jun 10, 2012 at 12:38 PM, Andriy Gapon > > wrote: > >> Do you use -O2 or higher optimization for kernel/modules build? > >> I use only -O1. > >> > >> Here are some stats from my system: > >> $ dtrace -ln fbt::: | fgrep -c entry > >> 16876 > >> $ dtrace -ln fbt::: | fgrep -c return > >> 16729 > >> > >> So, 147 functions without return probe. > > > > Try re-compiling with -foptimize-sibling-calls. That enables > > the tail call optimization in gcc, and therefore you get many > > functions with no ret instruction (and thus no return probe in > > DTrace) Sounds as if DTrace could use an improvement to recognize and handle the tail call optimization, maybe something along the lines of: If a function has no otherwise-determined return probe and it contains a jump to the entry point of another function then it inherits that other function's return probe. I'd expect that to handle cases like int bar(...) { ... return baz; } int foo(...) { ... return bar(...); } (although probably not cases where the return in foo calls a function pointer). And no, I am not volunteering to add it -- ENOTIME :(