@@ -30,11 +30,11 @@ namespace PCMDaemon {
30
30
typedef unsigned long uint64;
31
31
32
32
struct PCMSystem {
33
- uint32 numOfCores;
34
- uint32 numOfOnlineCores;
35
- uint32 numOfSockets;
36
- uint32 numOfOnlineSockets;
37
- uint32 numOfQPILinksPerSocket;
33
+ uint32 numOfCores; // the number of logical cores in the system
34
+ uint32 numOfOnlineCores; // the number of online logical cores in the system
35
+ uint32 numOfSockets; // the number of CPU sockets in the system
36
+ uint32 numOfOnlineSockets; // the number of online CPU sockets in the system
37
+ uint32 numOfQPILinksPerSocket; // the number of QPI or UPI (xPI) links per socket
38
38
public:
39
39
PCMSystem () :
40
40
numOfCores (0 ),
@@ -47,30 +47,30 @@ namespace PCMDaemon {
47
47
typedef struct PCMSystem PCMSystem;
48
48
49
49
struct PCMCoreCounter {
50
- uint64 coreId = 0 ;
51
- int32 socketId = 0 ;
52
- double instructionsPerCycle = 0 .;
53
- uint64 cycles = 0 ;
54
- uint64 instructionsRetired = 0 ;
55
- double execUsage = 0 .;
56
- double relativeFrequency = 0 .;
57
- double activeRelativeFrequency = 0 .;
58
- uint64 l3CacheMisses = 0 ;
59
- uint64 l3CacheReference = 0 ;
60
- uint64 l2CacheMisses = 0 ;
61
- double l3CacheHitRatio = 0 .;
62
- double l2CacheHitRatio = 0 .;
63
- double l3CacheMPI = 0 .;
64
- double l2CacheMPI = 0 .;
65
- bool l3CacheOccupancyAvailable;
66
- uint64 l3CacheOccupancy;
67
- bool localMemoryBWAvailable;
68
- uint64 localMemoryBW;
69
- bool remoteMemoryBWAvailable;
70
- uint64 remoteMemoryBW;
71
- uint64 localMemoryAccesses = 0 ;
72
- uint64 remoteMemoryAccesses = 0 ;
73
- int32 thermalHeadroom = 0 ;
50
+ uint64 coreId = 0 ; // core ID
51
+ int32 socketId = 0 ; // socket ID
52
+ double instructionsPerCycle = 0 .; // instructions per cycle metric
53
+ uint64 cycles = 0 ; // cpu cycle metric
54
+ uint64 instructionsRetired = 0 ; // number of retired instructions metric
55
+ double execUsage = 0 .; // instructions per nominal CPU cycle, i.e. in respect to the CPU frequency ignoring turbo and power saving
56
+ double relativeFrequency = 0 .; // frequency relative to nominal CPU frequency (“clockticks”/”invariant timer ticks”)
57
+ double activeRelativeFrequency = 0 .; // frequency relative to nominal CPU frequency excluding the time when the CPU is sleeping
58
+ uint64 l3CacheMisses = 0 ; // L3 cache line misses
59
+ uint64 l3CacheReference = 0 ; // L3 cache line references (accesses)
60
+ uint64 l2CacheMisses = 0 ; // L2 cache line misses
61
+ double l3CacheHitRatio = 0 .; // L3 cache hit ratio
62
+ double l2CacheHitRatio = 0 .; // L2 cachhe hit ratio
63
+ double l3CacheMPI = 0 .; // number of L3 cache misses per retired instruction
64
+ double l2CacheMPI = 0 .; // number of L2 cache misses per retired instruction
65
+ bool l3CacheOccupancyAvailable; // true if L3 cache occupancy metric is available
66
+ uint64 l3CacheOccupancy; // L3 cache occupancy in KBytes
67
+ bool localMemoryBWAvailable; // true if local memory bandwidth metric (L3 cache external bandwidth satisfied by local memory) is available
68
+ uint64 localMemoryBW; // L3 cache external bandwidth satisfied by local memory (in MBytes)
69
+ bool remoteMemoryBWAvailable; // true if remote memory bandwidth metric (L3 cache external bandwidth satisfied by remote memory) is available
70
+ uint64 remoteMemoryBW; // L3 cache external bandwidth satisfied by remote memory (in MBytes)
71
+ uint64 localMemoryAccesses = 0 ; // the number of local DRAM memory accesses
72
+ uint64 remoteMemoryAccesses = 0 ; // the number of remote DRAM memory accesses
73
+ int32 thermalHeadroom = 0 ; // thermal headroom in Kelvin (max design temperature – current temperature)
74
74
75
75
public:
76
76
PCMCoreCounter () :
@@ -86,8 +86,8 @@ namespace PCMDaemon {
86
86
87
87
struct PCMCore {
88
88
PCMCoreCounter cores[MAX_CPU_CORES];
89
- bool packageEnergyMetricsAvailable;
90
- double energyUsedBySockets[MAX_SOCKETS] ALIGN(ALIGNMENT);
89
+ bool packageEnergyMetricsAvailable; // true if CPU package (a.k.a. socket) energy metric is available
90
+ double energyUsedBySockets[MAX_SOCKETS] ALIGN(ALIGNMENT); // energy consumed/used by CPU (socket) in Joules
91
91
92
92
public:
93
93
PCMCore () :
@@ -102,9 +102,9 @@ namespace PCMDaemon {
102
102
typedef struct PCMCore PCMCore;
103
103
104
104
struct PCMMemoryChannelCounter {
105
- float read;
106
- float write;
107
- float total;
105
+ float read; // DRAM read traffic in MBytes/sec
106
+ float write; // DRAM write traffic in MBytes/sec
107
+ float total; // total traffic in MBytes/sec
108
108
109
109
public:
110
110
PCMMemoryChannelCounter () :
@@ -116,16 +116,16 @@ namespace PCMDaemon {
116
116
typedef struct PCMMemoryChannelCounter PCMMemoryChannelCounter;
117
117
118
118
struct PCMMemorySocketCounter {
119
- uint64 socketId = 0 ;
119
+ uint64 socketId = 0 ; // socket ID
120
120
PCMMemoryChannelCounter channels[MEMORY_MAX_IMC_CHANNELS];
121
- uint32 numOfChannels;
121
+ uint32 numOfChannels; // number of memory channels in the CPU socket
122
122
float read; // DRAM read traffic in MBytes/sec
123
123
float write; // DRAM write traffic in MBytes/sec
124
124
float pmmRead; // PMM read traffic in MBytes/sec
125
125
float pmmWrite; // PMM write traffic in MBytes/sec
126
126
float total; // total traffic in MBytes/sec
127
127
float pmmMemoryModeHitRate; // PMM memory mode hit rate estimation. Metric value range is [0..1]
128
- double dramEnergy;
128
+ double dramEnergy; // energy consumed/used by DRAM memory in Joules
129
129
130
130
public:
131
131
PCMMemorySocketCounter () :
@@ -175,8 +175,8 @@ namespace PCMDaemon {
175
175
typedef struct PCMMemory PCMMemory;
176
176
177
177
struct PCMQPILinkCounter {
178
- uint64 bytes;
179
- double utilization;
178
+ uint64 bytes; // bytes of certain traffic class transfered over QPI or UPI link
179
+ double utilization; // utilization of the link caused by the certain traffic class
180
180
181
181
public:
182
182
PCMQPILinkCounter () :
@@ -187,9 +187,9 @@ namespace PCMDaemon {
187
187
typedef struct PCMQPILinkCounter PCMQPILinkCounter;
188
188
189
189
struct PCMQPISocketCounter {
190
- uint64 socketId = 0 ;
190
+ uint64 socketId = 0 ; // socket ID
191
191
PCMQPILinkCounter links[QPI_MAX_LINKS];
192
- uint64 total;
192
+ uint64 total; // total number of transfered bytes of a certain traffic class
193
193
194
194
public:
195
195
PCMQPISocketCounter () :
@@ -199,12 +199,12 @@ namespace PCMDaemon {
199
199
typedef struct PCMQPISocketCounter PCMQPISocketCounter;
200
200
201
201
struct PCMQPI {
202
- PCMQPISocketCounter incoming[MAX_SOCKETS];
203
- uint64 incomingTotal;
204
- PCMQPISocketCounter outgoing[MAX_SOCKETS];
205
- uint64 outgoingTotal;
206
- bool incomingQPITrafficMetricsAvailable;
207
- bool outgoingQPITrafficMetricsAvailable;
202
+ PCMQPISocketCounter incoming[MAX_SOCKETS]; // incoming data traffic class statistics
203
+ uint64 incomingTotal; // incoming data traffic total bytes
204
+ PCMQPISocketCounter outgoing[MAX_SOCKETS]; // outgoing data+"non-data" traffic class statistics
205
+ uint64 outgoingTotal; // outgoing data+"non-data" traffic total bytes
206
+ bool incomingQPITrafficMetricsAvailable; // true if incoming data traffic class statistics metrics are available
207
+ bool outgoingQPITrafficMetricsAvailable; // true if outgoing data+"non-data" class statistics metrics are available
208
208
209
209
public:
210
210
PCMQPI () :
@@ -226,13 +226,13 @@ namespace PCMDaemon {
226
226
typedef struct SharedPCMCounters SharedPCMCounters;
227
227
228
228
struct SharedPCMState {
229
- char version[VERSION_SIZE];
230
- uint64 lastUpdateTscBegin;
231
- uint64 timestamp;
232
- uint64 cyclesToGetPCMState;
233
- uint32 pollMs;
229
+ char version[VERSION_SIZE]; // version (null-terminated string)
230
+ uint64 lastUpdateTscBegin; // time stamp counter (TSC) obtained via rdtsc instruction *before* the state update
231
+ uint64 timestamp; // monotonic time since some unspecified starting point in nanoseconds *after* the state update
232
+ uint64 cyclesToGetPCMState; // time it took to update the state measured in TSC cycles
233
+ uint32 pollMs; // the poll interval in shared memory in milliseconds
234
234
SharedPCMCounters pcm;
235
- uint64 lastUpdateTscEnd;
235
+ uint64 lastUpdateTscEnd; // time stamp counter (TSC) obtained via rdtsc instruction *after* the state update
236
236
237
237
public:
238
238
SharedPCMState () :
0 commit comments