xref: /onnv-gate/usr/src/cmd/rcap/common/rcapd_stat.h (revision 3247:e05001c14ea2)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*3247Sgjelinek  * Common Development and Distribution License (the "License").
6*3247Sgjelinek  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*3247Sgjelinek  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef	_RCAPD_STAT_H
270Sstevel@tonic-gate #define	_RCAPD_STAT_H
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #ifdef	__cplusplus
320Sstevel@tonic-gate extern "C" {
330Sstevel@tonic-gate #endif
340Sstevel@tonic-gate 
350Sstevel@tonic-gate /*
360Sstevel@tonic-gate  * Default path to statistics file
370Sstevel@tonic-gate  */
38442Sgm149974 #define	STAT_FILE_DIR	"/var/run/daemon"
39442Sgm149974 #define	STAT_FILE_DEFAULT	STAT_FILE_DIR	"/rcap.stat"
400Sstevel@tonic-gate 
410Sstevel@tonic-gate /*
420Sstevel@tonic-gate  * Statistics file header.
430Sstevel@tonic-gate  */
440Sstevel@tonic-gate #define	RC_MODE_LEN	16
450Sstevel@tonic-gate typedef struct rcapd_stat_hdr {
46*3247Sgjelinek 	/*
47*3247Sgjelinek 	 * sizeof pid_t can vary, so we use a fixed 64-bit quantity.
48*3247Sgjelinek 	 */
49*3247Sgjelinek 	uint64_t	rs_pid;			/* pid of producer */
500Sstevel@tonic-gate 	hrtime_t	rs_time;		/* time recorded */
510Sstevel@tonic-gate 
520Sstevel@tonic-gate 	/*
530Sstevel@tonic-gate 	 * Physical memory pressure statistics, in percent.
540Sstevel@tonic-gate 	 */
550Sstevel@tonic-gate 	uint32_t	rs_pressure_cur;	/* current memory pressure */
560Sstevel@tonic-gate 	uint32_t	rs_pressure_cap;	/* minimum cap enforcement p. */
570Sstevel@tonic-gate 
580Sstevel@tonic-gate 	uint64_t	rs_pressure_sample;	/* count of pr. samplings */
590Sstevel@tonic-gate 	char		rs_mode[RC_MODE_LEN];	/* mode ("project" only) */
600Sstevel@tonic-gate } rcapd_stat_hdr_t;
610Sstevel@tonic-gate 
620Sstevel@tonic-gate extern pid_t stat_get_rcapd_pid(char *);
630Sstevel@tonic-gate 
640Sstevel@tonic-gate #ifdef	__cplusplus
650Sstevel@tonic-gate }
660Sstevel@tonic-gate #endif
670Sstevel@tonic-gate 
680Sstevel@tonic-gate #endif	/* _RCAPD_STAT_H */
69