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