ksyms pseudo driver
Kostik Belousov
kostikbel at gmail.com
Tue Jul 15 13:18:11 UTC 2008
On Tue, Jul 15, 2008 at 08:14:28AM -0500, Stacey Son wrote:
> Kostik Belousov wrote:
> >>The snapshot of the consolidated symbol table is made when /dev/ksyms is
> >>opened. The storage for the snapshot is allocated in the memory map of
> >>the calling process. No kernel address space is used for the snapshot.
> >>
> >Again, why this is done this way ? Why not creating snapshot when the
> >user process issues ioctl that supplies neccessary usermode memory
> >to the driver ?
> >
>
> The main reason it is written as a pseudo driver is so it can be used
> with standard command-line utilities. For example, see the ksyms
> example in the dtrace manual
> (http://wikis.sun.com/display/DTrace/Structs+and+Unions). I guess it
> could still be possible to do in the way you are suggesting but it would
> require a special 'cat', or something, to allocate the user space buffer
> and then pass that in driver before it starts reading the symbol table.
> You could then pipe the output of the "special ksyms cat" to the actual
> command-line program you wanted to use. Of course, if you had to use
> a "special ksyms cat" then there would be no reason to make this a
> pseudo driver. You could simply make it a system call and eliminate a
> lot of code and calls into the kernel.
Would dd bs=<some large value> work as the "special cat" ? procfs'
/proc/pid/map has the similar problem, and there was a procmap program
in ports. I believe dd is enough.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20080715/6d8ec561/attachment.pgp
More information about the freebsd-arch
mailing list