Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Oct 2018 15:47:10 -0600
From:      Alan Somers <asomers@freebsd.org>
To:        Lev Serebryakov <lev@freebsd.org>
Cc:        cse.cem@gmail.com,  "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: What is wrong with dtrace's stack()?
Message-ID:  <CAOtMX2goztCYJXM72WNR711DEBEKAGk1zFHF=NpE4UiVAF2bAQ@mail.gmail.com>
In-Reply-To: <475670271.20181022003734@serebryakov.spb.ru>
References:  <170994671.20181021201021@serebryakov.spb.ru> <CAG6CVpVCe-8OVU%2BKEyAh8swFSAjRshNcNLN0tjAS3W8bZxyrTA@mail.gmail.com> <475670271.20181022003734@serebryakov.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Oct 21, 2018 at 3:38 PM Lev Serebryakov <lev@freebsd.org> wrote:

> Hello Conrad,
>
> Sunday, October 21, 2018, 8:21:43 PM, you wrote:
>
> > Your assembler dump offsets are in decimal.  Look for offset 0x33 =
> > +51, not +33.
>  Problem is, sosend() is not very interesting by itself, and looks like
> several layers of stack are always lost.
>
>  I see a lot of stacks like this:
>
>  kernel`lock_delay+0x42
>  kernel`soo_write+0x33
>  kernel`dofilewrite+0x79
>  kernel`sys_write+0xc3
>  kernel`amd64_syscall+0x332
>  kernel`0xffffffff8086c87d
>
>  But event sosend() doesn't call lock_delay(), so it is impossible to
> understand why do lock_delay() seen 41932 times in 60 seconds at top of the
> stack. Where are all call stack?! All these functions could not be inlined,
> as sosend() is located in other translation unit and it calls function by
> pointer, this call could not be inlined too.
>

If you're sure that the function isn't inlined, then it might be using the
tail-call optimization instead.  That would also explain the missing stack
frames, too.  If you can manually narrow the options down to a few possible
callers, then you could try adding a few SDT probes.  That's what I usually
do in cases like this.  Or, for static functions that are inlined, you can
remove the static keyword to (usually) prevent the inlining.
-Alan


>
>
> --
> Best regards,
>  Lev                            mailto:lev@FreeBSD.org
>
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>



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