path: root/cddl/contrib/opensolaris/cmd/lockstat/sym.c
diff options
authorMark Johnston <markj@FreeBSD.org>2017-08-03 00:38:13 +0000
committerMark Johnston <markj@FreeBSD.org>2017-08-03 00:38:13 +0000
commit22e406c80b3f79935c9824e574240f5186202fde (patch)
treed2b44dca0b91525ca9585bb494d4030201c22687 /cddl/contrib/opensolaris/cmd/lockstat/sym.c
parent3cf56bb43a4645c786bfc8d76cca54b44289fd0a (diff)
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. [1] - 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 <ivansprundel@ioactive.com> [1] 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 'cddl/contrib/opensolaris/cmd/lockstat/sym.c')
1 files changed, 0 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/cmd/lockstat/sym.c b/cddl/contrib/opensolaris/cmd/lockstat/sym.c
index 043567102a0b..f2987a028e74 100644
--- a/cddl/contrib/opensolaris/cmd/lockstat/sym.c
+++ b/cddl/contrib/opensolaris/cmd/lockstat/sym.c
@@ -48,7 +48,6 @@
#include <kstat.h>
#include <sys/elf.h>
-#include <sys/ksyms.h>
#include <sys/param.h>
#include <sys/module.h>
#include <sys/linker.h>