Go to the documentation of this file.
25 unsigned long long int luser_mode_time = 0, lnice_time = 0, lsystem_time = 0,
26 lidle_time = 0, liowait_time = 0, lirq_time = 0,
27 lsoftirq_time = 0, lsteal_time = 0, lguest_time = 0,
30 aCPULine >> luser_mode_time;
31 aCPULine >> lnice_time;
32 aCPULine >> lsystem_time;
33 aCPULine >> lidle_time;
34 aCPULine >> liowait_time;
35 aCPULine >> lirq_time;
36 aCPULine >> lsoftirq_time;
37 aCPULine >> lsteal_time;
38 aCPULine >> lguest_time;
39 aCPULine >> lguest_nice_time;
42 luser_mode_time -= lguest_time;
43 lnice_time -= lguest_nice_time;
46 unsigned long long int lidle_all_time = 0, lsystem_all_time = 0,
47 lguest_all_time = 0, ltotal_time = 0;
49 lidle_all_time = lidle_time + liowait_time;
50 lsystem_all_time = lsystem_time + lirq_time + lsoftirq_time;
51 lguest_all_time = lguest_time + lguest_nice_time;
52 ltotal_time = luser_mode_time + lnice_time + lsystem_all_time +
53 lidle_all_time + lsteal_time + lguest_all_time;
113 aif.open(
"/proc/stat", std::ifstream::in);
116 while (std::getline(aif, aline)) {
118 std::istringstream anISSLine(aline);
119 std::string line_hdr;
120 anISSLine >> line_hdr;
123 std::size_t pos = line_hdr.find(
"cpu");
124 std::string str_cpunbr = line_hdr.substr(pos + 3);
127 if (pos == 0 and str_cpunbr.empty()) {
133 std::istringstream iss(str_cpunbr);
150 for (
unsigned long i = 0; i < (
unsigned long)
cpuNb_; i++)
void ProcessCPULine(unsigned int cpunb, std::istringstream &aCPULine)
unsigned long long int idle_all_time_
Time spend in doing nothing.
unsigned long long int computePeriod(unsigned long long int &a, unsigned long long int &b)
CPUData gCPUData_
Global CPU information.
unsigned long long int guest_time_
unsigned long long int idle_time_
Time spend in doing nothing.
unsigned long long int system_all_time_
Time spend in system mode.
unsigned long long int iowait_period_
Time spend in waiting an input/output to complete.
unsigned long long int steal_time_
unsigned long long int system_period_
Time spend in system mode.
unsigned long long int user_mode_period_
Time spend in user mode.
unsigned long long int irq_time_
Time spend in servicing hardware interrupts.
unsigned long long int system_all_period_
Time spend in all system mode.
unsigned long long int guest_period_
void readProcStat()
Update CPU data information from /proc/stat.
unsigned long long int system_time_
Time spend in system mode.
std::vector< CPUData > vCPUData_
Vector of CPU informations.
void init()
Read /proc/state file to extract CPU count.
unsigned long long int idle_all_period_
Time spend in doing nothing.
unsigned long long int steal_period_
unsigned long long int idle_period_
Time spend in doing nothing.
unsigned long long int irq_period_
Time spend in servicing hardware interrupts.
unsigned long long int nice_period_
Time spend in user mode with low priority (nice mode)
unsigned long long int total_period_
Various classes of time spend by the CPU by periodTotal time.
unsigned int cpuNb_
Number of CPU.
unsigned long long int total_time_
Various classes of time spend by the CPUTotal time.
unsigned long long int softirq_period_
Time spend in servicing software interrupts.
unsigned long long int softirq_time_
Time spend in servicing software interrupts.
unsigned long long int user_mode_time_
Time spend in user mode.
void ProcessLine(std::istringstream &aCPULine)
unsigned long long int iowait_time_
Time spend in waiting an input/output to complete.
unsigned long long int nice_time_
Time spend in user mode with low priority (nice mode)
dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Aug 2 2024 08:36:38