version 1.113, 2009/10/27 23:59:49 |
version 1.114, 2009/11/22 22:22:14 |
|
|
warn("could not read vm.vmmeter"); |
warn("could not read vm.vmmeter"); |
bzero(&total, sizeof(total)); |
bzero(&total, sizeof(total)); |
} |
} |
(void)printf("%2u%2u%2u", |
(void)printf(" %u %u %u ", |
total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); |
total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); |
#define rate(x) ((((unsigned)x) + halfuptime) / uptime) /* round */ |
#define rate(x) ((((unsigned)x) + halfuptime) / uptime) /* round */ |
#define pgtok(a) ((a) * ((unsigned int)uvmexp.pagesize >> 10)) |
#define pgtok(a) ((a) * ((unsigned int)uvmexp.pagesize >> 10)) |
(void)printf("%7u %7u ", |
(void)printf("%6u %7u ", |
pgtok(total.t_avm), pgtok(total.t_free)); |
pgtok(total.t_avm), pgtok(total.t_free)); |
(void)printf("%4u ", rate(uvmexp.faults - ouvmexp.faults)); |
(void)printf("%4u ", rate(uvmexp.faults - ouvmexp.faults)); |
(void)printf("%3u ", rate(uvmexp.pdreact - ouvmexp.pdreact)); |
(void)printf("%3u ", rate(uvmexp.pdreact - ouvmexp.pdreact)); |
|
|
printhdr(void) |
printhdr(void) |
{ |
{ |
int i; |
int i; |
|
static int printedhdr; |
|
|
|
if (printedhdr && !isatty(STDOUT_FILENO)) |
|
return; |
|
|
(void)printf(" procs memory page%*s", 20, ""); |
(void)printf(" procs memory page%*s", 20, ""); |
if (ndrives > 0) |
if (ndrives > 0) |
(void)printf("%s %*straps cpu\n", |
(void)printf("%s %*straps cpu\n", |
|
|
dr_name[i][strlen(dr_name[i]) - 1]); |
dr_name[i][strlen(dr_name[i]) - 1]); |
(void)printf(" int sys cs us sy id\n"); |
(void)printf(" int sys cs us sy id\n"); |
hdrcnt = winlines - 2; |
hdrcnt = winlines - 2; |
|
printedhdr = 1; |
} |
} |
|
|
/* |
/* |