version 1.82, 2015/01/19 01:53:18 |
version 1.83, 2015/01/19 18:01:13 |
|
|
#include "display.h" |
#include "display.h" |
#include "machine.h" |
#include "machine.h" |
#include "utils.h" |
#include "utils.h" |
#include "loadavg.h" |
|
|
|
static int swapmode(int *, int *); |
static int swapmode(int *, int *); |
static char *state_abbr(struct kinfo_proc *); |
static char *state_abbr(struct kinfo_proc *); |
|
|
cputime = pp->p_rtime_sec + ((pp->p_rtime_usec + 500000) / 1000000); |
cputime = pp->p_rtime_sec + ((pp->p_rtime_usec + 500000) / 1000000); |
|
|
/* calculate the base for cpu percentages */ |
/* calculate the base for cpu percentages */ |
pct = pctdouble(pp->p_pctcpu); |
pct = (double)pp->p_pctcpu / fscale; |
|
|
if (pp->p_wmesg[0]) |
if (pp->p_wmesg[0]) |
p_wait = pp->p_wmesg; |
p_wait = pp->p_wmesg; |
|
|
*/ |
*/ |
|
|
#define ORDERKEY_PCTCPU \ |
#define ORDERKEY_PCTCPU \ |
if (lresult = (pctcpu)p2->p_pctcpu - (pctcpu)p1->p_pctcpu, \ |
if ((result = (int)(p2->p_pctcpu - p1->p_pctcpu)) == 0) |
(result = lresult > 0 ? 1 : lresult < 0 ? -1 : 0) == 0) |
|
#define ORDERKEY_CPUTIME \ |
#define ORDERKEY_CPUTIME \ |
if ((result = p2->p_rtime_sec - p1->p_rtime_sec) == 0) \ |
if ((result = p2->p_rtime_sec - p1->p_rtime_sec) == 0) \ |
if ((result = p2->p_rtime_usec - p1->p_rtime_usec) == 0) |
if ((result = p2->p_rtime_usec - p1->p_rtime_usec) == 0) |
|
|
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
struct kinfo_proc *p1, *p2; |
struct kinfo_proc *p1, *p2; |
pctcpu lresult; |
|
int result; |
int result; |
|
|
/* remove one level of indirection */ |
/* remove one level of indirection */ |
|
|
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
struct kinfo_proc *p1, *p2; |
struct kinfo_proc *p1, *p2; |
pctcpu lresult; |
|
int result; |
int result; |
|
|
/* remove one level of indirection */ |
/* remove one level of indirection */ |
|
|
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
struct kinfo_proc *p1, *p2; |
struct kinfo_proc *p1, *p2; |
pctcpu lresult; |
|
int result; |
int result; |
|
|
/* remove one level of indirection */ |
/* remove one level of indirection */ |
|
|
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
struct kinfo_proc *p1, *p2; |
struct kinfo_proc *p1, *p2; |
pctcpu lresult; |
|
int result; |
int result; |
|
|
/* remove one level of indirection */ |
/* remove one level of indirection */ |
|
|
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
struct kinfo_proc *p1, *p2; |
struct kinfo_proc *p1, *p2; |
pctcpu lresult; |
|
int result; |
int result; |
|
|
/* remove one level of indirection */ |
/* remove one level of indirection */ |
|
|
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
struct kinfo_proc *p1, *p2; |
struct kinfo_proc *p1, *p2; |
pctcpu lresult; |
|
int result; |
int result; |
|
|
/* remove one level of indirection */ |
/* remove one level of indirection */ |
|
|
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp1 = (struct proc **) v1; |
struct proc **pp2 = (struct proc **) v2; |
struct proc **pp2 = (struct proc **) v2; |
struct kinfo_proc *p1, *p2; |
struct kinfo_proc *p1, *p2; |
pctcpu lresult; |
|
int result; |
int result; |
|
|
/* remove one level of indirection */ |
/* remove one level of indirection */ |