xref: /titanic_51/usr/src/cmd/rcap/common/rcapd_conf.h (revision d75e6a5d480f559280524b60d52730c76a25524f)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5f1710550Stn143363  * Common Development and Distribution License (the "License").
6f1710550Stn143363  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*d75e6a5dStn143363  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_RCAPD_CONF_H
277c478bd9Sstevel@tonic-gate #define	_RCAPD_CONF_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #include <sys/param.h>
327c478bd9Sstevel@tonic-gate #include <stdio.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
357c478bd9Sstevel@tonic-gate extern "C" {
367c478bd9Sstevel@tonic-gate #endif
377c478bd9Sstevel@tonic-gate 
38f1710550Stn143363 #define	CFG_TEMPLATE_SUFFIX	".XXXXXX"	/* suffix of mkstemp() arg */
39f1710550Stn143363 
407c478bd9Sstevel@tonic-gate /*
417c478bd9Sstevel@tonic-gate  * Operating modes
427c478bd9Sstevel@tonic-gate  */
437c478bd9Sstevel@tonic-gate typedef enum {
447c478bd9Sstevel@tonic-gate 	rctype_project = 1	/* projects are the only collection type */
457c478bd9Sstevel@tonic-gate } rctype_t;
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate /*
487c478bd9Sstevel@tonic-gate  * Configuration
497c478bd9Sstevel@tonic-gate  */
507c478bd9Sstevel@tonic-gate typedef struct {
517c478bd9Sstevel@tonic-gate 	char		rcfg_filename[MAXPATHLEN];	/* cfg filename */
527c478bd9Sstevel@tonic-gate 	int		rcfg_fd;			/* reserved cfg fd */
537c478bd9Sstevel@tonic-gate 	time_t		rcfg_last_modification;		/* last mod time */
547c478bd9Sstevel@tonic-gate 	rctype_t	rcfg_mode;		/* mode (collection type) */
557c478bd9Sstevel@tonic-gate 	char		*rcfg_mode_name;  	/* mode name ("project" only) */
567c478bd9Sstevel@tonic-gate 	uint32_t	rcfg_proc_walk_interval;	/* /proc readdir() */
577c478bd9Sstevel@tonic-gate 							/* interval (s), */
587c478bd9Sstevel@tonic-gate 							/* undocumented */
597c478bd9Sstevel@tonic-gate 	uint32_t	rcfg_reconfiguration_interval;	/* lnode or project */
607c478bd9Sstevel@tonic-gate 							/* cap reconfig. */
617c478bd9Sstevel@tonic-gate 							/* interval (s) */
627c478bd9Sstevel@tonic-gate 	uint32_t	rcfg_report_interval;	/* report interval (s) */
637c478bd9Sstevel@tonic-gate 	int		rcfg_memory_cap_enforcement_pressure;  /* pressure */
647c478bd9Sstevel@tonic-gate 				/* above which memory caps are enforced */
657c478bd9Sstevel@tonic-gate 	char		rcfg_stat_file[MAXPATHLEN];	/* statistics file */
667c478bd9Sstevel@tonic-gate 	uint32_t	rcfg_rss_sample_interval; /* RSS sampling interval */
677c478bd9Sstevel@tonic-gate } rcfg_t;
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate typedef enum {
707c478bd9Sstevel@tonic-gate 	RCT_MODE_VAR = 257,
717c478bd9Sstevel@tonic-gate 	RCT_PROC_WALK_INTERVAL_VAR,
727c478bd9Sstevel@tonic-gate 	RCT_RECONFIGURATION_INTERVAL_VAR,
737c478bd9Sstevel@tonic-gate 	RCT_REPORT_INTERVAL_VAR,
747c478bd9Sstevel@tonic-gate 	RCT_RSS_SAMPLE_INTERVAL_VAR,
757c478bd9Sstevel@tonic-gate 	RCT_MEMORY_CAP_ENFORCEMENT_PRESSURE_VAR,
767c478bd9Sstevel@tonic-gate 	RCT_STAT_FILE_VAR,
777c478bd9Sstevel@tonic-gate 	RCT_EQUALS,
787c478bd9Sstevel@tonic-gate 	RCT_NUMBER,
797c478bd9Sstevel@tonic-gate 	RCT_PROJECT,
807c478bd9Sstevel@tonic-gate 	RCT_LNODE,
817c478bd9Sstevel@tonic-gate 	RCT_ON,
827c478bd9Sstevel@tonic-gate 	RCT_OFF,
837c478bd9Sstevel@tonic-gate 	RCT_FILENAME,
847c478bd9Sstevel@tonic-gate 	RCT_STATE,
857c478bd9Sstevel@tonic-gate 	RCT_INVALID
867c478bd9Sstevel@tonic-gate } rctoken_t;
877c478bd9Sstevel@tonic-gate 
88*d75e6a5dStn143363 extern int rcfg_read(rcfg_t *, int(*)(void));
897c478bd9Sstevel@tonic-gate extern void rcfg_init(rcfg_t *);
90*d75e6a5dStn143363 extern int modify_config(rcfg_t *);
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
937c478bd9Sstevel@tonic-gate }
947c478bd9Sstevel@tonic-gate #endif
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate #endif	/* _RCAPD_CONF_H */
97