xref: /titanic_41/usr/src/cmd/rcap/common/rcapd_conf.h (revision 31e37bb439502e3f7c4c0a9a77d655ea5d56887a)
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  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_RCAPD_CONF_H
28 #define	_RCAPD_CONF_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/param.h>
33 #include <stdio.h>
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * Operating modes
41  */
42 typedef enum {
43 	rctype_project = 1	/* projects are the only collection type */
44 } rctype_t;
45 
46 /*
47  * Configuration
48  */
49 typedef struct {
50 	char		rcfg_filename[MAXPATHLEN];	/* cfg filename */
51 	int		rcfg_fd;			/* reserved cfg fd */
52 	time_t		rcfg_last_modification;		/* last mod time */
53 	rctype_t	rcfg_mode;		/* mode (collection type) */
54 	char		*rcfg_mode_name;  	/* mode name ("project" only) */
55 	uint32_t	rcfg_proc_walk_interval;	/* /proc readdir() */
56 							/* interval (s), */
57 							/* undocumented */
58 	uint32_t	rcfg_reconfiguration_interval;	/* lnode or project */
59 							/* cap reconfig. */
60 							/* interval (s) */
61 	uint32_t	rcfg_report_interval;	/* report interval (s) */
62 	int		rcfg_memory_cap_enforcement_pressure;  /* pressure */
63 				/* above which memory caps are enforced */
64 	char		rcfg_stat_file[MAXPATHLEN];	/* statistics file */
65 	uint32_t	rcfg_rss_sample_interval; /* RSS sampling interval */
66 } rcfg_t;
67 
68 typedef enum {
69 	RCT_MODE_VAR = 257,
70 	RCT_PROC_WALK_INTERVAL_VAR,
71 	RCT_RECONFIGURATION_INTERVAL_VAR,
72 	RCT_REPORT_INTERVAL_VAR,
73 	RCT_RSS_SAMPLE_INTERVAL_VAR,
74 	RCT_MEMORY_CAP_ENFORCEMENT_PRESSURE_VAR,
75 	RCT_STAT_FILE_VAR,
76 	RCT_EQUALS,
77 	RCT_NUMBER,
78 	RCT_PROJECT,
79 	RCT_LNODE,
80 	RCT_ON,
81 	RCT_OFF,
82 	RCT_FILENAME,
83 	RCT_STATE,
84 	RCT_INVALID
85 } rctoken_t;
86 
87 extern int rcfg_read(char *, int, rcfg_t *, int(*)(void));
88 extern void rcfg_init(rcfg_t *);
89 
90 #ifdef	__cplusplus
91 }
92 #endif
93 
94 #endif	/* _RCAPD_CONF_H */
95