xref: /titanic_44/usr/src/cmd/rpcsvc/rstat_v2.x (revision 6bbe05905a1c10a2703f95fb4912eb14b87f6670)
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 #ifdef RPC_HDR
33 %
34 %#pragma ident	"%Z%%M%	%I%	%E% SMI"
35 %
36 #endif
37 
38 const RSTAT_V2_CPUSTATES = 4;
39 const RSTAT_V2_DK_NDRIVE = 4;
40 
41 /*
42  * the cpu stat values
43  */
44 
45 const RSTAT_V2_CPU_USER = 0;
46 const RSTAT_V2_CPU_NICE = 1;
47 const RSTAT_V2_CPU_SYS = 2;
48 const RSTAT_V2_CPU_IDLE = 3;
49 
50 /*
51  * GMT since 0:00, January 1, 1970
52  */
53 struct rstat_v2_timeval {
54 	int tv_sec;	/* seconds */
55 	int tv_usec;	/* and microseconds */
56 };
57 
58 struct statsswtch {				/* RSTATVERS_SWTCH */
59 	int cp_time[RSTAT_V2_CPUSTATES];
60 	int dk_xfer[RSTAT_V2_DK_NDRIVE];
61 	int v_pgpgin;	/* these are cumulative sum */
62 	int v_pgpgout;
63 	int v_pswpin;
64 	int v_pswpout;
65 	int v_intr;
66 	int if_ipackets;
67 	int if_ierrors;
68 	int if_oerrors;
69 	int if_collisions;
70 	int v_swtch;
71 	int avenrun[3];
72 	rstat_v2_timeval boottime;
73 };
74 
75 program RSTATPROG {
76 	/*
77 	 * Does not have current time
78 	 */
79 	version RSTATVERS_SWTCH {
80 		statsswtch
81 		RSTATPROC_STATS(void) = 1;
82 
83 		unsigned int
84 		RSTATPROC_HAVEDISK(void) = 2;
85 	} = 2;
86 } = 100001;
87