|author||Mark Johnston <markj@FreeBSD.org>||2017-08-03 00:38:13 +0000|
|committer||Mark Johnston <markj@FreeBSD.org>||2017-08-03 00:38:13 +0000|
Rework and simplify the ksyms(4) implementation.
- Store the symbol table contents in an anonymous swap-backed object. Have mmap(/dev/ksyms) map that object, and stop mapping the symbol table into the calling process in ksyms_open(). Previously we would cache a pointer to the pmap of the opening process, and mmap(/dev/ksyms) would create a mapping using the physical address found by a pmap lookup at the initial mapping address. However, this assumes that the cached pmap is valid, which may not be the case.  - Remove the ksyms ioctl interface. It appears to have been added to work around a limitation in libelf that no longer exists; see r321842. Moreover, the interface is difficult to support and isn't present in illumos. Since ksyms was added specifically to support lockstat(1), it is expected that this removal won't have any real impact. - Simplify ksyms_read() to avoid unnecessary copying. - Don't call the device handle destructor if we fail to capture a snapshot of the kernel's symbol table. devfs will do that for us. Reported by: Ilja van Sprundel <firstname.lastname@example.org>  Reviewed by: kib (previous revision) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11789
Notes: svn path=/head/; revision=321963
Diffstat (limited to 'share/man/man4/ksyms.4')
1 files changed, 1 insertions, 29 deletions
diff --git a/share/man/man4/ksyms.4 b/share/man/man4/ksyms.4
index fe10d206306d..4c70daec1e2f 100644
@@ -27,7 +27,7 @@
-.Dd April 5, 2009
+.Dd August 2, 2017
.Dt KSYMS 4
@@ -69,24 +69,6 @@ driver does not block the loading or unloading of modules into the kernel
file is open but may contain stale data.
-.Xr ioctl 2
-command codes below are defined in
-.Aq Pa sys/ksyms.h .
-The (third) argument to the
-.Xr ioctl 2
-should be a pointer to the type indicated.
-.Bl -tag -width indent -offset indent
-.It Dv KIOCGSIZE (size_t)
-Returns the total size of the current symbol table.
-This can be used when allocating a buffer to make a copy of
-the kernel symbol table.
-.It Dv KIOCGADDR (void *)
-Returns the address of the kernel symbol table mapped in
-the process memory.
.Bl -tag -width /dev/ksymsX
.It Pa /dev/ksyms
@@ -112,7 +94,6 @@ This may occur if the kernel was in the process of loading or
unloading a module.
.Sh SEE ALSO
-.Xr ioctl 2 ,
.Xr nlist 3 ,
.Xr elf 5 ,
.Xr kldload 8
@@ -152,12 +133,3 @@ file once at a time.
The process must close the
before it is allowed to open it again.
-driver uses the calling process' memory address space to store the snapshot.
-.Xr ioctl 2
-can be used to get the memory address where the symbol table is stored to
-save kernel memory.
-.Xr mmap 2
-may also be used but it will map it to another address.