FreeBSD Bugzilla – Attachment 14680 Details for
Bug 27522
linprocfs:/proc/stat does not handle SMP hosts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.44 KB, created by
Jim.Pirzyk
on 2001-05-22 01:00:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Jim.Pirzyk
Created:
2001-05-22 01:00:02 UTC
Size:
1.44 KB
patch
obsolete
>--- linprocfs_misc.c.orig Thu Dec 7 05:17:55 2000 >+++ linprocfs_misc.c Mon May 21 16:49:01 2001 >@@ -52,6 +52,7 @@ > #include <sys/tty.h> > #include <sys/vnode.h> > #include <sys/lock.h> >+#include <sys/sysctl.h> > > #include <vm/vm.h> > #include <vm/pmap.h> >@@ -266,20 +267,39 @@ > char *ps; > char psbuf[512]; > int xlen; >+ int ncpu, mib[2], i, olen=sizeof(ncpu), plen=0; > > ps = psbuf; > ps += sprintf(ps, >- "cpu %ld %ld %ld %ld\n" >+ "cpu %ld %ld %ld %ld\n", >+ T2J(cp_time[CP_USER]), >+ T2J(cp_time[CP_NICE]), >+ T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/), >+ T2J(cp_time[CP_IDLE])); >+ >+ mib[0] = CTL_HW; mib[1] = HW_NCPU; >+ if (kernel_sysctl(p, mib, 2, &ncpu, &olen, NULL, 0, &plen)) >+ ncpu=1; /* Fake out if the sysctl failed */ >+ >+ if ( ncpu > 1 ) { >+ for (i = 0; i < ncpu; i++) { >+ ps += sprintf(ps, >+ "cpu%d %ld %ld %ld %ld\n", >+ i, >+ T2J(cp_time[CP_USER]/ncpu), >+ T2J(cp_time[CP_NICE]/ncpu), >+ T2J(cp_time[CP_SYS]/ncpu /*+ cp_time[CP_INTR]*/), >+ T2J(cp_time[CP_IDLE]/ncpu)); >+ } >+ } >+ >+ ps+= sprintf(ps, > "disk 0 0 0 0\n" > "page %u %u\n" > "swap %u %u\n" > "intr %u\n" > "ctxt %u\n" > "btime %ld\n", >- T2J(cp_time[CP_USER]), >- T2J(cp_time[CP_NICE]), >- T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/), >- T2J(cp_time[CP_IDLE]), > cnt.v_vnodepgsin, > cnt.v_vnodepgsout, > cnt.v_swappgsin,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27522
: 14680