1 /*- 2 * Copyright (c) 1982, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)vmmeter.h 8.2 (Berkeley) 07/10/94 8 */ 9 10 /* 11 * System wide statistics counters. 12 */ 13 struct vmmeter { 14 /* 15 * General system activity. 16 */ 17 u_int v_swtch; /* context switches */ 18 u_int v_trap; /* calls to trap */ 19 u_int v_syscall; /* calls to syscall() */ 20 u_int v_intr; /* device interrupts */ 21 u_int v_soft; /* software interrupts */ 22 u_int v_faults; /* total faults taken */ 23 /* 24 * Virtual memory activity. 25 */ 26 u_int v_lookups; /* object cache lookups */ 27 u_int v_hits; /* object cache hits */ 28 u_int v_vm_faults; /* number of address memory faults */ 29 u_int v_cow_faults; /* number of copy-on-writes */ 30 u_int v_swpin; /* swapins */ 31 u_int v_swpout; /* swapouts */ 32 u_int v_pswpin; /* pages swapped in */ 33 u_int v_pswpout; /* pages swapped out */ 34 u_int v_pageins; /* number of pageins */ 35 u_int v_pageouts; /* number of pageouts */ 36 u_int v_pgpgin; /* pages paged in */ 37 u_int v_pgpgout; /* pages paged out */ 38 u_int v_intrans; /* intransit blocking page faults */ 39 u_int v_reactivated; /* number of pages reactivated from free list */ 40 u_int v_rev; /* revolutions of the hand */ 41 u_int v_scan; /* scans in page out daemon */ 42 u_int v_dfree; /* pages freed by daemon */ 43 u_int v_pfree; /* pages freed by exiting processes */ 44 u_int v_zfod; /* pages zero filled on demand */ 45 u_int v_nzfod; /* number of zfod's created */ 46 /* 47 * Distribution of page usages. 48 */ 49 u_int v_page_size; /* page size in bytes */ 50 u_int v_kernel_pages; /* number of pages in use by kernel */ 51 u_int v_free_target; /* number of pages desired free */ 52 u_int v_free_min; /* minimum number of pages desired free */ 53 u_int v_free_count; /* number of pages free */ 54 u_int v_wire_count; /* number of pages wired down */ 55 u_int v_active_count; /* number of pages active */ 56 u_int v_inactive_target; /* number of pages desired inactive */ 57 u_int v_inactive_count; /* number of pages inactive */ 58 }; 59 #ifdef KERNEL 60 struct vmmeter cnt; 61 #endif 62 63 /* systemwide totals computed every five seconds */ 64 struct vmtotal 65 { 66 int16_t t_rq; /* length of the run queue */ 67 int16_t t_dw; /* jobs in ``disk wait'' (neg priority) */ 68 int16_t t_pw; /* jobs in page wait */ 69 int16_t t_sl; /* jobs sleeping in core */ 70 int16_t t_sw; /* swapped out runnable/short block jobs */ 71 int32_t t_vm; /* total virtual memory */ 72 int32_t t_avm; /* active virtual memory */ 73 int32_t t_rm; /* total real memory in use */ 74 int32_t t_arm; /* active real memory */ 75 int32_t t_vmshr; /* shared virtual memory */ 76 int32_t t_avmshr; /* active shared virtual memory */ 77 int32_t t_rmshr; /* shared real memory */ 78 int32_t t_armshr; /* active shared real memory */ 79 int32_t t_free; /* free memory pages */ 80 }; 81 #ifdef KERNEL 82 struct vmtotal total; 83 #endif 84 85 /* 86 * Optional instrumentation. 87 */ 88 #ifdef PGINPROF 89 90 #define NDMON 128 91 #define NSMON 128 92 93 #define DRES 20 94 #define SRES 5 95 96 #define PMONMIN 20 97 #define PRES 50 98 #define NPMON 64 99 100 #define RMONMIN 130 101 #define RRES 5 102 #define NRMON 64 103 104 /* data and stack size distribution counters */ 105 u_int dmon[NDMON+1]; 106 u_int smon[NSMON+1]; 107 108 /* page in time distribution counters */ 109 u_int pmon[NPMON+2]; 110 111 /* reclaim time distribution counters */ 112 u_int rmon[NRMON+2]; 113 114 int pmonmin; 115 int pres; 116 int rmonmin; 117 int rres; 118 119 u_int rectime; /* accumulator for reclaim times */ 120 u_int pgintime; /* accumulator for page in times */ 121 #endif 122