xref: /illumos-gate/usr/src/cmd/rpcsvc/rstat_v2.x (revision 2a8bcb4e)
1 /*
2  * CDDL HEADER START
3  *
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
7  * with the License.
8  *
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.
13  *
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]
19  *
20  * CDDL HEADER END
21  */
22 %/*
23 % * Version 2 rstat; for backwards compatibility only.
24 % */
25 
26 %/*
27 % * Copyright (c) 1985, 1990, 1991 by Sun Microsystems, Inc.
28 % */
29 
30 %/* from rstat_v2.x */
31 
32 const RSTAT_V2_CPUSTATES = 4;
33 const RSTAT_V2_DK_NDRIVE = 4;
34 
35 /*
36  * the cpu stat values
37  */
38 
39 const RSTAT_V2_CPU_USER = 0;
40 const RSTAT_V2_CPU_NICE = 1;
41 const RSTAT_V2_CPU_SYS = 2;
42 const RSTAT_V2_CPU_IDLE = 3;
43 
44 /*
45  * GMT since 0:00, January 1, 1970
46  */
47 struct rstat_v2_timeval {
48 	int tv_sec;	/* seconds */
49 	int tv_usec;	/* and microseconds */
50 };
51 
52 struct statsswtch {				/* RSTATVERS_SWTCH */
53 	int cp_time[RSTAT_V2_CPUSTATES];
54 	int dk_xfer[RSTAT_V2_DK_NDRIVE];
55 	int v_pgpgin;	/* these are cumulative sum */
56 	int v_pgpgout;
57 	int v_pswpin;
58 	int v_pswpout;
59 	int v_intr;
60 	int if_ipackets;
61 	int if_ierrors;
62 	int if_oerrors;
63 	int if_collisions;
64 	int v_swtch;
65 	int avenrun[3];
66 	rstat_v2_timeval boottime;
67 };
68 
69 program RSTATPROG {
70 	/*
71 	 * Does not have current time
72 	 */
73 	version RSTATVERS_SWTCH {
74 		statsswtch
75 		RSTATPROC_STATS(void) = 1;
76 
77 		unsigned int
78 		RSTATPROC_HAVEDISK(void) = 2;
79 	} = 2;
80 } = 100001;
81