From owner-svn-src-head@FreeBSD.ORG Wed May 27 00:32:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98BD8106564A; Wed, 27 May 2009 00:32:49 +0000 (UTC) (envelope-from sson@freebsd.org) Received: from www.son.org (son.org [199.239.233.23]) by mx1.freebsd.org (Postfix) with ESMTP id 561978FC14; Wed, 27 May 2009 00:32:49 +0000 (UTC) (envelope-from sson@freebsd.org) Received: from NextStepNG.son.org (adsl-76-203-228-11.dsl.rcsntx.sbcglobal.net [76.203.228.11]) (authenticated bits=0) by www.son.org (8.13.6.20060614/8.13.6) with ESMTP id n4R0Im62021301; Tue, 26 May 2009 19:18:48 -0500 (CDT) Message-ID: <4A1C86E7.5060104@freebsd.org> Date: Tue, 26 May 2009 19:18:47 -0500 From: Stacey Son User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Robert Watson References: <200905262139.n4QLd9pI074530@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r192859 - in head: share/man/man4 sys/conf sys/dev/ksyms sys/kern sys/modules sys/modules/ksyms sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2009 00:32:50 -0000 Robert Watson wrote: > On Tue, 26 May 2009, Stacey Son wrote: > >> Add the ksyms(4) pseudo driver. The ksyms driver allows a process to >> get a quick snapshot of the kernel's symbol table including the symbols >> from any loaded modules (the symbols are all merged into one symbol >> table). Unlike like other implementations, this ksyms driver maps >> memory in the process memory space to store the snapshot at the time >> /dev/ksyms is opened. It also checks to see if the process has already >> a snapshot open and won't allow it to open /dev/ksyms it again until it >> closes first. This prevents kernel and process memory from being >> exhausted. Note that /dev/ksyms is used by the lockstat(1) command. >> >> Reviewed by: gallatin kib (freebsd-arch) >> Approved by: gnn (mentor) > > One downside to the once-per-process limitation is that it means a > library *and* an application using it can't both use ksyms at once. > Obviously, not a limitation for the current use, but if we start to > grow more consumers it might become one. Yes, true. One solution may be to allow it to be opened again by the same process but simply use the same memory mapping and keep a reference count. -stacey.