Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/top/machine.c
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | |||||
char *cpustatenames[] = { | char *cpustatenames[] = { | ||||
"user", "nice", "system", "interrupt", "idle", NULL | "user", "nice", "system", "interrupt", "idle", NULL | ||||
}; | }; | ||||
/* these are for detailing the memory statistics */ | /* these are for detailing the memory statistics */ | ||||
int memory_stats[7]; | int memory_stats[7]; | ||||
char *memorynames[] = { | char *memorynames[] = { | ||||
"K Active, ", "K Inact, ", "K Wired, ", "K Cache, ", "K Buf, ", | "K Active, ", "K Inact, ", "K Laundry, ", "K Wired, ", "K Buf, ", | ||||
"K Free", NULL | "K Free", NULL | ||||
}; | }; | ||||
int arc_stats[7]; | int arc_stats[7]; | ||||
char *arcnames[] = { | char *arcnames[] = { | ||||
"K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other", | "K Total, ", "K MFU, ", "K MRU, ", "K Anon, ", "K Header, ", "K Other", | ||||
NULL | NULL | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | /* sum memory & swap statistics */ | ||||
static int swapavail = 0; | static int swapavail = 0; | ||||
static int swapfree = 0; | static int swapfree = 0; | ||||
static long bufspace = 0; | static long bufspace = 0; | ||||
static int nspgsin, nspgsout; | static int nspgsin, nspgsout; | ||||
GETSYSCTL("vfs.bufspace", bufspace); | GETSYSCTL("vfs.bufspace", bufspace); | ||||
GETSYSCTL("vm.stats.vm.v_active_count", memory_stats[0]); | GETSYSCTL("vm.stats.vm.v_active_count", memory_stats[0]); | ||||
GETSYSCTL("vm.stats.vm.v_inactive_count", memory_stats[1]); | GETSYSCTL("vm.stats.vm.v_inactive_count", memory_stats[1]); | ||||
GETSYSCTL("vm.stats.vm.v_wire_count", memory_stats[2]); | GETSYSCTL("vm.stats.vm.v_laundry_count", memory_stats[2]); | ||||
GETSYSCTL("vm.stats.vm.v_cache_count", memory_stats[3]); | GETSYSCTL("vm.stats.vm.v_wire_count", memory_stats[3]); | ||||
GETSYSCTL("vm.stats.vm.v_free_count", memory_stats[5]); | GETSYSCTL("vm.stats.vm.v_free_count", memory_stats[5]); | ||||
GETSYSCTL("vm.stats.vm.v_swappgsin", nspgsin); | GETSYSCTL("vm.stats.vm.v_swappgsin", nspgsin); | ||||
GETSYSCTL("vm.stats.vm.v_swappgsout", nspgsout); | GETSYSCTL("vm.stats.vm.v_swappgsout", nspgsout); | ||||
/* convert memory stats to Kbytes */ | /* convert memory stats to Kbytes */ | ||||
memory_stats[0] = pagetok(memory_stats[0]); | memory_stats[0] = pagetok(memory_stats[0]); | ||||
memory_stats[1] = pagetok(memory_stats[1]); | memory_stats[1] = pagetok(memory_stats[1]); | ||||
memory_stats[2] = pagetok(memory_stats[2]); | memory_stats[2] = pagetok(memory_stats[2]); | ||||
memory_stats[3] = pagetok(memory_stats[3]); | memory_stats[3] = pagetok(memory_stats[3]); | ||||
▲ Show 20 Lines • Show All 1,134 Lines • Show Last 20 Lines |