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