4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 % * Copyright (c) 1985, 1990, 1991 by Sun Microsystems, Inc.
29 * Gather statistics on remote machines
34 %#pragma ident "%Z%%M% %I% %E% SMI"
37 % * Scale factor for scaled integers used to count load averages.
40 %#define FSHIFT 8 /* bits to right of fixed binary point */
41 %#define FSCALE (1<<FSHIFT)
42 %#endif /* ndef FSCALE */
45 %#include <sys/time.h> /* The time struct defined below is */
46 %#endif /* meant to match struct timeval. */
56 % * Server side stub routines for the rstat daemon
62 % * Client side stub routines for the rstat daemon
67 % * XDR routines for the rstat daemon, rup and perfmeter.
71 % * xdr_timeval was used in previous releases.
76 %xdr_timeval(XDR *xdrs, struct timeval *tvp)
78 %xdr_timeval(xdrs, tvp)
80 % struct timeval *tvp;
83 % return (xdr_rstat_timeval(xdrs, (rstat_timeval *)tvp));
89 const RSTAT_CPUSTATES = 4;
90 const RSTAT_DK_NDRIVE = 4;
96 const RSTAT_CPU_USER = 0;
97 const RSTAT_CPU_NICE = 1;
98 const RSTAT_CPU_SYS = 2;
99 const RSTAT_CPU_IDLE = 3;
102 * GMT since 0:00, January 1, 1970
104 struct rstat_timeval {
105 int tv_sec; /* seconds */
106 int tv_usec; /* and microseconds */
109 struct statsvar { /* RSTATVERS_VAR */
110 int cp_time<>; /* variable number of CPU states */
111 int dk_xfer<>; /* variable number of disks */
112 unsigned v_pgpgin; /* these are cumulative sum */
124 rstat_timeval boottime;
125 rstat_timeval curtime;
128 struct statstime { /* RSTATVERS_TIME */
129 int cp_time[RSTAT_CPUSTATES];
130 int dk_xfer[RSTAT_DK_NDRIVE];
131 unsigned int v_pgpgin; /* these are cumulative sum */
132 unsigned int v_pgpgout;
133 unsigned int v_pswpin;
134 unsigned int v_pswpout;
140 unsigned int v_swtch;
142 rstat_timeval boottime;
143 rstat_timeval curtime;
149 * Version 4 allows for variable number of disk and RSTAT_CPU states.
151 version RSTATVERS_VAR {
153 RSTATPROC_STATS (void) = 1;
155 RSTATPROC_HAVEDISK (void) = 2;
158 * Newest version includes current time and context switching info
160 version RSTATVERS_TIME {
162 RSTATPROC_STATS(void) = 1;
164 RSTATPROC_HAVEDISK(void) = 2;
170 %#if defined(__STDC__) || defined(__cplusplus)
171 %enum clnt_stat rstat(char *, struct statstime *);
172 %int havedisk(char *);
174 %enum clnt_stat rstat();