ksyms pseudo driver

Andrew Gallatin gallatin at cs.duke.edu
Fri Jul 11 19:53:02 UTC 2008


Stacey Son [sson at 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



More information about the freebsd-arch mailing list