From owner-freebsd-net Sun Sep 6 07:16:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA21060 for freebsd-net-outgoing; Sun, 6 Sep 1998 07:16:06 -0700 (PDT) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id HAA21029 for ; Sun, 6 Sep 1998 07:16:03 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id OAA15280; Sun, 6 Sep 1998 14:22:28 +0200 From: Luigi Rizzo Message-Id: <199809061222.OAA15280@labinfo.iet.unipi.it> Subject: Re: FreeBSD router performance To: dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?=) Date: Sun, 6 Sep 1998 14:22:28 +0200 (MET DST) Cc: net@FreeBSD.ORG In-Reply-To: from "Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?=" at Sep 6, 98 02:39:00 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > Luigi Rizzo 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() ; 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