version 1.13, 2002/02/16 21:27:54 |
version 1.14, 2002/06/18 00:46:48 |
|
|
static double lccpu; |
static double lccpu; |
|
|
WINDOW * |
WINDOW * |
openpigs() |
openpigs(void) |
{ |
{ |
return (subwin(stdscr, LINES-5-1, 0, 5, 0)); |
return (subwin(stdscr, LINES-5-1, 0, 5, 0)); |
} |
} |
|
|
void |
void |
closepigs(w) |
closepigs(WINDOW *w) |
WINDOW *w; |
|
{ |
{ |
if (w == NULL) |
if (w == NULL) |
return; |
return; |
|
|
|
|
|
|
void |
void |
showpigs() |
showpigs(void) |
{ |
{ |
int i, j, y, k; |
int i, j, y, k; |
struct eproc *ep; |
struct eproc *ep; |
|
|
} |
} |
|
|
if (total < 1.0) |
if (total < 1.0) |
total = 1.0; |
total = 1.0; |
factor = 50.0/total; |
factor = 50.0/total; |
|
|
qsort(pt, nproc + 1, sizeof (struct p_times), compar); |
qsort(pt, nproc + 1, sizeof (struct p_times), compar); |
|
|
struct loadavg sysload; |
struct loadavg sysload; |
|
|
int |
int |
initpigs() |
initpigs(void) |
{ |
{ |
static int sysload_mib[] = {CTL_VM, VM_LOADAVG}; |
static int sysload_mib[] = {CTL_VM, VM_LOADAVG}; |
static int cp_time_mib[] = { CTL_KERN, KERN_CPTIME }; |
static int cp_time_mib[] = { CTL_KERN, KERN_CPTIME }; |
|
|
} |
} |
|
|
void |
void |
fetchpigs() |
fetchpigs(void) |
{ |
{ |
static int cp_time_mib[] = { CTL_KERN, KERN_CPTIME }; |
static int cp_time_mib[] = { CTL_KERN, KERN_CPTIME }; |
static int lastnproc = 0; |
static int lastnproc = 0; |
|
|
} |
} |
|
|
void |
void |
labelpigs() |
labelpigs(void) |
{ |
{ |
wmove(wnd, 0, 0); |
wmove(wnd, 0, 0); |
wclrtoeol(wnd); |
wclrtoeol(wnd); |
|
|
} |
} |
|
|
int |
int |
compar(a, b) |
compar(const void *a, const void *b) |
const void *a, *b; |
|
{ |
{ |
return (((struct p_times *) a)->pt_pctcpu > |
return (((struct p_times *) a)->pt_pctcpu > |
((struct p_times *) b)->pt_pctcpu)? -1: 1; |
((struct p_times *) b)->pt_pctcpu)? -1: 1; |
} |
} |