From owner-freebsd-drivers@FreeBSD.ORG Mon Jan 30 17:32:51 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B806616A420 for ; Mon, 30 Jan 2006 17:32:51 +0000 (GMT) (envelope-from bharmaji@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3227D43D45 for ; Mon, 30 Jan 2006 17:32:51 +0000 (GMT) (envelope-from bharmaji@gmail.com) Received: by wproxy.gmail.com with SMTP id 67so1261569wri for ; Mon, 30 Jan 2006 09:32:50 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=kduNuGce6pwMKyvdQyy+jgpepyyVsEfAluLPyydXsIMPknzkuhu+jQDGzylKT4x1VXrrNXh+SNVciHJvu6YOsCnKK/G7PJNCNknFFcK5HHRGgTjRrYnReiqk58ZTwKz3ZPOeTj8POva0X+M2ub4M+bR2i5gQ5BP4ab0jxjRb9Dc= Received: by 10.65.54.5 with SMTP id g5mr717082qbk; Mon, 30 Jan 2006 09:32:49 -0800 (PST) Received: by 10.65.124.18 with HTTP; Mon, 30 Jan 2006 09:32:49 -0800 (PST) Message-ID: <67beabb0601300932u50554f86i3b068258e013af02@mail.gmail.com> Date: Mon, 30 Jan 2006 09:32:49 -0800 From: Bharma Ji To: freebsd-drivers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: How to profile a driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2006 17:32:51 -0000 I am trying to optimize a driver for performance. What are the standard way= s to profile a driver? My problem at the moment is that when I run a test and max out the CPU, then the system % is 60 and user % is 30. I wanted to find out how much tim= e is being spent in the driver(and within it, if possible in what components)= . Can this be determined and if so, how to figure this out. From owner-freebsd-drivers@FreeBSD.ORG Tue Jan 31 20:24:34 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F209516A420 for ; Tue, 31 Jan 2006 20:24:34 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EE1743D49 for ; Tue, 31 Jan 2006 20:24:33 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 7424477 for multiple; Tue, 31 Jan 2006 15:24:33 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k0VKOSNA086158; Tue, 31 Jan 2006 15:24:31 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Tue, 31 Jan 2006 13:59:33 -0500 User-Agent: KMail/1.9.1 References: <67beabb0601300932u50554f86i3b068258e013af02@mail.gmail.com> In-Reply-To: <67beabb0601300932u50554f86i3b068258e013af02@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601311359.34539.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1263/Tue Jan 31 09:48:20 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Bharma Ji Subject: Re: How to profile a driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2006 20:24:35 -0000 On Monday 30 January 2006 12:32, Bharma Ji wrote: > I am trying to optimize a driver for performance. What are the standard > ways to profile a driver? > > My problem at the moment is that when I run a test and max out the CPU, > then the system % is 60 and user % is 30. I wanted to find out how much > time is being spent in the driver(and within it, if possible in what > components). Can this be determined and if so, how to figure this out. There aren't currently any really good tools for this, but one very useful thing you can try is including KTR in your kernel and turn on KTR_SCHED traces while you run your test, then use ktrdump to dump the events to a file and use schedgraph.py to look at the results, it will pop up a window showing you the scheduler activity (which threads ran when and for how-long, etc.) on a timeline. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-drivers@FreeBSD.ORG Tue Jan 31 20:24:35 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 04B9A16A422 for ; Tue, 31 Jan 2006 20:24:35 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1ECB343D48 for ; Tue, 31 Jan 2006 20:24:33 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 7424474 for multiple; Tue, 31 Jan 2006 15:24:31 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k0VKOSN9086158; Tue, 31 Jan 2006 15:24:29 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Tue, 31 Jan 2006 13:57:48 -0500 User-Agent: KMail/1.9.1 References: <37E27EAC319870439379BF42DD12767E01243200@fas-exch-01.FAS.ADS> In-Reply-To: <37E27EAC319870439379BF42DD12767E01243200@fas-exch-01.FAS.ADS> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601311357.49721.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1263/Tue Jan 31 09:48:20 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Jared Curtis Subject: Re: Adding new device id's for ATH driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2006 20:24:35 -0000 On Friday 27 January 2006 19:11, Jared Curtis wrote: > Hello, > > This is my first post to this list and I think it's going to be a good > one ;). > > I just recently bought a HP nx6125 laptop > (http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/321957-64295-89315-321838 > -f33-471753.html > hp.com/wwpc/us/en/sm/WF05a/321957-64295-89315-321838-f33-471753.html> ) > that came with a Broadcom bcm4309 wifi card (mini pci). I was aware that > this card was not supported by FreeBSD and I planned on switching it out > for an Atheros card (sorry I don't have the exact card handy). When I > swapped the cards I found out that the HP bios has a lockout feature > that checks to verify that only the white listed cards are installed. > After some searching I found a tutorial on installing a Atheros card > into the nx6125 (http://www.dagarlas.org/stuff/computing/article0001.php > .org/stuff/computing/article0001.php> ) but it was for a Linux system > using the MadWifi driver. I followed all the steps and changed the > device id to match that of the Broadcom card and now the laptop boots > fine with the Atheros card :). But now I need to modify the drivers to > recognize the new device id so that they will work with the card. > > I modified ah_devid.h and changed out the id's that matched the > originals on the Atheros card to now match the Broadcom id's. I then > rebuilt the modules and loaded them. They load fine but the card > doesn't show up in an ifconfig. > > I was given this link > http://www.demarctech.com/techsupport/rw-wireless-cards-support/free-bsd > -setup.htm > ch.com/techsupport/rw-wireless-cards-support/free-bsd-setup.htm> but it > is for a pccard devices does a similar concept work for mini pci > devices? > > > And now to my question. Could someone who is more familiar with the ATH > driver please point me in the right direction on what files need to be > changed to make the ATH driver work with my new Broadcom id's. I can > provide more details such as specific hardware info and device id's if > someone will be able to assist me. > > Thanks in advance for any help you can provide. I think the list is hardcoded into the binary-only HAL. The person to ask is sam@FreeBSD.org. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org