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