process-list.hh
Go to the documentation of this file.
1 /* Copyright LAAS, CNRS
2  * Author: O. Stasse, 2019
3  * See LICENSE file in the root directory of this repository.
4  */
5 
6 #ifndef DYNAMIC_GRAPH_PROCESS_LIST_H_
7 #define DYNAMIC_GRAPH_PROCESS_LIST_H_
8 
10 
11 #include <boost/archive/text_iarchive.hpp>
12 #include <boost/archive/text_oarchive.hpp>
13 #include <boost/serialization/vector.hpp>
14 #include <dynamic-graph/fwd.hh>
15 
16 namespace dynamicgraph {
17 namespace CPU {
18 class DYNAMIC_GRAPH_DLLAPI ProcessData {};
19 
20 class DYNAMIC_GRAPH_DLLAPI ProcessList {
21  public:
22  ProcessList();
23 };
24 
27 class DYNAMIC_GRAPH_DLLAPI CPUData {
28  public:
29  CPUData();
30  int cpu_id_;
31 
32  inline unsigned long long int computePeriod(unsigned long long int &a,
33  unsigned long long int &b) {
34  return (a > b) ? a - b : 0;
35  }
36 
40  unsigned long long int total_time_;
42  unsigned long long int user_mode_time_;
44  unsigned long long int nice_time_;
46  unsigned long long int system_time_;
48  unsigned long long int system_all_time_;
50  unsigned long long int idle_time_;
52  unsigned long long int idle_all_time_;
54  unsigned long long int iowait_time_;
56  unsigned long long int irq_time_;
58  unsigned long long int softirq_time_;
61  unsigned long long int steal_time_;
64  unsigned long long int guest_time_;
68  unsigned long long int guest_nice_time_;
70 
74  unsigned long long int total_period_;
76  unsigned long long int user_mode_period_;
78  unsigned long long int nice_period_;
80  unsigned long long int system_period_;
82  unsigned long long int system_all_period_;
84  unsigned long long int idle_period_;
86  unsigned long long int idle_all_period_;
88  unsigned long long int iowait_period_;
90  unsigned long long int irq_period_;
92  unsigned long long int softirq_period_;
95  unsigned long long int steal_period_;
98  unsigned long long int guest_period_;
100 
101  double percent_;
102  void ProcessLine(std::istringstream &aCPULine);
103 
104  friend class boost::serialization::access;
105 
106  template <class Archive>
107  void serialize(Archive &ar, const unsigned int version) {
108  ar & version;
109  ar & total_time_;
110  ar & user_mode_time_;
111  ar & nice_time_;
112  ar & system_time_;
113  ar & system_all_time_;
114  ar & idle_time_;
115  ar & idle_all_time_;
116  ar & iowait_time_;
117  ar & irq_time_;
118  ar & softirq_time_;
119  ar & steal_time_;
120  ar & guest_time_;
121  ar & guest_nice_time_;
122  ar & percent_;
123  }
124 };
125 
128 class DYNAMIC_GRAPH_DLLAPI System {
129  private:
130  bool init_;
131 
132  public:
133  System();
134 
136  void init();
137 
139  void readProcStat();
140 
142  friend class boost::serialization::access;
143 
145  unsigned int cpuNb_;
146 
147  void ProcessCPULine(unsigned int cpunb, std::istringstream &aCPULine);
148 
150  std::vector<CPUData> vCPUData_;
151 
154 
155  template <class Archive>
156  void serialize(Archive &ar, const unsigned int version) {
157  ar & version;
158  ar & cpuNb_;
159  ar & gCPUData_;
160  ar & vCPUData_;
161  }
162 };
163 } // namespace CPU
164 } // namespace dynamicgraph
165 
166 #endif /* DYNAMIC_GRAPH_PROCESS_LIST_H_ */
dynamicgraph::CPU::CPUData::idle_all_time_
unsigned long long int idle_all_time_
Time spend in doing nothing.
Definition: process-list.hh:52
dynamicgraph::CPU::System::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: process-list.hh:156
dynamicgraph::CPU::CPUData::computePeriod
unsigned long long int computePeriod(unsigned long long int &a, unsigned long long int &b)
Definition: process-list.hh:32
dynamicgraph::CPU::ProcessList
Definition: process-list.hh:20
dynamicgraph::CPU::System::gCPUData_
CPUData gCPUData_
Global CPU information.
Definition: process-list.hh:153
dynamic-graph-api.h
dynamicgraph::CPU::CPUData::guest_time_
unsigned long long int guest_time_
Definition: process-list.hh:64
dynamicgraph::CPU::CPUData::idle_time_
unsigned long long int idle_time_
Time spend in doing nothing.
Definition: process-list.hh:50
dynamicgraph
dynamicgraph::CPU::CPUData::system_all_time_
unsigned long long int system_all_time_
Time spend in system mode.
Definition: process-list.hh:48
dynamicgraph::CPU::CPUData::iowait_period_
unsigned long long int iowait_period_
Time spend in waiting an input/output to complete.
Definition: process-list.hh:88
dynamicgraph::CPU::CPUData::steal_time_
unsigned long long int steal_time_
Definition: process-list.hh:61
dynamicgraph::CPU::CPUData::system_period_
unsigned long long int system_period_
Time spend in system mode.
Definition: process-list.hh:80
dynamicgraph::CPU::CPUData::user_mode_period_
unsigned long long int user_mode_period_
Time spend in user mode.
Definition: process-list.hh:76
dynamicgraph::CPU::CPUData::irq_time_
unsigned long long int irq_time_
Time spend in servicing hardware interrupts.
Definition: process-list.hh:56
dynamicgraph::CPU::CPUData::system_all_period_
unsigned long long int system_all_period_
Time spend in all system mode.
Definition: process-list.hh:82
dynamicgraph::CPU::CPUData::guest_nice_time_
unsigned long long int guest_nice_time_
Definition: process-list.hh:68
dynamicgraph::CPU::CPUData::guest_period_
unsigned long long int guest_period_
Definition: process-list.hh:98
dynamicgraph::CPU::CPUData::system_time_
unsigned long long int system_time_
Time spend in system mode.
Definition: process-list.hh:46
dynamicgraph::CPU::System::vCPUData_
std::vector< CPUData > vCPUData_
Vector of CPU informations.
Definition: process-list.hh:150
dynamicgraph::CPU::CPUData::serialize
void serialize(Archive &ar, const unsigned int version)
Definition: process-list.hh:107
fwd.hh
dynamicgraph::CPU::CPUData::idle_all_period_
unsigned long long int idle_all_period_
Time spend in doing nothing.
Definition: process-list.hh:86
dynamicgraph::CPU::CPUData::steal_period_
unsigned long long int steal_period_
Definition: process-list.hh:95
dynamicgraph::CPU::CPUData::idle_period_
unsigned long long int idle_period_
Time spend in doing nothing.
Definition: process-list.hh:84
setup.version
version
Definition: setup.in.py:180
dynamicgraph::CPU::ProcessData
Definition: process-list.hh:18
dynamicgraph::CPU::CPUData::irq_period_
unsigned long long int irq_period_
Time spend in servicing hardware interrupts.
Definition: process-list.hh:90
dynamicgraph::CPU::CPUData::cpu_id_
int cpu_id_
Definition: process-list.hh:30
dynamicgraph::CPU::System
Definition: process-list.hh:128
dynamicgraph::CPU::System::init_
bool init_
Definition: process-list.hh:130
dynamicgraph::CPU::CPUData::nice_period_
unsigned long long int nice_period_
Time spend in user mode with low priority (nice mode)
Definition: process-list.hh:78
dynamicgraph::CPU::CPUData::total_period_
unsigned long long int total_period_
Various classes of time spend by the CPU by periodTotal time.
Definition: process-list.hh:74
dynamicgraph::CPU::System::cpuNb_
unsigned int cpuNb_
Number of CPU.
Definition: process-list.hh:145
dynamicgraph::CPU::CPUData
Definition: process-list.hh:27
dynamicgraph::CPU::CPUData::total_time_
unsigned long long int total_time_
Various classes of time spend by the CPUTotal time.
Definition: process-list.hh:40
dynamicgraph::CPU::CPUData::softirq_period_
unsigned long long int softirq_period_
Time spend in servicing software interrupts.
Definition: process-list.hh:92
dynamicgraph::CPU::CPUData::softirq_time_
unsigned long long int softirq_time_
Time spend in servicing software interrupts.
Definition: process-list.hh:58
dynamicgraph::CPU::CPUData::percent_
double percent_
Definition: process-list.hh:101
dynamicgraph::CPU::CPUData::user_mode_time_
unsigned long long int user_mode_time_
Time spend in user mode.
Definition: process-list.hh:42
dynamicgraph::CPU::CPUData::iowait_time_
unsigned long long int iowait_time_
Time spend in waiting an input/output to complete.
Definition: process-list.hh:54
dynamicgraph::CPU::CPUData::nice_time_
unsigned long long int nice_time_
Time spend in user mode with low priority (nice mode)
Definition: process-list.hh:44


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Aug 2 2024 08:36:38