Skip to content

Commit 126c8fe

Browse files
committed
document all pcm-daemon metrics in the common.h header
Change-Id: Ic43621cc05d7be2ed9dc8b2b7e6c33f28027981f
1 parent bea1459 commit 126c8fe

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

src/daemon/common.h

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ namespace PCMDaemon {
3030
typedef unsigned long uint64;
3131

3232
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
3838
public:
3939
PCMSystem() :
4040
numOfCores(0),
@@ -47,30 +47,30 @@ namespace PCMDaemon {
4747
typedef struct PCMSystem PCMSystem;
4848

4949
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)
7474

7575
public:
7676
PCMCoreCounter() :
@@ -86,8 +86,8 @@ namespace PCMDaemon {
8686

8787
struct PCMCore {
8888
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
9191

9292
public:
9393
PCMCore() :
@@ -102,9 +102,9 @@ namespace PCMDaemon {
102102
typedef struct PCMCore PCMCore;
103103

104104
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
108108

109109
public:
110110
PCMMemoryChannelCounter() :
@@ -116,16 +116,16 @@ namespace PCMDaemon {
116116
typedef struct PCMMemoryChannelCounter PCMMemoryChannelCounter;
117117

118118
struct PCMMemorySocketCounter {
119-
uint64 socketId = 0;
119+
uint64 socketId = 0; // socket ID
120120
PCMMemoryChannelCounter channels[MEMORY_MAX_IMC_CHANNELS];
121-
uint32 numOfChannels;
121+
uint32 numOfChannels; // number of memory channels in the CPU socket
122122
float read; // DRAM read traffic in MBytes/sec
123123
float write; // DRAM write traffic in MBytes/sec
124124
float pmmRead; // PMM read traffic in MBytes/sec
125125
float pmmWrite; // PMM write traffic in MBytes/sec
126126
float total; // total traffic in MBytes/sec
127127
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
129129

130130
public:
131131
PCMMemorySocketCounter() :
@@ -175,8 +175,8 @@ namespace PCMDaemon {
175175
typedef struct PCMMemory PCMMemory;
176176

177177
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
180180

181181
public:
182182
PCMQPILinkCounter() :
@@ -187,9 +187,9 @@ namespace PCMDaemon {
187187
typedef struct PCMQPILinkCounter PCMQPILinkCounter;
188188

189189
struct PCMQPISocketCounter {
190-
uint64 socketId = 0;
190+
uint64 socketId = 0; // socket ID
191191
PCMQPILinkCounter links[QPI_MAX_LINKS];
192-
uint64 total;
192+
uint64 total; // total number of transfered bytes of a certain traffic class
193193

194194
public:
195195
PCMQPISocketCounter() :
@@ -199,12 +199,12 @@ namespace PCMDaemon {
199199
typedef struct PCMQPISocketCounter PCMQPISocketCounter;
200200

201201
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
208208

209209
public:
210210
PCMQPI() :
@@ -226,13 +226,13 @@ namespace PCMDaemon {
226226
typedef struct SharedPCMCounters SharedPCMCounters;
227227

228228
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
234234
SharedPCMCounters pcm;
235-
uint64 lastUpdateTscEnd;
235+
uint64 lastUpdateTscEnd; // time stamp counter (TSC) obtained via rdtsc instruction *after* the state update
236236

237237
public:
238238
SharedPCMState() :

0 commit comments

Comments
 (0)