This class encapsulates struct rusage and getrusage() functionality. More...
#include <DwmRusage.hh>
Public Member Functions | |
| Rusage () | |
| Constructor. | |
| Rusage (const struct rusage &rusage) | |
| Construct from a struct rusagee. | |
| bool | Get (int who) |
| Get the current process' rusage. | |
| const TimeValue & | UserTime () const |
| The total amount of time spent executing in user mode. | |
| const TimeValue & | SystemTime () const |
| The total amount of time spent in the system executing on behalf of the process(es). | |
| int64_t | MaxResidentSetSize () const |
| The maximum resident set size utilized (in bytes). | |
| int64_t | IntegralSharedTextMemorySize () const |
| An integral value indicating the amount of memory used by the text segment that was also shared among other pro- cesses. | |
| int64_t | IntegralUnsharedDataSize () const |
| An integral value of the amount of unshared memory residing in the data segment of a process (expressed in units of bytes * ticks-of-execution). | |
| int64_t | IntegralUnsharedStackSize () const |
| An integral value of the amount of unshared memory residing in the stack segment of a process (expressed in units of bytes * ticks-of-execution). | |
| int32_t | PageReclaims () const |
| The number of page faults serviced without any I/O activity; here I/O activity is avoided by reclaiming a page frame from the list of pages awaiting reallocation. | |
| int32_t | PageFaults () const |
| The number of page faults serviced that required I/O activity. | |
| int32_t | Swaps () const |
| The number of times a process was `‘swapped’' out of main memory. | |
| int32_t | BlockInputOperations () const |
| The number of times the file system had to perform input. | |
| int32_t | BlockOutputOperations () const |
| The number of times the file system had to perform output. | |
| int32_t | MessagesSent () const |
| The number of IPC messages sent. | |
| int32_t | MessagesReceived () const |
| The number of IPC messages received. | |
| int32_t | SignalsReceived () const |
| The number of signals delivered. | |
| int32_t | VoluntaryContextSwitches () const |
| The number of times a context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource). | |
| int32_t | InvoluntaryContextSwitches () const |
| The number of times a context switch resulted due to a higher priority process becoming runnable or because the current process exceeded its time slice. | |
| std::istream & | Read (std::istream &is) |
| Reads from an istream. Returns the istream. | |
| std::ostream & | Write (std::ostream &os) const |
| Writes to an ostream. Returns the ostream. | |
| int | Read (gzFile gzf) |
| Reads from a gzFile. | |
| int | Write (gzFile gzf) const |
| Writes to a gzFile. | |
| ssize_t | Read (int fd) |
| Reads from a file descriptor. | |
| ssize_t | Write (int fd) const |
| Writes to a file descriptor. | |
| uint64_t | StreamedLength () const |
| Returns the number of bytes that would be written if we called one of the Write() members. | |
| bool | operator== (const Rusage &rusage) const |
| operator == | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Rusage &r) |
| Prints to an ostream. | |
This class encapsulates struct rusage and getrusage() functionality.
| bool Dwm::Rusage::Get | ( | int | who | ) |
Get the current process' rusage.
who may be RUSAGE_SELF or RUSAGE_CHILDREN. See the getrusage(2) manpage.
| int64_t Dwm::Rusage::IntegralSharedTextMemorySize | ( | ) | const |
An integral value indicating the amount of memory used by the text segment that was also shared among other pro- cesses.
This value is expressed in units of bytes * ticks-of-execution. Ticks are statistics clock ticks. The statistics clock has a frequency of sysconf(_SC_CLK_TCK) ticks per second.
| int Dwm::Rusage::Read | ( | gzFile | gzf | ) |
Reads from a gzFile.
Returns the number of bytes read on success, -1 on failure.
| ssize_t Dwm::Rusage::Read | ( | int | fd | ) |
Reads from a file descriptor.
Returns the number of bytes read on success, -1 on failure.
| int Dwm::Rusage::Write | ( | gzFile | gzf | ) | const |
Writes to a gzFile.
Returns the number of bytes written on success, -1 on failure.
| ssize_t Dwm::Rusage::Write | ( | int | fd | ) | const |
Writes to a file descriptor.
Returns the number of bytes written on success, -1 on failure.