xref: /titanic_44/usr/src/cmd/avs/dsstat/ii_stats.h (revision fcf3ce441efd61da9bb2884968af01cb7c1452cc)
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 _II_STATS_H
27 #define	_II_STATS_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 #define	GOT_SETSTAT	0x01
34 #define	GOT_MSTSTAT	0x02
35 #define	GOT_SHDSTAT	0x04
36 #define	GOT_BMPSTAT	0x08
37 #define	GOT_OVRSTAT	0x10
38 
39 #define	GOT_COMPLETE_IIMG (GOT_SETSTAT|GOT_MSTSTAT|GOT_SHDSTAT|GOT_BMPSTAT)
40 
41 #define	IIMG_COMPLETE(x) (((x) & (GOT_COMPLETE_IIMG)) != (GOT_COMPLETE_IIMG))
42 
43 /* II strings */
44 #define	II_KSTAT_MODULE	"ii"
45 #define	II_KSTAT_CLASS	"iiset"
46 
47 #define	II_DISABLED	"<<set disabled>>"
48 #define	II_INDEPENDENT	"I"
49 #define	II_DEPENDENT	"D"
50 #define	II_COPYING	"C"
51 #define	II_MASTER	"mst"
52 #define	II_SHADOW	"shd"
53 #define	II_BITMAP	"bmp"
54 #define	II_OVERFLOW	"ovr"
55 
56 
57 typedef struct iistat_s
58 {
59 	kstat_t *pre_set;
60 	kstat_t *pre_mst;
61 	kstat_t *pre_shd;
62 	kstat_t *pre_bmp;
63 	kstat_t *pre_ovr;
64 	kstat_t *cur_set;
65 	kstat_t *cur_mst;
66 	kstat_t *cur_shd;
67 	kstat_t *cur_bmp;
68 	kstat_t *cur_ovr;
69 	int collected;
70 	struct iistat_s *next;
71 } iistat_t;
72 
73 /* Prototypes */
74 int ii_discover(kstat_ctl_t *);
75 int ii_update(kstat_ctl_t *);
76 int ii_report();
77 
78 #ifdef	__cplusplus
79 }
80 #endif
81 
82 #endif /* _II_STATS_H */
83