2 * Copyright (c) 2010, Oracle America, Inc.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following
12 * disclaimer in the documentation and/or other materials
13 * provided with the distribution.
14 * * Neither the name of the "Oracle America, Inc." nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * Gather statistics on remote machines
40 % * Scale factor for scaled integers used to count load averages.
42 %#define FSHIFT 8 /* bits to right of fixed binary point */
43 %#define FSCALE (1<<FSHIFT)
45 %#endif /* ndef FSCALE */
50 %/*static char sccsid[] = "from: @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
51 %/*static char sccsid[] = "from: @(#)rstat.x 2.2 88/08/01 4.0 RPCSRC";*/
52 %#endif /* not lint */
53 %#include <sys/cdefs.h>
54 %__FBSDID("$FreeBSD$");
56 #endif /* def RPC_HDR */
58 const RSTAT_CPUSTATES = 4;
59 const RSTAT_DK_NDRIVE = 4;
62 * GMT since 0:00, January 1, 1970
64 struct rstat_timeval {
65 unsigned int tv_sec; /* seconds */
66 unsigned int tv_usec; /* and microseconds */
69 struct statstime { /* RSTATVERS_TIME */
70 int cp_time[RSTAT_CPUSTATES];
71 int dk_xfer[RSTAT_DK_NDRIVE];
72 unsigned int v_pgpgin; /* these are cumulative sum */
73 unsigned int v_pgpgout;
74 unsigned int v_pswpin;
75 unsigned int v_pswpout;
82 int avenrun[3]; /* scaled by FSCALE */
83 rstat_timeval boottime;
84 rstat_timeval curtime;
88 struct statsswtch { /* RSTATVERS_SWTCH */
89 int cp_time[RSTAT_CPUSTATES];
90 int dk_xfer[RSTAT_DK_NDRIVE];
91 unsigned int v_pgpgin; /* these are cumulative sum */
92 unsigned int v_pgpgout;
93 unsigned int v_pswpin;
94 unsigned int v_pswpout;
100 unsigned int v_swtch;
101 unsigned int avenrun[3];/* scaled by FSCALE */
102 rstat_timeval boottime;
106 struct stats { /* RSTATVERS_ORIG */
107 int cp_time[RSTAT_CPUSTATES];
108 int dk_xfer[RSTAT_DK_NDRIVE];
109 unsigned int v_pgpgin; /* these are cumulative sum */
110 unsigned int v_pgpgout;
111 unsigned int v_pswpin;
112 unsigned int v_pswpout;
124 * Newest version includes current time and context switching info
126 version RSTATVERS_TIME {
128 RSTATPROC_STATS(void) = 1;
131 RSTATPROC_HAVEDISK(void) = 2;
134 * Does not have current time
136 version RSTATVERS_SWTCH {
138 RSTATPROC_STATS(void) = 1;
141 RSTATPROC_HAVEDISK(void) = 2;
144 * Old version has no info about current time or context switching
146 version RSTATVERS_ORIG {
148 RSTATPROC_STATS(void) = 1;
151 RSTATPROC_HAVEDISK(void) = 2;
157 %enum clnt_stat rstat(char *, struct statstime *);
158 %int havedisk(char *);