xref: /original-bsd/sys/sys/vmmeter.h (revision de3f5c4e)
1 /*-
2  * Copyright (c) 1982, 1986 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)vmmeter.h	7.3 (Berkeley) 05/05/91
8  */
9 
10 /*
11  * Virtual memory related instrumentation
12  */
13 struct vmmeter
14 {
15 #define	v_first	v_swtch
16 	unsigned v_swtch;	/* context switches */
17 	unsigned v_trap;	/* calls to trap */
18 	unsigned v_syscall;	/* calls to syscall() */
19 	unsigned v_intr;	/* device interrupts */
20 	unsigned v_soft;	/* software interrupts */
21 	unsigned v_pdma;	/* pseudo-dma interrupts */
22 	unsigned v_pswpin;	/* pages swapped in */
23 	unsigned v_pswpout;	/* pages swapped out */
24 	unsigned v_pgin;	/* pageins */
25 	unsigned v_pgout;	/* pageouts */
26 	unsigned v_pgpgin;	/* pages paged in */
27 	unsigned v_pgpgout;	/* pages paged out */
28 	unsigned v_intrans;	/* intransit blocking page faults */
29 	unsigned v_pgrec;	/* total page reclaims */
30 	unsigned v_xsfrec;	/* found in free list rather than on swapdev */
31 	unsigned v_xifrec;	/* found in free list rather than in filsys */
32 	unsigned v_exfod;	/* pages filled on demand from executables */
33 	unsigned v_zfod;	/* pages zero filled on demand */
34 	unsigned v_vrfod;	/* fills of pages mapped by vread() */
35 	unsigned v_nexfod;	/* number of exfod's created */
36 	unsigned v_nzfod;	/* number of zfod's created */
37 	unsigned v_nvrfod;	/* number of vrfod's created */
38 	unsigned v_pgfrec;	/* page reclaims from free list */
39 	unsigned v_faults;	/* total faults taken */
40 	unsigned v_scan;	/* scans in page out daemon */
41 	unsigned v_rev;		/* revolutions of the hand */
42 	unsigned v_seqfree;	/* pages taken from sequential programs */
43 	unsigned v_dfree;	/* pages freed by daemon */
44 	unsigned v_fastpgrec;	/* fast reclaims in locore */
45 #ifdef tahoe
46 	unsigned v_fpe;		/* floating point emulation traps */
47 	unsigned v_align;	/* alignment emulation traps */
48 #endif
49 #define	v_last v_fastpgrec
50 	unsigned v_swpin;	/* swapins */
51 	unsigned v_swpout;	/* swapouts */
52 };
53 #ifdef KERNEL
54 struct	vmmeter cnt, rate, sum;
55 #endif
56 
57 /* systemwide totals computed every five seconds */
58 struct vmtotal
59 {
60 	short	t_rq;		/* length of the run queue */
61 	short	t_dw;		/* jobs in ``disk wait'' (neg priority) */
62 	short	t_pw;		/* jobs in page wait */
63 	short	t_sl;		/* jobs sleeping in core */
64 	short	t_sw;		/* swapped out runnable/short block jobs */
65 	long	t_vm;		/* total virtual memory */
66 	long	t_avm;		/* active virtual memory */
67 	long	t_rm;		/* total real memory in use */
68 	long	t_arm;		/* active real memory */
69 	long	t_vmtxt;	/* virtual memory used by text */
70 	long	t_avmtxt;	/* active virtual memory used by text */
71 	long	t_rmtxt;	/* real memory used by text */
72 	long	t_armtxt;	/* active real memory used by text */
73 	long	t_free;		/* free memory pages */
74 };
75 #ifdef KERNEL
76 struct	vmtotal total;
77 #endif
78 
79 /*
80  * Optional instrumentation.
81  */
82 #ifdef PGINPROF
83 
84 #define	NDMON	128
85 #define	NSMON	128
86 
87 #define	DRES	20
88 #define	SRES	5
89 
90 #define	PMONMIN	20
91 #define	PRES	50
92 #define	NPMON	64
93 
94 #define	RMONMIN	130
95 #define	RRES	5
96 #define	NRMON	64
97 
98 /* data and stack size distribution counters */
99 unsigned int	dmon[NDMON+1];
100 unsigned int	smon[NSMON+1];
101 
102 /* page in time distribution counters */
103 unsigned int	pmon[NPMON+2];
104 
105 /* reclaim time distribution counters */
106 unsigned int	rmon[NRMON+2];
107 
108 int	pmonmin;
109 int	pres;
110 int	rmonmin;
111 int	rres;
112 
113 unsigned rectime;		/* accumulator for reclaim times */
114 unsigned pgintime;		/* accumulator for page in times */
115 #endif
116