From owner-freebsd-arch@FreeBSD.ORG Fri Jul 11 19:53:02 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 380561065671; Fri, 11 Jul 2008 19:53:02 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id 0E08A8FC19; Fri, 11 Jul 2008 19:53:01 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id m6BJr0kn000072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 11 Jul 2008 15:53:01 -0400 (EDT) X-DKIM: Sendmail DKIM Filter v2.5.3 duke.cs.duke.edu m6BJr0kn000072 Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id m6BJqWUS096410; Fri, 11 Jul 2008 15:52:32 -0400 (EDT) (envelope-from gallatin) Date: Fri, 11 Jul 2008 15:52:32 -0400 From: Andrew Gallatin To: Stacey Son Message-ID: <20080711155232.A96384@grasshopper.cs.duke.edu> References: <4875A5D2.8030902@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <4875A5D2.8030902@freebsd.org>; from sson@freebsd.org on Thu, Jul 10, 2008 at 01:01:31AM -0500 X-Operating-System: FreeBSD 4.9-RELEASE-p1 on an i386 Cc: freebsd-arch@freebsd.org Subject: Re: ksyms pseudo driver X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2008 19:53:02 -0000 Stacey Son [sson@freebsd.org] wrote: > > The reason I created this driver is for dtrace and the port of the > opensolaris lockstat(1M) command to FreeBSD. The ksyms driver allows a > process to get a quick > snapshot of the kernel symbol table including the symbols from any > loaded modules. Very cool! After doing some Solaris work, I've really missed lockstat! This would also be useful for hwpmc. > its already opened snapshot first. Of course, this requires the read() > handler to bounce the buffer into the kernel first before it is written > back out to userspace. (Maybe there is a simple way to do an userspace > to userspace copy instead?) The reason I went to all this trouble is to > keep /dev/ksyms from turning into an easy way to exhaust all the kernel > memory (unintentionally or intentionally). Instead of doing the copy in the kernel, can you just have a simple ioctl which returns the address and size of the snapshot? Then the userspace side can do the copy itself. Drew