2 .\" Copyright (c) 2000, Sun Microsystems, Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH KSTAT_IO 9S "Apr 4, 1994"
8 kstat_io \- structure for I/O kstats
12 #include <sys/types.h>
13 #include <sys/kstat.h>
15 #include <sys/sunddi.h>
21 Solaris DDI specific (Solaris DDI)
25 I/O kstat statistics are kept in a \fBkstat_io\fR structure. When
26 \fBkstat_create\fR(9F) creates an \fBI/O\fR \fBkstat\fR, the \fBks_data\fR
27 field is a pointer to one of these structures. The macro \fBKSTAT_IO_PTR()\fR
28 is provided to retrieve this field. It looks like this:
32 #define KSTAT_IO_PTR(kptr) ((kstat_io_t *)(kptr)->ks_data)
40 u_longlong_t nread; /* number of bytes read */
41 u_longlong_t nwritten; /* number of bytes written *]/
42 ulong_t reads; /* number of read operations */
43 ulong_t writes; /* number of write operations */
49 The \fBnread\fR field should be updated by the driver with the number of bytes
50 successfully read upon completion.
53 The \fBnwritten\fR field should be updated by the driver with the number of
54 bytes successfully written upon completion.
57 The \fBreads\fR field should be updated by the driver after each successful
61 The \fBwrites\fR field should be updated by the driver after each successful
65 Other \fBI/O\fR statistics are updated through the use of the
66 \fBkstat_queue\fR(9F) functions.
70 \fBkstat_create\fR(9F), \fBkstat_named_init\fR(9F), \fBkstat_queue\fR(9F),
71 \fBkstat_runq_back_to_waitq\fR(9F), \fBkstat_runq_enter\fR(9F),
72 \fBkstat_runq_exit\fR(9F), \fBkstat_waitq_enter\fR(9F),
73 \fBkstat_waitq_exit\fR(9F), \fBkstat_waitq_to_runq\fR(9F)
76 \fIWriting Device Drivers\fR