CMS 3D CMS Logo

lat::ResourceInfo Class Reference

Access to resource consumption and limits. More...

#include <Iguana/Utilities/classlib/utils/ResourceInfo.h>

List of all members.

Public Types

enum  Kind { SOFT, HARD }
enum  Limit {
  LIMIT_CPU_TIME, LIMIT_FILE_SIZE, LIMIT_CORE_SIZE, LIMIT_N_PROCESSES,
  LIMIT_N_OPEN_FILES, LIMIT_VMEMORY, LIMIT_VMEMORY_RSS, LIMIT_VMEMORY_LOCKED,
  LIMIT_VMEMORY_DATA, LIMIT_VMEMORY_STACK, LIMIT_MAX = LIMIT_VMEMORY_STACK
}
enum  Resource {
  RES_USER_TIME, RES_SYSTEM_TIME, RES_MAX_RSS, RES_TEXT_RSS,
  RES_DATA_RSS, RES_STACK_RSS, RES_MINOR_PAGE_FAULTS, RES_MAJOR_PAGE_FAULTS,
  RES_SWAPS, RES_FILESYS_OPS_IN, RES_FILESYS_OPS_OUT, RES_IPC_MSGS_SENT,
  RES_IPC_MSGS_RECEIVED, RES_SIGNALS, RES_VOLUNTARY_CONTEXT_SWITCHES, RES_INVOLUNTARY_CONTEXT_SWITCHES,
  RES_VMEMORY, RES_VMEMORY_LOCKED, RES_VMEMORY_RSS, RES_VMEMORY_RSS_LIMIT,
  RES_VMEMORY_DATA, RES_VMEMORY_STACK, RES_VMEMORY_EXE, RES_VMEMORY_LIBRARIES,
  RES_VMEMORY_SHARED, RES_VMEMORY_DIRTY, RES_VMEMORY_PERCENTAGE, RES_VMEMORY_TEXT_BASE,
  RES_VMEMORY_TEXT_TOP, RES_VMEMORY_BSS_BASE, RES_VMEMORY_BSS_TOP, RES_VMEMORY_DATA_BASE,
  RES_VMEMORY_DATA_TOP, RES_VMEMORY_BREAK_BASE, RES_VMEMORY_BREAK_TOP, RES_VMEMORY_STACK_BASE,
  RES_VMEMORY_STACK_TOP, RES_VMEMORY_KERNEL_SP, RES_VMEMORY_KERNEL_IP, RES_N_FILE_DESCRIPTORS,
  RES_MAX_FILE_DESCRIPTORS, RES_PROCESS_STATE, RES_PROCESS_FLAGS, RES_PROCESS_LWPS,
  RES_PROCESS_ADDRESS, RES_TIME_SLICE_SIZE, RES_PRIORITY_NICE, RES_PRIORITY,
  RES_TIMEOUT, RES_INTERVAL_TIME_LEFT, RES_START_TIME, RES_CPU,
  RES_CPU_PERCENTAGE, RES_INITIAL_ARGC, RES_INITIAL_ARGV, RES_INITIAL_ENVP,
  RES_DATA_MODEL, RES_MAX
}
enum  Source { RES_FOR_SYSTEM, RES_FOR_SELF, RES_FOR_SELF_AND_CHILDREN }
typedef std::map< Resource, ValueStatus
typedef unsigned long Value

Static Public Member Functions

static const char * format (Resource type, Value value, char *buffer, size_t size)
static Value getlimit (Limit type, Kind which)
static void getlimits (Limit type, Value &soft, Value &hard)
static Statusinfo (Source from, Status &which)
static Status info (Source from)
static Status info_self (void)
static Status info_self_cumulative (void)
static Status info_system (void)
static const char * name (Resource type)
static Value setlimit (Limit type, Kind which, Value value)
static void setlimits (Limit type, Value soft, Value hard)
static const char * unit (Resource type)

Static Public Attributes

static const Value LIM_INFINITE = ~0UL

Static Private Attributes

static const Details s_resource_details []

Classes

struct  Details


Detailed Description

Access to resource consumption and limits.

Definition at line 18 of file ResourceInfo.h.


Member Typedef Documentation

typedef std::map<Resource,Value> lat::ResourceInfo::Status

Definition at line 142 of file ResourceInfo.h.

typedef unsigned long lat::ResourceInfo::Value

Definition at line 21 of file ResourceInfo.h.


Member Enumeration Documentation

enum lat::ResourceInfo::Kind

Enumerator:
SOFT 
HARD 

Definition at line 25 of file ResourceInfo.h.

00025 { SOFT, HARD };

enum lat::ResourceInfo::Limit

Enumerator:
LIMIT_CPU_TIME 
LIMIT_FILE_SIZE 
LIMIT_CORE_SIZE 
LIMIT_N_PROCESSES 
LIMIT_N_OPEN_FILES 
LIMIT_VMEMORY 
LIMIT_VMEMORY_RSS 
LIMIT_VMEMORY_LOCKED 
LIMIT_VMEMORY_DATA 
LIMIT_VMEMORY_STACK 
LIMIT_MAX 

Definition at line 28 of file ResourceInfo.h.

00029     {
00030         LIMIT_CPU_TIME,
00031         LIMIT_FILE_SIZE,
00032         LIMIT_CORE_SIZE,
00033         LIMIT_N_PROCESSES,
00034         LIMIT_N_OPEN_FILES,
00035 
00036         LIMIT_VMEMORY,
00037         LIMIT_VMEMORY_RSS,
00038         LIMIT_VMEMORY_LOCKED,
00039         LIMIT_VMEMORY_DATA,
00040         LIMIT_VMEMORY_STACK,
00041 
00042         LIMIT_MAX = LIMIT_VMEMORY_STACK
00043     };

enum lat::ResourceInfo::Resource

Enumerator:
RES_USER_TIME 
RES_SYSTEM_TIME 
RES_MAX_RSS 
RES_TEXT_RSS 
RES_DATA_RSS 
RES_STACK_RSS 
RES_MINOR_PAGE_FAULTS 
RES_MAJOR_PAGE_FAULTS 
RES_SWAPS 
RES_FILESYS_OPS_IN 
RES_FILESYS_OPS_OUT 
RES_IPC_MSGS_SENT 
RES_IPC_MSGS_RECEIVED 
RES_SIGNALS 
RES_VOLUNTARY_CONTEXT_SWITCHES 
RES_INVOLUNTARY_CONTEXT_SWITCHES 
RES_VMEMORY 
RES_VMEMORY_LOCKED 
RES_VMEMORY_RSS 
RES_VMEMORY_RSS_LIMIT 
RES_VMEMORY_DATA 
RES_VMEMORY_STACK 
RES_VMEMORY_EXE 
RES_VMEMORY_LIBRARIES 
RES_VMEMORY_SHARED 
RES_VMEMORY_DIRTY 
RES_VMEMORY_PERCENTAGE 
RES_VMEMORY_TEXT_BASE 
RES_VMEMORY_TEXT_TOP 
RES_VMEMORY_BSS_BASE 
RES_VMEMORY_BSS_TOP 
RES_VMEMORY_DATA_BASE 
RES_VMEMORY_DATA_TOP 
RES_VMEMORY_BREAK_BASE 
RES_VMEMORY_BREAK_TOP 
RES_VMEMORY_STACK_BASE 
RES_VMEMORY_STACK_TOP 
RES_VMEMORY_KERNEL_SP 
RES_VMEMORY_KERNEL_IP 
RES_N_FILE_DESCRIPTORS 
RES_MAX_FILE_DESCRIPTORS 
RES_PROCESS_STATE 
RES_PROCESS_FLAGS 
RES_PROCESS_LWPS 
RES_PROCESS_ADDRESS 
RES_TIME_SLICE_SIZE 
RES_PRIORITY_NICE 
RES_PRIORITY 
RES_TIMEOUT 
RES_INTERVAL_TIME_LEFT 
RES_START_TIME 
RES_CPU 
RES_CPU_PERCENTAGE 
RES_INITIAL_ARGC 
RES_INITIAL_ARGV 
RES_INITIAL_ENVP 
RES_DATA_MODEL 
RES_MAX 

Definition at line 46 of file ResourceInfo.h.

00047     {
00048         // Resources for usage consumption (rusage)
00049         RES_USER_TIME,          // seconds
00050         RES_SYSTEM_TIME,        // seconds
00051         RES_MAX_RSS,            // kB
00052         RES_TEXT_RSS,           // kB*s
00053         RES_DATA_RSS,           // kB*s
00054         RES_STACK_RSS,          // kB*s
00055         RES_MINOR_PAGE_FAULTS,
00056         RES_MAJOR_PAGE_FAULTS,
00057         RES_SWAPS,
00058         RES_FILESYS_OPS_IN,
00059         RES_FILESYS_OPS_OUT,
00060         RES_IPC_MSGS_SENT,
00061         RES_IPC_MSGS_RECEIVED,
00062         RES_SIGNALS,
00063         RES_VOLUNTARY_CONTEXT_SWITCHES,
00064         RES_INVOLUNTARY_CONTEXT_SWITCHES,
00065 
00066         // minfault (process / process + children)
00067         // majfault (process / process + children)
00068         // utime (process / process + children)
00069         // stime (process / process + children)
00070         // swaps (process / process + children)
00071         // times: user/system = cpu, idle (see TimeInfo)
00072 
00073         RES_VMEMORY,
00074         RES_VMEMORY_LOCKED,
00075         RES_VMEMORY_RSS,
00076         RES_VMEMORY_RSS_LIMIT,
00077         RES_VMEMORY_DATA,
00078         RES_VMEMORY_STACK,
00079         RES_VMEMORY_EXE,
00080         RES_VMEMORY_LIBRARIES,
00081         RES_VMEMORY_SHARED,
00082         RES_VMEMORY_DIRTY,
00083         RES_VMEMORY_PERCENTAGE,
00084 
00085         RES_VMEMORY_TEXT_BASE,
00086         RES_VMEMORY_TEXT_TOP,
00087         RES_VMEMORY_BSS_BASE,
00088         RES_VMEMORY_BSS_TOP,
00089         RES_VMEMORY_DATA_BASE,
00090         RES_VMEMORY_DATA_TOP,
00091         RES_VMEMORY_BREAK_BASE,
00092         RES_VMEMORY_BREAK_TOP,
00093         RES_VMEMORY_STACK_BASE,
00094         RES_VMEMORY_STACK_TOP,
00095 
00096         RES_VMEMORY_KERNEL_SP,
00097         RES_VMEMORY_KERNEL_IP,
00098 
00099         // file descriptors? (/proc/self/fd?)
00100         RES_N_FILE_DESCRIPTORS,
00101         RES_MAX_FILE_DESCRIPTORS,
00102 
00103         // process state
00104         RES_PROCESS_STATE,
00105         RES_PROCESS_FLAGS,
00106         RES_PROCESS_LWPS,
00107         RES_PROCESS_ADDRESS,
00108         RES_TIME_SLICE_SIZE,
00109         RES_PRIORITY_NICE,
00110         RES_PRIORITY,
00111         RES_TIMEOUT,
00112         RES_INTERVAL_TIME_LEFT,
00113         RES_START_TIME,
00114         RES_CPU,
00115         RES_CPU_PERCENTAGE,
00116 
00117         RES_INITIAL_ARGC,
00118         RES_INITIAL_ARGV,
00119         RES_INITIAL_ENVP,
00120 
00121         RES_DATA_MODEL,
00122 
00123         // pid, ppid, pgrp, sid, tty, tpgid?
00124         // memory area maps? mmaps?
00125         // root?
00126         // pending signals?
00127         // blocked signals?
00128         // ignored signals?
00129         // caught signals?
00130         // wait channel?
00131 
00132         // system resource status? (total vmem, swap, ...)?
00133         RES_MAX
00134     };

enum lat::ResourceInfo::Source

Enumerator:
RES_FOR_SYSTEM 
RES_FOR_SELF 
RES_FOR_SELF_AND_CHILDREN 

Definition at line 136 of file ResourceInfo.h.

00136                 {
00137         RES_FOR_SYSTEM,
00138         RES_FOR_SELF,
00139         RES_FOR_SELF_AND_CHILDREN
00140     };


Member Function Documentation

static const char* lat::ResourceInfo::format ( Resource  type,
Value  value,
char *  buffer,
size_t  size 
) [static]

Referenced by IgQtAppDebugResourceInfo::update().

static Value lat::ResourceInfo::getlimit ( Limit  type,
Kind  which 
) [static]

static void lat::ResourceInfo::getlimits ( Limit  type,
Value soft,
Value hard 
) [static]

static Status& lat::ResourceInfo::info ( Source  from,
Status which 
) [static]

static Status lat::ResourceInfo::info ( Source  from  )  [static]

static Status lat::ResourceInfo::info_self ( void   )  [static]

Referenced by IgQtAppDebugResourceInfo::update().

static Status lat::ResourceInfo::info_self_cumulative ( void   )  [static]

static Status lat::ResourceInfo::info_system ( void   )  [static]

static const char* lat::ResourceInfo::name ( Resource  type  )  [static]

Referenced by IgQtAppDebugResourceInfo::update().

static Value lat::ResourceInfo::setlimit ( Limit  type,
Kind  which,
Value  value 
) [static]

static void lat::ResourceInfo::setlimits ( Limit  type,
Value  soft,
Value  hard 
) [static]

static const char* lat::ResourceInfo::unit ( Resource  type  )  [static]

Referenced by IgQtAppDebugResourceInfo::update().


Member Data Documentation

const Value lat::ResourceInfo::LIM_INFINITE = ~0UL [static]

Definition at line 22 of file ResourceInfo.h.

const Details lat::ResourceInfo::s_resource_details[] [static, private]

Definition at line 211 of file ResourceInfo.h.


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:48:34 2009 for CMSSW by  doxygen 1.5.4