Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/rpcsvc/rstat.x is written in an unsupported language. File is not indexed.

0001 /* @(#)rstat.x  2.2 88/08/01 4.0 RPCSRC */
0002 
0003 /*
0004  * Copyright (c) 2010, Oracle America, Inc.
0005  * Redistribution and use in source and binary forms, with or without
0006  * modification, are permitted provided that the following conditions are
0007  * met:
0008  *
0009  *     * Redistributions of source code must retain the above copyright
0010  *       notice, this list of conditions and the following disclaimer.
0011  *     * Redistributions in binary form must reproduce the above
0012  *       copyright notice, this list of conditions and the following
0013  *       disclaimer in the documentation and/or other materials
0014  *       provided with the distribution.
0015  *     * Neither the name of the "Oracle America, Inc." nor the names of its
0016  *       contributors may be used to endorse or promote products derived
0017  *       from this software without specific prior written permission.
0018  *
0019  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0020  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0021  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
0022  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
0023  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
0024  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0025  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
0026  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0027  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0028  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0029  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0030  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0031  */
0032 
0033 /*
0034  * Gather statistics on remote machines
0035  */
0036 
0037 #ifdef RPC_HDR
0038 
0039 %#ifndef FSCALE
0040 %/*
0041 % * Scale factor for scaled integers used to count load averages.
0042 % */
0043 %#define FSHIFT  8               /* bits to right of fixed binary point */
0044 %#define FSCALE  (1<<FSHIFT)
0045 %
0046 %#endif /* ndef FSCALE */
0047 
0048 #endif /* def RPC_HDR */
0049 
0050 const CPUSTATES = 4;
0051 const DK_NDRIVE = 4;
0052 
0053 /*
0054  * GMT since 0:00, January 1, 1970
0055  */
0056 struct rstat_timeval {
0057         unsigned int tv_sec;    /* seconds */
0058         unsigned int tv_usec;   /* and microseconds */
0059 };
0060 
0061 struct statstime {                              /* RSTATVERS_TIME */
0062         int cp_time[CPUSTATES];
0063         int dk_xfer[DK_NDRIVE];
0064         unsigned int v_pgpgin;  /* these are cumulative sum */
0065         unsigned int v_pgpgout;
0066         unsigned int v_pswpin;
0067         unsigned int v_pswpout;
0068         unsigned int v_intr;
0069         int if_ipackets;
0070         int if_ierrors;
0071         int if_oerrors;
0072         int if_collisions;
0073         unsigned int v_swtch;
0074         int avenrun[3];         /* scaled by FSCALE */
0075         rstat_timeval boottime;
0076         rstat_timeval curtime;
0077         int if_opackets;
0078 };
0079 
0080 struct statsswtch {                     /* RSTATVERS_SWTCH */
0081         int cp_time[CPUSTATES];
0082         int dk_xfer[DK_NDRIVE];
0083         unsigned int v_pgpgin;  /* these are cumulative sum */
0084         unsigned int v_pgpgout;
0085         unsigned int v_pswpin;
0086         unsigned int v_pswpout;
0087         unsigned int v_intr;
0088         int if_ipackets;
0089         int if_ierrors;
0090         int if_oerrors;
0091         int if_collisions;
0092         unsigned int v_swtch;
0093         unsigned int avenrun[3];/* scaled by FSCALE */
0094         rstat_timeval boottime;
0095         int if_opackets;
0096 };
0097 
0098 struct stats {                          /* RSTATVERS_ORIG */
0099         int cp_time[CPUSTATES];
0100         int dk_xfer[DK_NDRIVE];
0101         unsigned int v_pgpgin;  /* these are cumulative sum */
0102         unsigned int v_pgpgout;
0103         unsigned int v_pswpin;
0104         unsigned int v_pswpout;
0105         unsigned int v_intr;
0106         int if_ipackets;
0107         int if_ierrors;
0108         int if_oerrors;
0109         int if_collisions;
0110         int if_opackets;
0111 };
0112 
0113 
0114 program RSTATPROG {
0115         /*
0116          * Newest version includes current time and context switching info
0117          */
0118         version RSTATVERS_TIME {
0119                 statstime
0120                 RSTATPROC_STATS(void) = 1;
0121 
0122                 unsigned int
0123                 RSTATPROC_HAVEDISK(void) = 2;
0124         } = 3;
0125         /*
0126          * Does not have current time
0127          */
0128         version RSTATVERS_SWTCH {
0129                 statsswtch
0130                 RSTATPROC_STATS(void) = 1;
0131 
0132                 unsigned int
0133                 RSTATPROC_HAVEDISK(void) = 2;
0134         } = 2;
0135         /*
0136          * Old version has no info about current time or context switching
0137          */
0138         version RSTATVERS_ORIG {
0139                 stats
0140                 RSTATPROC_STATS(void) = 1;
0141 
0142                 unsigned int
0143                 RSTATPROC_HAVEDISK(void) = 2;
0144         } = 1;
0145 } = 100001;