Blame sunrpc/rpcsvc/rstat.x

Packit 6c4009
/* @(#)rstat.x	2.2 88/08/01 4.0 RPCSRC */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Copyright (c) 2010, Oracle America, Inc.
Packit 6c4009
 * Redistribution and use in source and binary forms, with or without
Packit 6c4009
 * modification, are permitted provided that the following conditions are
Packit 6c4009
 * met:
Packit 6c4009
 *
Packit 6c4009
 *     * Redistributions of source code must retain the above copyright
Packit 6c4009
 *       notice, this list of conditions and the following disclaimer.
Packit 6c4009
 *     * Redistributions in binary form must reproduce the above
Packit 6c4009
 *       copyright notice, this list of conditions and the following
Packit 6c4009
 *       disclaimer in the documentation and/or other materials
Packit 6c4009
 *       provided with the distribution.
Packit 6c4009
 *     * Neither the name of the "Oracle America, Inc." nor the names of its
Packit 6c4009
 *       contributors may be used to endorse or promote products derived
Packit 6c4009
 *       from this software without specific prior written permission.
Packit 6c4009
 *
Packit 6c4009
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit 6c4009
 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit 6c4009
 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
Packit 6c4009
 *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
Packit 6c4009
 *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
Packit 6c4009
 *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 6c4009
 *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
Packit 6c4009
 *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit 6c4009
 *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
Packit 6c4009
 *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Packit 6c4009
 *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 6c4009
 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Gather statistics on remote machines
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifdef RPC_HDR
Packit 6c4009
Packit 6c4009
%#ifndef FSCALE
Packit 6c4009
%/*
Packit 6c4009
% * Scale factor for scaled integers used to count load averages.
Packit 6c4009
% */
Packit 6c4009
%#define FSHIFT  8               /* bits to right of fixed binary point */
Packit 6c4009
%#define FSCALE  (1<
Packit 6c4009
%
Packit 6c4009
%#endif /* ndef FSCALE */
Packit 6c4009
Packit 6c4009
#endif /* def RPC_HDR */
Packit 6c4009
Packit 6c4009
const CPUSTATES = 4;
Packit 6c4009
const DK_NDRIVE = 4;
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * GMT since 0:00, January 1, 1970
Packit 6c4009
 */
Packit 6c4009
struct rstat_timeval {
Packit 6c4009
	unsigned int tv_sec;	/* seconds */
Packit 6c4009
	unsigned int tv_usec;	/* and microseconds */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct statstime {				/* RSTATVERS_TIME */
Packit 6c4009
	int cp_time[CPUSTATES];
Packit 6c4009
	int dk_xfer[DK_NDRIVE];
Packit 6c4009
	unsigned int v_pgpgin;	/* these are cumulative sum */
Packit 6c4009
	unsigned int v_pgpgout;
Packit 6c4009
	unsigned int v_pswpin;
Packit 6c4009
	unsigned int v_pswpout;
Packit 6c4009
	unsigned int v_intr;
Packit 6c4009
	int if_ipackets;
Packit 6c4009
	int if_ierrors;
Packit 6c4009
	int if_oerrors;
Packit 6c4009
	int if_collisions;
Packit 6c4009
	unsigned int v_swtch;
Packit 6c4009
	int avenrun[3];         /* scaled by FSCALE */
Packit 6c4009
	rstat_timeval boottime;
Packit 6c4009
	rstat_timeval curtime;
Packit 6c4009
	int if_opackets;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct statsswtch {			/* RSTATVERS_SWTCH */
Packit 6c4009
	int cp_time[CPUSTATES];
Packit 6c4009
	int dk_xfer[DK_NDRIVE];
Packit 6c4009
	unsigned int v_pgpgin;	/* these are cumulative sum */
Packit 6c4009
	unsigned int v_pgpgout;
Packit 6c4009
	unsigned int v_pswpin;
Packit 6c4009
	unsigned int v_pswpout;
Packit 6c4009
	unsigned int v_intr;
Packit 6c4009
	int if_ipackets;
Packit 6c4009
	int if_ierrors;
Packit 6c4009
	int if_oerrors;
Packit 6c4009
	int if_collisions;
Packit 6c4009
	unsigned int v_swtch;
Packit 6c4009
	unsigned int avenrun[3];/* scaled by FSCALE */
Packit 6c4009
	rstat_timeval boottime;
Packit 6c4009
	int if_opackets;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct stats {				/* RSTATVERS_ORIG */
Packit 6c4009
	int cp_time[CPUSTATES];
Packit 6c4009
	int dk_xfer[DK_NDRIVE];
Packit 6c4009
	unsigned int v_pgpgin;	/* these are cumulative sum */
Packit 6c4009
	unsigned int v_pgpgout;
Packit 6c4009
	unsigned int v_pswpin;
Packit 6c4009
	unsigned int v_pswpout;
Packit 6c4009
	unsigned int v_intr;
Packit 6c4009
	int if_ipackets;
Packit 6c4009
	int if_ierrors;
Packit 6c4009
	int if_oerrors;
Packit 6c4009
	int if_collisions;
Packit 6c4009
	int if_opackets;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
program RSTATPROG {
Packit 6c4009
	/*
Packit 6c4009
	 * Newest version includes current time and context switching info
Packit 6c4009
	 */
Packit 6c4009
	version RSTATVERS_TIME {
Packit 6c4009
		statstime
Packit 6c4009
		RSTATPROC_STATS(void) = 1;
Packit 6c4009
Packit 6c4009
		unsigned int
Packit 6c4009
		RSTATPROC_HAVEDISK(void) = 2;
Packit 6c4009
	} = 3;
Packit 6c4009
	/*
Packit 6c4009
	 * Does not have current time
Packit 6c4009
	 */
Packit 6c4009
	version RSTATVERS_SWTCH {
Packit 6c4009
		statsswtch
Packit 6c4009
		RSTATPROC_STATS(void) = 1;
Packit 6c4009
Packit 6c4009
		unsigned int
Packit 6c4009
		RSTATPROC_HAVEDISK(void) = 2;
Packit 6c4009
	} = 2;
Packit 6c4009
	/*
Packit 6c4009
	 * Old version has no info about current time or context switching
Packit 6c4009
	 */
Packit 6c4009
	version RSTATVERS_ORIG {
Packit 6c4009
		stats
Packit 6c4009
		RSTATPROC_STATS(void) = 1;
Packit 6c4009
Packit 6c4009
		unsigned int
Packit 6c4009
		RSTATPROC_HAVEDISK(void) = 2;
Packit 6c4009
	} = 1;
Packit 6c4009
} = 100001;