summaryrefslogtreecommitdiffstats
path: root/sys/sys/ksyms.h
diff options
context:
space:
mode:
authorsson <sson@FreeBSD.org>2009-05-26 21:39:09 +0000
committersson <sson@FreeBSD.org>2009-05-26 21:39:09 +0000
commit527dd575556c8d79007e7a35cd752f1b46343fd2 (patch)
tree626fb22e642e1f12607624578d9f484a88a1e405 /sys/sys/ksyms.h
parente8484adb4444a310104af340656308e3b8d60088 (diff)
downloadFreeBSD-src-527dd575556c8d79007e7a35cd752f1b46343fd2.zip
FreeBSD-src-527dd575556c8d79007e7a35cd752f1b46343fd2.tar.gz
Add the ksyms(4) pseudo driver. The ksyms driver allows a process to
get a quick snapshot of the kernel's symbol table including the symbols from any loaded modules (the symbols are all merged into one symbol table). Unlike like other implementations, this ksyms driver maps memory in the process memory space to store the snapshot at the time /dev/ksyms is opened. It also checks to see if the process has already a snapshot open and won't allow it to open /dev/ksyms it again until it closes first. This prevents kernel and process memory from being exhausted. Note that /dev/ksyms is used by the lockstat(1) command. Reviewed by: gallatin kib (freebsd-arch) Approved by: gnn (mentor)
Diffstat (limited to 'sys/sys/ksyms.h')
-rw-r--r--sys/sys/ksyms.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/sys/sys/ksyms.h b/sys/sys/ksyms.h
new file mode 100644
index 0000000..71d0aad
--- /dev/null
+++ b/sys/sys/ksyms.h
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2008-2009, Stacey Son <sson@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_KSYMS_H_
+#define _SYS_KSYMS_H_
+
+#include <sys/ioccom.h>
+
+#define KIOCGSIZE _IOR('l', 1, size_t)
+#define KIOCGADDR _IOR('l', 2, void *)
+
+#endif /* _SYS_KSYMS_H_ */
OpenPOWER on IntegriCloud