xref: /onnv-gate/usr/src/cmd/avs/dsstat/dsstat.h (revision 7836:4e95154b5b7a)
1*7836SJohn.Forte@Sun.COM /*
2*7836SJohn.Forte@Sun.COM  * CDDL HEADER START
3*7836SJohn.Forte@Sun.COM  *
4*7836SJohn.Forte@Sun.COM  * The contents of this file are subject to the terms of the
5*7836SJohn.Forte@Sun.COM  * Common Development and Distribution License (the "License").
6*7836SJohn.Forte@Sun.COM  * You may not use this file except in compliance with the License.
7*7836SJohn.Forte@Sun.COM  *
8*7836SJohn.Forte@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*7836SJohn.Forte@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*7836SJohn.Forte@Sun.COM  * See the License for the specific language governing permissions
11*7836SJohn.Forte@Sun.COM  * and limitations under the License.
12*7836SJohn.Forte@Sun.COM  *
13*7836SJohn.Forte@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*7836SJohn.Forte@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*7836SJohn.Forte@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*7836SJohn.Forte@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*7836SJohn.Forte@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*7836SJohn.Forte@Sun.COM  *
19*7836SJohn.Forte@Sun.COM  * CDDL HEADER END
20*7836SJohn.Forte@Sun.COM  */
21*7836SJohn.Forte@Sun.COM /*
22*7836SJohn.Forte@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*7836SJohn.Forte@Sun.COM  * Use is subject to license terms.
24*7836SJohn.Forte@Sun.COM  */
25*7836SJohn.Forte@Sun.COM 
26*7836SJohn.Forte@Sun.COM #ifndef _DSSTAT_H
27*7836SJohn.Forte@Sun.COM #define	_DSSTAT_H
28*7836SJohn.Forte@Sun.COM 
29*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
30*7836SJohn.Forte@Sun.COM extern "C" {
31*7836SJohn.Forte@Sun.COM #endif
32*7836SJohn.Forte@Sun.COM 
33*7836SJohn.Forte@Sun.COM typedef struct vslist_s
34*7836SJohn.Forte@Sun.COM {
35*7836SJohn.Forte@Sun.COM 	char *volname;
36*7836SJohn.Forte@Sun.COM 	char *volhost;
37*7836SJohn.Forte@Sun.COM 	struct vslist_s *next;
38*7836SJohn.Forte@Sun.COM } vslist_t;
39*7836SJohn.Forte@Sun.COM 
40*7836SJohn.Forte@Sun.COM extern int mode;
41*7836SJohn.Forte@Sun.COM extern int interval;
42*7836SJohn.Forte@Sun.COM extern int iterations;
43*7836SJohn.Forte@Sun.COM extern int zflag;
44*7836SJohn.Forte@Sun.COM extern int linesout;
45*7836SJohn.Forte@Sun.COM extern short hflags;
46*7836SJohn.Forte@Sun.COM extern short dflags;
47*7836SJohn.Forte@Sun.COM extern short rflags;
48*7836SJohn.Forte@Sun.COM extern vslist_t *vs_top;
49*7836SJohn.Forte@Sun.COM 
50*7836SJohn.Forte@Sun.COM /* kstat named character limit */
51*7836SJohn.Forte@Sun.COM #define	NAMED_LEN	15
52*7836SJohn.Forte@Sun.COM 
53*7836SJohn.Forte@Sun.COM /* Mode */
54*7836SJohn.Forte@Sun.COM #define	MULTI	0x01
55*7836SJohn.Forte@Sun.COM #define	SNDR	0x02
56*7836SJohn.Forte@Sun.COM #define	IIMG	0x04
57*7836SJohn.Forte@Sun.COM #define	SDBC	0x08
58*7836SJohn.Forte@Sun.COM 
59*7836SJohn.Forte@Sun.COM /* Error codes */
60*7836SJohn.Forte@Sun.COM #define	DSSTAT_SUCCESS	0	/* Success */
61*7836SJohn.Forte@Sun.COM #define	DSSTAT_NOSTAT	1	/* No Statistics Avaiable */
62*7836SJohn.Forte@Sun.COM #define	DSSTAT_EINVAL	2	/* Invalid Argument */
63*7836SJohn.Forte@Sun.COM #define	DSSTAT_ENOMEM	3	/* No Memory Available To Get Statistics */
64*7836SJohn.Forte@Sun.COM #define	DSSTAT_EUNKNWN	4	/* Unknown Error */
65*7836SJohn.Forte@Sun.COM #define	DSSTAT_EMAP	5	/* Mapped kstat memory is invalid */
66*7836SJohn.Forte@Sun.COM 
67*7836SJohn.Forte@Sun.COM /* Report flags */
68*7836SJohn.Forte@Sun.COM #define	IIMG_MST	0x01
69*7836SJohn.Forte@Sun.COM #define	IIMG_SHD	0x02
70*7836SJohn.Forte@Sun.COM #define	IIMG_BMP	0x04
71*7836SJohn.Forte@Sun.COM #define	IIMG_OVR	0x08
72*7836SJohn.Forte@Sun.COM 
73*7836SJohn.Forte@Sun.COM #define	SNDR_PRI	0x10
74*7836SJohn.Forte@Sun.COM #define	SNDR_NET	0x20
75*7836SJohn.Forte@Sun.COM #define	SNDR_BMP	0x40
76*7836SJohn.Forte@Sun.COM 
77*7836SJohn.Forte@Sun.COM /* Display flags */
78*7836SJohn.Forte@Sun.COM #define	SUMMARY		0x01
79*7836SJohn.Forte@Sun.COM #define	READ		0x02
80*7836SJohn.Forte@Sun.COM #define	WRITE		0x04
81*7836SJohn.Forte@Sun.COM #define	TIMING		0x08
82*7836SJohn.Forte@Sun.COM #define	FLAGS		0x10
83*7836SJohn.Forte@Sun.COM #define	PCTS		0x20
84*7836SJohn.Forte@Sun.COM #define	DESTAGED	0x40
85*7836SJohn.Forte@Sun.COM #define	WRCANCEL	0x80
86*7836SJohn.Forte@Sun.COM #define	RATIO		0x100
87*7836SJohn.Forte@Sun.COM #define	ASYNC_QUEUE	0x200
88*7836SJohn.Forte@Sun.COM 
89*7836SJohn.Forte@Sun.COM /* Flag masks */
90*7836SJohn.Forte@Sun.COM #define	SNDR_REP_MASK	(SNDR_PRI | SNDR_NET | SNDR_BMP)
91*7836SJohn.Forte@Sun.COM #define	SNDR_DIS_MASK	(SUMMARY | READ | WRITE | TIMING | FLAGS | PCTS | \
92*7836SJohn.Forte@Sun.COM     RATIO | ASYNC_QUEUE)
93*7836SJohn.Forte@Sun.COM 
94*7836SJohn.Forte@Sun.COM #define	IIMG_REP_MASK	(IIMG_MST | IIMG_SHD | IIMG_BMP | IIMG_OVR)
95*7836SJohn.Forte@Sun.COM #define	IIMG_DIS_MASK	(SUMMARY | READ | WRITE | TIMING | FLAGS | PCTS | RATIO)
96*7836SJohn.Forte@Sun.COM 
97*7836SJohn.Forte@Sun.COM #define	CACHE_REP_MASK	0
98*7836SJohn.Forte@Sun.COM #define	CACHE_DIS_MASK	(SUMMARY | READ | WRITE | FLAGS | DESTAGED | WRCANCEL)
99*7836SJohn.Forte@Sun.COM 
100*7836SJohn.Forte@Sun.COM /* Field header defines */
101*7836SJohn.Forte@Sun.COM #define	DISPLAY_LINES	19
102*7836SJohn.Forte@Sun.COM #define	HEADERS_OUT	0x01	/* flag to show headers output for cycle */
103*7836SJohn.Forte@Sun.COM #define	HEADERS_BOR	0x02	/* field headers at beginning of run */
104*7836SJohn.Forte@Sun.COM #define	HEADERS_ATT	0x04	/* field headers all the time */
105*7836SJohn.Forte@Sun.COM #define	HEADERS_EXL	0x08	/* field headers every X lines */
106*7836SJohn.Forte@Sun.COM 
107*7836SJohn.Forte@Sun.COM #ifdef	__cplusplus
108*7836SJohn.Forte@Sun.COM }
109*7836SJohn.Forte@Sun.COM #endif
110*7836SJohn.Forte@Sun.COM 
111*7836SJohn.Forte@Sun.COM #endif	/* _DSSTAT_H */
112