Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Sep 1998 14:22:28 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?=)
Cc:        net@FreeBSD.ORG
Subject:   Re: FreeBSD router performance
Message-ID:  <199809061222.OAA15280@labinfo.iet.unipi.it>
In-Reply-To: <xzpvhn11klk.fsf@bilskirnir.ifi.uio.no> from "Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?=" at Sep 6, 98 02:39:00 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> Luigi Rizzo <luigi@labinfo.iet.unipi.it> writes:
> > This said, in the last days i have instrumented the networking code
> > to see how long it takes to output a packet (roughtly the last part
> > of ether_output() with the call to if_start, which is what you
> > generally get).
> 
> Mind sharing the code with us? :)

sure, it is a gross hack. I have a couple of sysctl vars that count the
number of events and the number of ticks, respectively. Then around the
interesting section of code i put calls to rdtsc(), as follows:


int my_events, my_ticks;
SYSCTL_INT(_net_link_ether, OID_AUTO, events, CTLFLAG_RW, &my_events,0,"");
SYSCTL_INT(_net_link_ether, OID_AUTO, ticks, CTLFLAG_RW, &my_ticks,0,"");

   {
	static quad_t ticks ;
	...

	ticks = rdtsc() ;
	<interesting events>
	my_ticks += (unsigned long)(rdtsc() - ticks) ;
	my_events++
	...
    }

you can read and reset the vars with sysctl.

	cheers
	luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message



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