Home | History | Annotate | Line # | Download | only in librpcsvc
rstat.x revision 1.1
      1  1.1  jtc /*
      2  1.1  jtc  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
      3  1.1  jtc  * unrestricted use provided that this legend is included on all tape
      4  1.1  jtc  * media and as a part of the software program in whole or part.  Users
      5  1.1  jtc  * may copy or modify Sun RPC without charge, but are not authorized
      6  1.1  jtc  * to license or distribute it to anyone else except as part of a product or
      7  1.1  jtc  * program developed by the user.
      8  1.1  jtc  *
      9  1.1  jtc  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10  1.1  jtc  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11  1.1  jtc  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12  1.1  jtc  *
     13  1.1  jtc  * Sun RPC is provided with no support and without any obligation on the
     14  1.1  jtc  * part of Sun Microsystems, Inc. to assist in its use, correction,
     15  1.1  jtc  * modification or enhancement.
     16  1.1  jtc  *
     17  1.1  jtc  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18  1.1  jtc  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19  1.1  jtc  * OR ANY PART THEREOF.
     20  1.1  jtc  *
     21  1.1  jtc  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22  1.1  jtc  * or profits or other special, indirect and consequential damages, even if
     23  1.1  jtc  * Sun has been advised of the possibility of such damages.
     24  1.1  jtc  *
     25  1.1  jtc  * Sun Microsystems, Inc.
     26  1.1  jtc  * 2550 Garcia Avenue
     27  1.1  jtc  * Mountain View, California  94043
     28  1.1  jtc  */
     29  1.1  jtc 
     30  1.1  jtc /*
     31  1.1  jtc  * Gather statistics on remote machines
     32  1.1  jtc  */
     33  1.1  jtc 
     34  1.1  jtc #ifdef RPC_HDR
     35  1.1  jtc 
     36  1.1  jtc %#ifndef FSCALE
     37  1.1  jtc %/*
     38  1.1  jtc % * Scale factor for scaled integers used to count load averages.
     39  1.1  jtc % */
     40  1.1  jtc %#define FSHIFT  8               /* bits to right of fixed binary point */
     41  1.1  jtc %#define FSCALE  (1<<FSHIFT)
     42  1.1  jtc %
     43  1.1  jtc %#endif /* ndef FSCALE */
     44  1.1  jtc 
     45  1.1  jtc #else
     46  1.1  jtc 
     47  1.1  jtc %#ifndef lint
     48  1.1  jtc %/*static char sccsid[] = "from: @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
     49  1.1  jtc %/*static char sccsid[] = "from: @(#)rstat.x	2.2 88/08/01 4.0 RPCSRC";*/
     50  1.1  jtc %static char rcsid[] = "$Id: rstat.x,v 1.1 1995/01/12 19:39:55 jtc Exp $";
     51  1.1  jtc %#endif /* not lint */
     52  1.1  jtc 
     53  1.1  jtc #endif /* def RPC_HDR */
     54  1.1  jtc 
     55  1.1  jtc const CPUSTATES = 4;
     56  1.1  jtc const DK_NDRIVE = 4;
     57  1.1  jtc 
     58  1.1  jtc /*
     59  1.1  jtc  * GMT since 0:00, January 1, 1970
     60  1.1  jtc  */
     61  1.1  jtc struct rstat_timeval {
     62  1.1  jtc 	unsigned int tv_sec;	/* seconds */
     63  1.1  jtc 	unsigned int tv_usec;	/* and microseconds */
     64  1.1  jtc };
     65  1.1  jtc 
     66  1.1  jtc struct statstime {				/* RSTATVERS_TIME */
     67  1.1  jtc 	int cp_time[CPUSTATES];
     68  1.1  jtc 	int dk_xfer[DK_NDRIVE];
     69  1.1  jtc 	unsigned int v_pgpgin;	/* these are cumulative sum */
     70  1.1  jtc 	unsigned int v_pgpgout;
     71  1.1  jtc 	unsigned int v_pswpin;
     72  1.1  jtc 	unsigned int v_pswpout;
     73  1.1  jtc 	unsigned int v_intr;
     74  1.1  jtc 	int if_ipackets;
     75  1.1  jtc 	int if_ierrors;
     76  1.1  jtc 	int if_oerrors;
     77  1.1  jtc 	int if_collisions;
     78  1.1  jtc 	unsigned int v_swtch;
     79  1.1  jtc 	int avenrun[3];         /* scaled by FSCALE */
     80  1.1  jtc 	rstat_timeval boottime;
     81  1.1  jtc 	rstat_timeval curtime;
     82  1.1  jtc 	int if_opackets;
     83  1.1  jtc };
     84  1.1  jtc 
     85  1.1  jtc struct statsswtch {			/* RSTATVERS_SWTCH */
     86  1.1  jtc 	int cp_time[CPUSTATES];
     87  1.1  jtc 	int dk_xfer[DK_NDRIVE];
     88  1.1  jtc 	unsigned int v_pgpgin;	/* these are cumulative sum */
     89  1.1  jtc 	unsigned int v_pgpgout;
     90  1.1  jtc 	unsigned int v_pswpin;
     91  1.1  jtc 	unsigned int v_pswpout;
     92  1.1  jtc 	unsigned int v_intr;
     93  1.1  jtc 	int if_ipackets;
     94  1.1  jtc 	int if_ierrors;
     95  1.1  jtc 	int if_oerrors;
     96  1.1  jtc 	int if_collisions;
     97  1.1  jtc 	unsigned int v_swtch;
     98  1.1  jtc 	unsigned int avenrun[3];/* scaled by FSCALE */
     99  1.1  jtc 	rstat_timeval boottime;
    100  1.1  jtc 	int if_opackets;
    101  1.1  jtc };
    102  1.1  jtc 
    103  1.1  jtc struct stats {				/* RSTATVERS_ORIG */
    104  1.1  jtc 	int cp_time[CPUSTATES];
    105  1.1  jtc 	int dk_xfer[DK_NDRIVE];
    106  1.1  jtc 	unsigned int v_pgpgin;	/* these are cumulative sum */
    107  1.1  jtc 	unsigned int v_pgpgout;
    108  1.1  jtc 	unsigned int v_pswpin;
    109  1.1  jtc 	unsigned int v_pswpout;
    110  1.1  jtc 	unsigned int v_intr;
    111  1.1  jtc 	int if_ipackets;
    112  1.1  jtc 	int if_ierrors;
    113  1.1  jtc 	int if_oerrors;
    114  1.1  jtc 	int if_collisions;
    115  1.1  jtc 	int if_opackets;
    116  1.1  jtc };
    117  1.1  jtc 
    118  1.1  jtc 
    119  1.1  jtc program RSTATPROG {
    120  1.1  jtc 	/*
    121  1.1  jtc 	 * Newest version includes current time and context switching info
    122  1.1  jtc 	 */
    123  1.1  jtc 	version RSTATVERS_TIME {
    124  1.1  jtc 		statstime
    125  1.1  jtc 		RSTATPROC_STATS(void) = 1;
    126  1.1  jtc 
    127  1.1  jtc 		unsigned int
    128  1.1  jtc 		RSTATPROC_HAVEDISK(void) = 2;
    129  1.1  jtc 	} = 3;
    130  1.1  jtc 	/*
    131  1.1  jtc 	 * Does not have current time
    132  1.1  jtc 	 */
    133  1.1  jtc 	version RSTATVERS_SWTCH {
    134  1.1  jtc 		statsswtch
    135  1.1  jtc 		RSTATPROC_STATS(void) = 1;
    136  1.1  jtc 
    137  1.1  jtc 		unsigned int
    138  1.1  jtc 		RSTATPROC_HAVEDISK(void) = 2;
    139  1.1  jtc 	} = 2;
    140  1.1  jtc 	/*
    141  1.1  jtc 	 * Old version has no info about current time or context switching
    142  1.1  jtc 	 */
    143  1.1  jtc 	version RSTATVERS_ORIG {
    144  1.1  jtc 		stats
    145  1.1  jtc 		RSTATPROC_STATS(void) = 1;
    146  1.1  jtc 
    147  1.1  jtc 		unsigned int
    148  1.1  jtc 		RSTATPROC_HAVEDISK(void) = 2;
    149  1.1  jtc 	} = 1;
    150  1.1  jtc } = 100001;
    151