1 /*	$OpenBSD: vmmeter.h,v 1.12 2003/06/02 23:28:22 millert Exp $	*/
2 /*	$NetBSD: vmmeter.h,v 1.9 1995/03/26 20:25:04 jtc Exp $	*/
3 
4 /*-
5  * Copyright (c) 1982, 1986, 1993
6  *	The Regents of the University of California.  All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of the University nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  *
32  *	@(#)vmmeter.h	8.2 (Berkeley) 7/10/94
33  */
34 
35 #ifndef	__VMMETER_H__
36 #define	__VMMETER_H__
37 
38 /*
39  * System wide statistics counters.  Look in <uvm/uvm_extern.h> for the
40  * UVM equivalent.
41  */
42 
43 /* systemwide totals computed every five seconds */
44 struct vmtotal
45 {
46 	u_int16_t t_rq;		/* length of the run queue */
47 	u_int16_t t_dw;		/* jobs in ``disk wait'' (neg priority) */
48 	u_int16_t t_pw;		/* jobs in page wait */
49 	u_int16_t t_sl;		/* jobs sleeping in core */
50 	u_int16_t t_sw;		/* swapped out runnable/short block jobs */
51 	u_int32_t t_vm;		/* total virtual memory */
52 	u_int32_t t_avm;	/* active virtual memory */
53 	u_int32_t t_rm;		/* total real memory in use */
54 	u_int32_t t_arm;	/* active real memory */
55 	u_int32_t t_vmshr;	/* shared virtual memory */
56 	u_int32_t t_avmshr;	/* active shared virtual memory */
57 	u_int32_t t_rmshr;	/* shared real memory */
58 	u_int32_t t_armshr;	/* active shared real memory */
59 	u_int32_t t_free;	/* free memory pages */
60 };
61 
62 /*
63  * Fork/vfork/rfork accounting.
64  */
65 struct  forkstat
66 {
67 	int	cntfork;	/* number of fork() calls */
68 	int	cntvfork;	/* number of vfork() calls */
69 	int	cntrfork;	/* number of rfork() calls */
70 	int	cntkthread;	/* number of kernel threads created */
71 	int	sizfork;	/* VM pages affected by fork() */
72 	int	sizvfork;	/* VM pages affected by vfork() */
73 	int	sizrfork;	/* VM pages affected by rfork() */
74 	int	sizkthread;	/* VM pages affected by kernel threads */
75 };
76 
77 /* These sysctl names are only really used by sysctl(8) */
78 #define KERN_FORKSTAT_FORK		1
79 #define KERN_FORKSTAT_VFORK		2
80 #define KERN_FORKSTAT_RFORK		3
81 #define KERN_FORKSTAT_KTHREAD		4
82 #define KERN_FORKSTAT_SIZFORK		5
83 #define KERN_FORKSTAT_SIZVFORK		6
84 #define KERN_FORKSTAT_SIZRFORK		7
85 #define KERN_FORKSTAT_SIZKTHREAD	8
86 #define KERN_FORKSTAT_MAXID		9
87 
88 #define CTL_KERN_FORKSTAT_NAMES { \
89 	{ 0, 0 }, \
90 	{ "forks", CTLTYPE_INT }, \
91 	{ "vforks", CTLTYPE_INT }, \
92 	{ "rforks", CTLTYPE_INT }, \
93 	{ "kthreads", CTLTYPE_INT }, \
94 	{ "fork_pages", CTLTYPE_INT }, \
95 	{ "vfork_pages", CTLTYPE_INT }, \
96 	{ "rfork_pages", CTLTYPE_INT }, \
97 	{ "kthread_pages", CTLTYPE_INT }, \
98 }
99 #endif /* __VMMETER_H__ */
100