xref: /original-bsd/sys/sys/vmmeter.h (revision c3e32dec)
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.1 (Berkeley) 06/02/93
8  */
9 
10 /*
11  * System wide statistics counters.
12  */
13 struct vmmeter {
14 	/*
15 	 * General system activity.
16 	 */
17 	unsigned v_swtch;	/* context switches */
18 	unsigned v_trap;	/* calls to trap */
19 	unsigned v_syscall;	/* calls to syscall() */
20 	unsigned v_intr;	/* device interrupts */
21 	unsigned v_soft;	/* software interrupts */
22 	unsigned v_faults;	/* total faults taken */
23 	/*
24 	 * Virtual memory activity.
25 	 */
26 	unsigned v_lookups;	/* object cache lookups */
27 	unsigned v_hits;	/* object cache hits */
28 	unsigned v_vm_faults;	/* number of address memory faults */
29 	unsigned v_cow_faults;	/* number of copy-on-writes */
30 	unsigned v_swpin;	/* swapins */
31 	unsigned v_swpout;	/* swapouts */
32 	unsigned v_pswpin;	/* pages swapped in */
33 	unsigned v_pswpout;	/* pages swapped out */
34 	unsigned v_pageins;	/* number of pageins */
35 	unsigned v_pageouts;	/* number of pageouts */
36 	unsigned v_pgpgin;	/* pages paged in */
37 	unsigned v_pgpgout;	/* pages paged out */
38 	unsigned v_intrans;	/* intransit blocking page faults */
39 	unsigned v_reactivated;	/* number of pages reactivated from free list */
40 	unsigned v_rev;		/* revolutions of the hand */
41 	unsigned v_scan;	/* scans in page out daemon */
42 	unsigned v_dfree;	/* pages freed by daemon */
43 	unsigned v_pfree;	/* pages freed by exiting processes */
44 	unsigned v_zfod;	/* pages zero filled on demand */
45 	unsigned v_nzfod;	/* number of zfod's created */
46 	/*
47 	 * Distribution of page usages.
48 	 */
49 	unsigned v_page_size;	/* page size in bytes */
50 	unsigned v_kernel_pages;/* number of pages in use by kernel */
51 	unsigned v_free_target;	/* number of pages desired free */
52 	unsigned v_free_min;	/* minimum number of pages desired free */
53 	unsigned v_free_count;	/* number of pages free */
54 	unsigned v_wire_count;	/* number of pages wired down */
55 	unsigned v_active_count;/* number of pages active */
56 	unsigned v_inactive_target; /* number of pages desired inactive */
57 	unsigned 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 	short	t_rq;		/* length of the run queue */
67 	short	t_dw;		/* jobs in ``disk wait'' (neg priority) */
68 	short	t_pw;		/* jobs in page wait */
69 	short	t_sl;		/* jobs sleeping in core */
70 	short	t_sw;		/* swapped out runnable/short block jobs */
71 	long	t_vm;		/* total virtual memory */
72 	long	t_avm;		/* active virtual memory */
73 	long	t_rm;		/* total real memory in use */
74 	long	t_arm;		/* active real memory */
75 	long	t_vmshr;	/* shared virtual memory */
76 	long	t_avmshr;	/* active shared virtual memory */
77 	long	t_rmshr;	/* shared real memory */
78 	long	t_armshr;	/* active shared real memory */
79 	long	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 unsigned int	dmon[NDMON+1];
106 unsigned int	smon[NSMON+1];
107 
108 /* page in time distribution counters */
109 unsigned int	pmon[NPMON+2];
110 
111 /* reclaim time distribution counters */
112 unsigned int	rmon[NRMON+2];
113 
114 int	pmonmin;
115 int	pres;
116 int	rmonmin;
117 int	rres;
118 
119 unsigned rectime;		/* accumulator for reclaim times */
120 unsigned pgintime;		/* accumulator for page in times */
121 #endif
122