From owner-freebsd-current Sat Jan 23 08:59:33 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA21857 for freebsd-current-outgoing; Sat, 23 Jan 1999 08:59:33 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dingo.cdrom.com (castles301.castles.com [208.214.167.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA21847 for ; Sat, 23 Jan 1999 08:59:31 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (LOCALHOST [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id IAA00613; Sat, 23 Jan 1999 08:55:54 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199901231655.IAA00613@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Archie Cobbs cc: current@FreeBSD.ORG Subject: Re: kvm question In-reply-to: Your message of "Fri, 22 Jan 1999 23:48:50 PST." <199901230748.XAA14754@bubba.whistle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 23 Jan 1999 08:55:53 -0800 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I ran into an interesting problem in the process of modifying > "netstat" to understand the PF_NETGRAPH protocol family. "netstat" > uses kvm_read(), etc. to read kernel symbols. However, this doesn't > work when the symbols you're looking for are in an KLD module (eg, > ng_socket.ko) -- the symbol will not be found. > > So I added some code/hackery to look for any loaded modules and if > on named "ng_socket.ko" was found, try finding the symbol in there. > > My question is, should kvm_read() and friends be "enhanced" with > this ability to find a symbol by searching through the loaded > KLD modules? Seems a bit hackish, but then again so is the whole > kvm() idea. No; you should be using sysctl to get at the information. > I'd be willing to add this code if so.. it's not much. > > Unrelated question: SYSINIT() doesn't work from KLD modules. > Is this problem being addressed? It does; it's critical to the functioning of KLD modules in general. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message