xref: /openbsd/usr.bin/vmstat/dkstats.h (revision 274d7c50)
1 /*	$OpenBSD: dkstats.h,v 1.10 2006/06/13 02:11:27 dlg Exp $	*/
2 /*	$NetBSD: dkstats.h,v 1.1 1996/05/10 23:19:28 thorpej Exp $	*/
3 
4 /*
5  * Copyright (c) 1996 John M. Vinopal
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. All advertising materials mentioning features or use of this software
17  *    must display the following acknowledgement:
18  *      This product includes software developed for the NetBSD Project
19  *      by John M. Vinopal.
20  * 4. The name of the author may not be used to endorse or promote products
21  *    derived from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  */
35 
36 #include <sys/time.h>
37 #include <unistd.h>
38 
39 /* poseur disk entry to hold the information we're interested in. */
40 struct _disk {
41 	int		  dk_ndrive;	/* # of drives. */
42 	int		 *dk_select;	/* Display stats for selected disks. */
43 	char		**dk_name;	/* Disk names (sd0, wd1, etc). */
44 	u_int64_t	 *dk_rxfer;	/* # of read transfers. */
45 	u_int64_t	 *dk_wxfer;	/* # of write transfers. */
46 	u_int64_t	 *dk_seek;	/* # of seeks (currently unused). */
47 	u_int64_t	 *dk_rbytes;	/* # of bytes read. */
48 	u_int64_t	 *dk_wbytes;	/* # of bytes written. */
49 	struct timeval	 *dk_time;	/* Time spent in disk i/o. */
50 	int64_t	tk_nin;			/* TTY Chars in. */
51 	int64_t	tk_nout;		/* TTY Chars out. */
52 	long	cp_time[CPUSTATES];	/* System timer ticks. */
53 };
54 
55 void dkswap(void);
56 void dkreadstats(void);
57 int dkinit(int);
58