prstat.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _PRSTAT_H
#define _PRSTAT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <procfs.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* FRC2PCT macro is used to convert 16-bit binary fractions in the range
* 0.0 to 1.0 with binary point to the right of the high order bit
* (i.e. 1.0 == 0x8000) to percentage value.
*/
/*
* List of available output modes
*/
/*
* Flags to keep track of process or lwp status
*/
/*
* Possible list types
*/
#define LT_LWPS 0x0001
#define LT_USERS 0x0002
#define LT_TASKS 0x0004
#define LT_PROJECTS 0x0008
#define LT_ZONES 0x0010
/*
* Linked list of per-process or per-lwp statistics
*/
typedef struct lwp_info {
float li_usr; /* user level CPU time */
float li_sys; /* system call CPU time */
float li_trp; /* other system trap CPU time */
float li_tfl; /* text page fault sleep time */
float li_dfl; /* data page fault sleep time */
float li_lck; /* user lock wait sleep time */
float li_slp; /* all other sleep time */
float li_lat; /* wait-cpu (latency) time */
} lwp_info_t;
/*
* Linked list of collective per-uid, per-taskid, or per-projid statistics
*/
typedef struct id_info {
float id_pctcpu; /* percentage of cpu usage */
float id_pctmem; /* percentage of memory usage */
} id_info_t;
/*
* Per-list structure
*/
typedef struct list {
int l_type; /* list type */
int l_count; /* number of entries in the list */
void *l_head; /* pointer to the head of the list */
void *l_tail; /* pointer to the tail of the list */
int l_size; /* number of allocated pointers */
int l_used; /* number of used pointers */
int l_sortorder; /* sorting order for the list */
void **l_ptrs; /* pointer to an array of pointers */
} list_t;
/*
* Command line options
*/
typedef struct optdesc {
int o_interval; /* interval between updates */
int o_ntop; /* number of lines in top half */
int o_nbottom; /* number of lines in bottom half */
int o_count; /* number of iterations */
int o_outpmode; /* selected output mode */
int o_sortorder; /* +1 ascending, -1 descending */
} optdesc_t;
#ifdef __cplusplus
}
#endif
#endif /* _PRSTAT_H */