From owner-freebsd-dtrace@freebsd.org Mon Feb 29 22:17:04 2016 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55F03AB9470 for ; Mon, 29 Feb 2016 22:17:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 298E3DA5; Mon, 29 Feb 2016 22:17:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x230.google.com with SMTP id 124so37958410pfg.0; Mon, 29 Feb 2016 14:17:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GbAuCUAPosDcqHw11L6E0C3x8Jtft2hZiS9VrrScmpc=; b=nz386pCotp8NewXPBY0Pq1xLQcQ8MAbSBgVdvlqmSgEmQDnf8XNNpeIOn5xFbi/+Fd 8PiMe+7lhA6RsrsO6VxSZGLcYE5k+R4sCgsySspF+03EvE/4DJ8x0XKI05Z7SsNQ4TWa PAhatuXAvTwkm1D1HXASKb9kVBNmR4VZYa6/LKR3Cy0P+OJbsrFiOW4yvSfXFaVx4ilJ qOV4TL5Q8aHhBtcXbLk34SMbm293hKTo9YkuV9oBJZfbZkNu04psxXyqbeuAhRxD/VxG j8X1gfsxMAtCQimlfxIx8gfaq9roTAAIe+Qtn0B/lw+OYvLbR27aHG13DlNIIjI8oSmj Sl3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=GbAuCUAPosDcqHw11L6E0C3x8Jtft2hZiS9VrrScmpc=; b=jY7NVWNqaV2aOnLjathexd8M/UYyBvCjZ41PfocJFx3qHQj8ivu+E3W+jR8vJMrXP0 O8E9+UzFHe/TvEWn7n9ezRGCKUbY3WpCFqGRjDFaUyKrRfRoBR2xNSx2lpNTO70JNSaA DFkqZsmxqNQiF3Z/Bv9CHvyvdbD0Ky/voPWOsutWob+N3RbVat44HXnT1fX2aDlFaEDz u/ZkliIYE5D7CpB3tPgQRu8HtPgWB/L5HONYvron8OD69RGc7RW0ENbxC6YzhWBn++kl OjhmbsLET299w/T2e1Zperu603dKyKazF1AErUgteyMzAPmj4rDesjAkiolD8vV8CWtM eAQg== X-Gm-Message-State: AD7BkJLPbkyYrn1uJDBh5I9i+wC5HS4Kbr71UGUnOTq3kMJ0T1nTRGp1Ib+rUJCANwMW8A== X-Received: by 10.98.64.132 with SMTP id f4mr25000586pfd.159.1456784223800; Mon, 29 Feb 2016 14:17:03 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-67-182-131-225.hsd1.wa.comcast.net. [67.182.131.225]) by smtp.gmail.com with ESMTPSA id 3sm40297379pfn.59.2016.02.29.14.17.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 14:17:03 -0800 (PST) Sender: Mark Johnston Date: Mon, 29 Feb 2016 14:20:04 -0800 From: Mark Johnston To: hiren panchasara Cc: sbruno@FreeBSD.org, freebsd-dtrace@freebsd.org Subject: Re: Functions not getting picked up by dtrace Message-ID: <20160229222004.GB67805@wkstn-mjohnston.west.isilon.com> References: <20160229213933.GE82027@strugglingcoder.info> <20160229214910.GA67805@wkstn-mjohnston.west.isilon.com> <20160229214923.GF82027@strugglingcoder.info> <20160229220745.GG82027@strugglingcoder.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160229220745.GG82027@strugglingcoder.info> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Feb 2016 22:17:04 -0000 On Mon, Feb 29, 2016 at 02:07:45PM -0800, hiren panchasara wrote: > On 02/29/16 at 01:49P, hiren panchasara wrote: > > On 02/29/16 at 01:49P, Mark Johnston wrote: > > > On Mon, Feb 29, 2016 at 01:39:33PM -0800, hiren panchasara wrote: > > > > I've seen this earlier with others too but this one is the latest > > > > confusing me: em_xmit() in $src/dev/e1000/if_em.c > > > > > > > > Other functions with similar signature are listed in 'dtrace -l'. > > > > > > em_xmit() is a static function with a single call site, so it's getting > > > inlined into its caller. DTrace FBT can't instrument inlined functions. > > > > > > > > > > > Is is because of some optimization? How do I undo it for testing > > > > purposes? > > > > > > There's a __noinline attribute that you can use for this. > > > > Thanks, Mark. > > > > cem on irc also explained the "why" part. > > Davide pointed out that it _might_ be possible that compiler change the > way it decides what to inline and non-static functions can also get > hidden that way from dtrace. Indeed: the compiler may inline a copy of a non-static function at call sites in the same compilation unit as the definition of the function. This case is more insidious since a fbt:::entry probe will exist for the function, and the only way to determine whether the function was inlined at a given call site is by examining the disassembly.