8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / avs / dsstat / sdbc_stats.h
blobed455a70990449fbc0979b31e7618b042d96e125
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SDBC_STATS_H
27 #define _SDBC_STATS_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
34 * Internal flags to denote data collection status
36 #define GOT_SET_KSTAT 0x01
37 #define GOT_IO_KSTAT 0x02
38 #define GOT_COMPLETE_SDBC (GOT_SET_KSTAT | GOT_IO_KSTAT)
40 #define SDBC_COMPLETE(x) (((x) & (GOT_COMPLETE_SDBC)) != \
41 (GOT_COMPLETE_SDBC))
43 #define SDBC_KBYTES 0x01
44 #define SDBC_INTAVG 0x02
46 #define KILOBYTE 1024
48 typedef struct sdbcstat_s
50 kstat_t *pre_set;
51 kstat_t *pre_io;
52 kstat_t *cur_set;
53 kstat_t *cur_io;
54 int collected;
55 struct sdbcstat_s *next;
56 } sdbcstat_t;
58 typedef struct sdbcvals_t
60 uint32_t cache_read;
61 uint32_t cache_write;
62 uint32_t total_cache;
64 float cache_hit;
65 float read_hit;
66 float write_hit;
68 uint32_t disk_read;
69 uint32_t disk_write;
70 uint32_t total_disk;
72 uint32_t destaged;
73 uint32_t write_cancellations;
75 uint32_t total_reads;
76 uint32_t total_writes;
77 } sdbcvals_t;
79 extern kstat_t *sdbc_global;
81 /* Prototypes */
82 int sdbc_discover(kstat_ctl_t *);
83 int sdbc_update(kstat_ctl_t *);
84 int sdbc_report();
85 sdbcstat_t *sdbc_getstat(char *);
86 int sdbc_getvalues(sdbcstat_t *, sdbcvals_t *, int);
88 #ifdef __cplusplus
90 #endif
92 #endif /* _SDBC_STATS_H */