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.
75 %xdr_timeval(XDR *xdrs, struct timeval *tvp)
77 % return (xdr_rstat_timeval(xdrs, (rstat_timeval *)tvp));
83 const RSTAT_CPUSTATES = 4;
84 const RSTAT_DK_NDRIVE = 4;
90 const RSTAT_CPU_USER = 0;
91 const RSTAT_CPU_NICE = 1;
92 const RSTAT_CPU_SYS = 2;
93 const RSTAT_CPU_IDLE = 3;
96 * GMT since 0:00, January 1, 1970
98 struct rstat_timeval {
99 int tv_sec; /* seconds */
100 int tv_usec; /* and microseconds */
103 struct statsvar { /* RSTATVERS_VAR */
104 int cp_time<>; /* variable number of CPU states */
105 int dk_xfer<>; /* variable number of disks */
106 unsigned v_pgpgin; /* these are cumulative sum */
118 rstat_timeval boottime;
119 rstat_timeval curtime;
122 struct statstime { /* RSTATVERS_TIME */
123 int cp_time[RSTAT_CPUSTATES];
124 int dk_xfer[RSTAT_DK_NDRIVE];
125 unsigned int v_pgpgin; /* these are cumulative sum */
126 unsigned int v_pgpgout;
127 unsigned int v_pswpin;
128 unsigned int v_pswpout;
134 unsigned int v_swtch;
136 rstat_timeval boottime;
137 rstat_timeval curtime;
143 * Version 4 allows for variable number of disk and RSTAT_CPU states.
145 version RSTATVERS_VAR {
147 RSTATPROC_STATS (void) = 1;
149 RSTATPROC_HAVEDISK (void) = 2;
152 * Newest version includes current time and context switching info
154 version RSTATVERS_TIME {
156 RSTATPROC_STATS(void) = 1;
158 RSTATPROC_HAVEDISK(void) = 2;
164 %enum clnt_stat rstat(char *, struct statstime *);
165 %int havedisk(char *);