aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_meter.c
diff options
context:
space:
mode:
authorThomas Moestl <tmm@FreeBSD.org>2001-03-23 03:45:17 +0000
committerThomas Moestl <tmm@FreeBSD.org>2001-03-23 03:45:17 +0000
commit368d2edce494627eafb8adb7652405eff5e4e6ae (patch)
tree6669d9e595dbb21ffd56ca8903f5a3ee8e571add /sys/vm/vm_meter.c
parentea846c773d9b3f5656c3a2d4929278711bc88053 (diff)
Notes
Diffstat (limited to 'sys/vm/vm_meter.c')
-rw-r--r--sys/vm/vm_meter.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index 6a80411ac0e99..8d3b8116b0c18 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -359,3 +359,33 @@ SYSCTL_INT(_vm_stats_misc, OID_AUTO,
SYSCTL_INT(_vm_stats_misc, OID_AUTO,
vm_page_hash_mask, CTLFLAG_RD, &vm_page_hash_mask, 0, "");
#endif
+
+/*
+ * Further sysctls used by systat: hw.nintr, hw.intrnames, hw.intrcnt.
+ * This does probably not really fit in here, but it is somehow connected.
+ * The definitions for this are machdep, but are currently defined for
+ * any architecture.
+ */
+
+/* include the machdep stuff */
+#include <machine/intrcnt.h>
+
+int nintr = INTRCNT_COUNT;
+SYSCTL_INT(_hw, OID_AUTO, nintr, CTLFLAG_RD, &nintr, 0, "Number of Interrupts");
+
+SYSCTL_OPAQUE(_hw, OID_AUTO, intrcnt, CTLFLAG_RD, &intrcnt,
+ sizeof(long) * INTRCNT_COUNT, "", "Interrupt Counts");
+
+/*
+ * We do not know the length in advance (in an MI fashion), so calculate things
+ * at run-time.
+ */
+static int
+sysctl_intrnames(SYSCTL_HANDLER_ARGS)
+{
+ return sysctl_handle_opaque(oidp, intrnames, eintrnames - intrnames,
+ req);
+}
+
+SYSCTL_PROC(_hw, OID_AUTO, intrnames, CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0,
+ sysctl_intrnames, "", "Interrupt Names");