xref: /titanic_52/usr/src/cmd/sa/sa.h (revision 1cb6af97c6f66f456d4f726ef056e1ebc0f73305)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 /*
27  * Copyright 1992-1994, 2000, 2002 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 #ifndef _SA_H
32 #define	_SA_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 /*
37  * sa.h contains struct sa and defines variables used in sadc.c and sar.c.
38  * RESTRICTION: the data types defined in this file must not be changed.
39  * sar writes these types to disk as binary data and to ensure version to
40  * version compatibility they must not be changed.
41  */
42 
43 #include <sys/kstat.h>
44 
45 #ifdef	__cplusplus
46 extern "C" {
47 #endif
48 
49 typedef struct iodevinfo {
50 	struct iodevinfo *next;
51 	kstat_t *ksp;
52 	kstat_t ks;
53 	kstat_io_t kios;
54 } iodevinfo_t;
55 
56 #define	KMEM_SMALL  0		/* small KMEM request index		*/
57 #define	KMEM_LARGE  1		/* large KMEM request index		*/
58 #define	KMEM_OSIZE  2		/* outsize KMEM request index		*/
59 #define	KMEM_NCLASS 3		/* # of KMEM request classes		*/
60 
61 typedef struct kmeminfo {
62 	ulong_t	km_mem[KMEM_NCLASS];	/* amount of mem owned by KMEM	*/
63 	ulong_t	km_alloc[KMEM_NCLASS];  /* amount of mem allocated	*/
64 	ulong_t	km_fail[KMEM_NCLASS];	/* # of failed requests		*/
65 } kmeminfo_t;
66 
67 /*
68  * structure sa defines the data structure of system activity data file
69  */
70 
71 struct sa {
72 	int		valid;		/* non-zero for valid data	*/
73 	time_t		ts;		/* time stamp			*/
74 
75 	cpu_sysinfo_t	csi;		/* per-CPU system information	*/
76 	cpu_vminfo_t	cvmi;		/* per-CPU vm information	*/
77 	sysinfo_t	si;		/* global system information	*/
78 	vminfo_t	vmi;		/* global vm information	*/
79 	kmeminfo_t	kmi;		/* kernel mem allocation info	*/
80 
81 	ulong_t		szinode;	/* inode table size		*/
82 	ulong_t		szfile;		/* file table size		*/
83 	ulong_t		szproc;		/* proc table size		*/
84 	ulong_t		szlckr;		/* file record lock table size	*/
85 
86 	ulong_t		mszinode;	/* max inode table size		*/
87 	ulong_t		mszfile;	/* max file table size		*/
88 	ulong_t		mszproc;	/* max proc table size		*/
89 	ulong_t		mszlckr;	/* max file rec lock table size	*/
90 
91 	ulong_t	niodevs;		/* number of I/O devices	*/
92 
93 	/* An array of iodevinfo structs come next in the sadc files	*/
94 };
95 
96 extern struct sa sa;
97 
98 #ifdef	__cplusplus
99 }
100 #endif
101 
102 #endif /* _SA_H */
103