Home | History | Annotate | Line # | Download | only in vmstat
drvstats.h revision 1.1.2.2
      1  1.1.2.2  simonb /*	$NetBSD: drvstats.h,v 1.1.2.2 2006/04/22 02:54:47 simonb Exp $	*/
      2  1.1.2.2  simonb 
      3  1.1.2.2  simonb /*
      4  1.1.2.2  simonb  * Copyright (c) 1996 John M. Vinopal
      5  1.1.2.2  simonb  * All rights reserved.
      6  1.1.2.2  simonb  *
      7  1.1.2.2  simonb  * Redistribution and use in source and binary forms, with or without
      8  1.1.2.2  simonb  * modification, are permitted provided that the following conditions
      9  1.1.2.2  simonb  * are met:
     10  1.1.2.2  simonb  * 1. Redistributions of source code must retain the above copyright
     11  1.1.2.2  simonb  *    notice, this list of conditions and the following disclaimer.
     12  1.1.2.2  simonb  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1.2.2  simonb  *    notice, this list of conditions and the following disclaimer in the
     14  1.1.2.2  simonb  *    documentation and/or other materials provided with the distribution.
     15  1.1.2.2  simonb  * 3. All advertising materials mentioning features or use of this software
     16  1.1.2.2  simonb  *    must display the following acknowledgement:
     17  1.1.2.2  simonb  *      This product includes software developed for the NetBSD Project
     18  1.1.2.2  simonb  *      by John M. Vinopal.
     19  1.1.2.2  simonb  * 4. The name of the author may not be used to endorse or promote products
     20  1.1.2.2  simonb  *    derived from this software without specific prior written permission.
     21  1.1.2.2  simonb  *
     22  1.1.2.2  simonb  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     23  1.1.2.2  simonb  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     24  1.1.2.2  simonb  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     25  1.1.2.2  simonb  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     26  1.1.2.2  simonb  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     27  1.1.2.2  simonb  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     28  1.1.2.2  simonb  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     29  1.1.2.2  simonb  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     30  1.1.2.2  simonb  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     31  1.1.2.2  simonb  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32  1.1.2.2  simonb  * SUCH DAMAGE.
     33  1.1.2.2  simonb  */
     34  1.1.2.2  simonb 
     35  1.1.2.2  simonb #include <sys/time.h>
     36  1.1.2.2  simonb #include <sys/sched.h>
     37  1.1.2.2  simonb #include <unistd.h>
     38  1.1.2.2  simonb 
     39  1.1.2.2  simonb /* poseur disk entry to hold the information we're interested in. */
     40  1.1.2.2  simonb struct _drive {
     41  1.1.2.2  simonb 	int		 *select;	/* Display stats for selected disks. */
     42  1.1.2.2  simonb 	char		**name;	/* Disk names (sd0, wd1, etc). */
     43  1.1.2.2  simonb 	u_int64_t	 *rxfer;	/* # of read transfers. */
     44  1.1.2.2  simonb 	u_int64_t	 *wxfer;	/* # of write transfers. */
     45  1.1.2.2  simonb 	u_int64_t	 *seek;	/* # of seeks (currently unused). */
     46  1.1.2.2  simonb 	u_int64_t	 *rbytes;	/* # of bytes read. */
     47  1.1.2.2  simonb 	u_int64_t	 *wbytes;	/* # of bytes written. */
     48  1.1.2.2  simonb 	struct timeval	 *time;	/* Time spent in disk i/o. */
     49  1.1.2.2  simonb 	u_int64_t	  tk_nin;	/* TTY Chars in. */
     50  1.1.2.2  simonb 	u_int64_t	  tk_nout;	/* TTY Chars out. */
     51  1.1.2.2  simonb 	u_int64_t	  cp_time[CPUSTATES];	/* System timer ticks. */
     52  1.1.2.2  simonb 	int	 	  cp_ncpu;		/* Number of cpu's */
     53  1.1.2.2  simonb 	double		  cp_etime;		/* Elapsed time */
     54  1.1.2.2  simonb };
     55  1.1.2.2  simonb 
     56  1.1.2.2  simonb extern struct _drive	cur;
     57  1.1.2.2  simonb extern char		**dr_name;
     58  1.1.2.2  simonb extern int		*drv_select, ndrive;
     59  1.1.2.2  simonb 
     60  1.1.2.2  simonb int	drvinit(int);
     61  1.1.2.2  simonb void	cpureadstats(void);
     62  1.1.2.2  simonb void	drvreadstats(void);
     63  1.1.2.2  simonb void	tkreadstats(void);
     64  1.1.2.2  simonb void	cpuswap(void);
     65  1.1.2.2  simonb void	drvswap(void);
     66  1.1.2.2  simonb void	tkswap(void);
     67