version 1.37, 2002/12/16 01:57:04 |
version 1.38, 2003/02/28 21:29:07 |
|
|
struct vmtotal Total; |
struct vmtotal Total; |
struct nchstats nchstats; |
struct nchstats nchstats; |
long nchcount; |
long nchcount; |
long *intrcnt; |
int *intrcnt; |
} s, s1, s2, z; |
} s, s1, s2, z; |
|
|
#include "dkstats.h" |
#include "dkstats.h" |
|
|
} |
} |
#else |
#else |
nintr = (namelist[X_EINTRCNT].n_value - |
nintr = (namelist[X_EINTRCNT].n_value - |
namelist[X_INTRCNT].n_value) / sizeof (long); |
namelist[X_INTRCNT].n_value) / sizeof (int); |
intrloc = calloc(nintr, sizeof (long)); |
intrloc = calloc(nintr, sizeof (long)); |
intrname = calloc(nintr, sizeof (long)); |
intrname = calloc(nintr, sizeof (long)); |
intrnamebuf = malloc(namelist[X_EINTRNAMES].n_value - |
intrnamebuf = malloc(namelist[X_EINTRNAMES].n_value - |
|
|
} |
} |
} |
} |
#else |
#else |
NREAD(X_INTRCNT, s->intrcnt, nintr * sizeof(long)); |
NREAD(X_INTRCNT, s->intrcnt, nintr * sizeof(int)); |
#endif |
#endif |
size = sizeof(s->time); |
size = sizeof(s->time); |
if (sysctl(cp_time_mib, 2, &s->time, &size, NULL, 0) < 0) { |
if (sysctl(cp_time_mib, 2, &s->time, &size, NULL, 0) < 0) { |
|
|
allocinfo(struct Info *s) |
allocinfo(struct Info *s) |
{ |
{ |
|
|
s->intrcnt = (long *) malloc(nintr * sizeof(long)); |
s->intrcnt = (int *) malloc(nintr * sizeof(int)); |
if (s->intrcnt == NULL) |
if (s->intrcnt == NULL) |
errx(2, "out of memory"); |
errx(2, "out of memory"); |
} |
} |
|
|
static void |
static void |
copyinfo(struct Info *from, struct Info *to) |
copyinfo(struct Info *from, struct Info *to) |
{ |
{ |
long *intrcnt; |
int *intrcnt; |
|
|
intrcnt = to->intrcnt; |
intrcnt = to->intrcnt; |
*to = *from; |
*to = *from; |