BloombergLP::balb::PerformanceMonitor_LinuxProcStatistics

Describes the fields present in /proc/<pid>/stat. For a complete description of each field, see man proc.

Synopsis

Declared in <balb_performancemonitor.h>

struct PerformanceMonitor_LinuxProcStatistics;

Description

Note that sizes of the data fields are defined in terms of scanf(3) format specifiers, such as %d, %lu or %c. There is no good way to know if %lu is 32-bit wide or 64-bit, because the code can be built in the -m32 mode making sizeof(unsigned long)==4 and executed on a 64bit platform where the kernel thinks that %lu can represent 64-bit wide integers. Therefore we use Uint64 regardless of the build configuration.

Type Aliases

Name
LdType
LluType
LuType

Member Functions

NameDescription
PerformanceMonitor_LinuxProcStatistics [constructor]Default construct all fields in this object.
parseProcStatString Parse the specified procStatString and populate all the fields in this struct. Check that the specified pid matches the pid field in the string. Return 0 on success and a non-zero value otherwise.

Static Member Functions

NameDescription
readProcStatString For the specified process id pid, load the contents of the file /proc/<pid>/stat into the specified buffer. Return 0 on success and a non-zero value otherwise.

Data Members

Name
d_cmajflt
d_cminflt
d_comm
d_cstime
d_cutime
d_flags
d_itrealvalue
d_majflt
d_minflt
d_nice
d_numThreads
d_pgrp
d_pid
d_ppid
d_priority
d_rss
d_session
d_starttime
d_state
d_stime
d_tpgid
d_tty_nr
d_utime
d_vsize