Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Feb 2016 14:20:04 -0800
From:      Mark Johnston <markj@FreeBSD.org>
To:        hiren panchasara <hiren@strugglingcoder.info>
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>
In-Reply-To: <20160229220745.GG82027@strugglingcoder.info>
References:  <20160229213933.GE82027@strugglingcoder.info> <20160229214910.GA67805@wkstn-mjohnston.west.isilon.com> <20160229214923.GF82027@strugglingcoder.info> <20160229220745.GG82027@strugglingcoder.info>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160229222004.GB67805>