summaryrefslogtreecommitdiff
path: root/sys/miscfs/procfs/procfs_linux.c
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>2010-12-20 00:25:23 +0000
committermatt <matt@NetBSD.org>2010-12-20 00:25:23 +0000
commitccde4787f75aaa1cfd08164e471c6a54740e88f3 (patch)
tree05ddb38a6627c014af25f39296ad10f973e97789 /sys/miscfs/procfs/procfs_linux.c
parent11a6824ebfdfb8ae0e6d826b797e4305a4f25d2f (diff)
Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
Diffstat (limited to 'sys/miscfs/procfs/procfs_linux.c')
-rw-r--r--sys/miscfs/procfs/procfs_linux.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sys/miscfs/procfs/procfs_linux.c b/sys/miscfs/procfs/procfs_linux.c
index 869a948fe35..2acbfade3a5 100644
--- a/sys/miscfs/procfs/procfs_linux.c
+++ b/sys/miscfs/procfs/procfs_linux.c
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_linux.c,v 1.58 2009/10/19 01:25:29 dholland Exp $ */
+/* $NetBSD: procfs_linux.c,v 1.59 2010/12/20 00:25:47 matt Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.58 2009/10/19 01:25:29 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_linux.c,v 1.59 2010/12/20 00:25:47 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -253,6 +253,8 @@ procfs_docpustat(struct lwp *curl, struct proc *p,
CPU_INFO_ITERATOR cii;
#endif
int i;
+ uint64_t nintr;
+ uint64_t nswtch;
error = ENAMETOOLONG;
bf = malloc(LBFSZ, M_TEMP, M_WAITOK);
@@ -275,6 +277,8 @@ procfs_docpustat(struct lwp *curl, struct proc *p,
#endif
i = 0;
+ nintr = 0;
+ nswtch = 0;
for (ALLCPUS) {
len += snprintf(&bf[len], LBFSZ - len,
"cpu%d %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64
@@ -286,20 +290,22 @@ procfs_docpustat(struct lwp *curl, struct proc *p,
if (len >= LBFSZ)
goto out;
i += 1;
+ nintr += CPUNAME->ci_data.cpu_nintr;
+ nswtch += CPUNAME->ci_data.cpu_nswtch;
}
len += snprintf(&bf[len], LBFSZ - len,
"disk 0 0 0 0\n"
"page %u %u\n"
"swap %u %u\n"
- "intr %u\n"
- "ctxt %u\n"
- "btime %lld\n",
+ "intr %"PRIu64"\n"
+ "ctxt %"PRIu64"\n"
+ "btime %"PRId64"\n",
uvmexp.pageins, uvmexp.pdpageouts,
uvmexp.pgswapin, uvmexp.pgswapout,
- uvmexp.intrs,
- uvmexp.swtch,
- (long long)boottime.tv_sec);
+ nintr,
+ nswtch,
+ boottime.tv_sec);
if (len >= LBFSZ)
goto out;