Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2011 16:24:52 -0700
From:      Artem Belevich <art@freebsd.org>
To:        David Christensen <davidch@broadcom.com>
Cc:        "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: Using Dtrace for Performance Evaluation
Message-ID:  <BANLkTin0HxinK9e5w1VDsrse_L1xSEEW5g@mail.gmail.com>
In-Reply-To: <5D267A3F22FD854F8F48B3D2B523819360D799A42B@IRVEXCHCCR01.corp.ad.broadcom.com>
References:  <5D267A3F22FD854F8F48B3D2B523819360D799A42B@IRVEXCHCCR01.corp.ad.broadcom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 5, 2011 at 1:08 PM, David Christensen <davidch@broadcom.com> wr=
ote:
> I was looking at using dtrace to help characterize performance
> for the new bxe(4) driver but I'm having problems with the very
> simple task of capturing time spent in a function. =A0The D script
> I'm using looks like the following:
>
> #pragma D option quiet
>
> fbt:if_bxe::entry
> {
> =A0 =A0 =A0 =A0self->in =3D timestamp;
> }
>
> fbt:if_bxe::return
> {
>
> =A0 =A0 =A0 =A0@callouts[((struct callout *)arg0)->c_func] =3D sum(timest=
amp -
> =A0 =A0 =A0 =A0 =A0 =A0self->in);
> }
>
> tick-10sec
> {
> =A0 =A0 =A0 =A0printa("%40a %10@d\n", @callouts);
> =A0 =A0 =A0 =A0clear(@callouts);
> =A0 =A0 =A0 =A0printf("\n");
> }
>
> BEGIN
> {
> =A0 =A0 =A0 =A0printf("%40s | %s\n", "function", "nanoseconds per second"=
);
> }
>
> After building dtrace into the kernel and loading the dtraceall
> kernel module, when I load my bxe kernel module and run "dtrace -l"
> to list all supported probes I notice that many functions have an
> entry probe but no exit probe. =A0This effectively prevents me from
> calculating timestamps on "fbt:if_bxe::return" probes. =A0Why am I
> seeing this behavior?

Tail call optimization could do that to you:
http://en.wikipedia.org/wiki/Tail_call

--Artem

>
> Dave
>
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org=
"
>



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