From owner-freebsd-hackers Tue Feb 25 4: 9:46 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B70337B401 for ; Tue, 25 Feb 2003 04:09:45 -0800 (PST) Received: from ra.dweebsoft.com (ra.dweebsoft.com [209.237.40.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id A33CD43FAF for ; Tue, 25 Feb 2003 04:09:44 -0800 (PST) (envelope-from daxbert_news@dweebsoft.com) Received: from ra.dweebsoft.com (localhost [127.0.0.1]) by ra.dweebsoft.com (8.12.6/8.12.6) with ESMTP id h1PC9is4056678 for ; Tue, 25 Feb 2003 04:09:44 -0800 (PST) (envelope-from daxbert_news@dweebsoft.com) Received: (from http@localhost) by ra.dweebsoft.com (8.12.6/8.12.3/Submit) id h1PC9iID056677 for freebsd-hackers@freebsd.org; Tue, 25 Feb 2003 04:09:44 -0800 (PST) X-Authentication-Warning: ra.dweebsoft.com: http set sender to daxbert_news@dweebsoft.com using -f Received: from 64.81.58.36 ( [64.81.58.36]) as user daxbert@localhost by ra.dweebsoft.com with HTTP; Tue, 25 Feb 2003 04:09:44 -0800 Message-ID: <1046174984.3e5b5d084ef50@ra.dweebsoft.com> Date: Tue, 25 Feb 2003 04:09:44 -0800 From: Daxbert To: "" Subject: HOWTO track resource leaks in kernel modules ? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.1 X-Originating-IP: 64.81.58.36 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi - I was thinking about making some changes to if_de.c to support a tulip card which isn't being recognized properly. To begin this process, I need to make if_de.c export a detach function so it could be unloaded from the kernel to make debugging of the module a little easier. I've implemented a detach function, which at first glance seems ok. I've run an extremely crude test by kldload / kldunload in an infinte loop for about an hour... and the system hasn't panic-ed. And memory utilization doesn't appear to have grown. However, I'd like something a bit more accurate. Where would I look for resource leaks? Is there a library or toolkit to track such things for kernel modules? Sorry for my ignorance, but most of my Unix development experience has been centered around apache modules. Thanks, --daxbert To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message