Intel(r) Performance Counter Monitor
Macros | Functions
pcm-sensor.cpp File Reference

Example of using CPU counters: implements a graphical plugin for KDE ksysguard. More...

#include <iostream>
#include <string>
#include <sstream>
#include "cpuasynchcounter.h"

Macros

#define HACK_TO_REMOVE_DUPLICATE_ERROR
 
#define OUTPUT_CORE_METRIC(name, function)
 
#define OUTPUT_SOCKET_METRIC(name, function)
 
#define OUTPUT_SYSTEM_METRIC(name, function)
 

Functions

int main ()
 

Detailed Description

Example of using CPU counters: implements a graphical plugin for KDE ksysguard.

Macro Definition Documentation

#define OUTPUT_CORE_METRIC (   name,
  function 
)
Value:
for (uint32 i = 0; i < counters.getNumCores(); ++i) { \
for (uint32 a = 0; a < counters.getNumSockets(); ++a) \
if (a == counters.getSocketId(i)) { \
stringstream c; \
c << "Socket" << a << "/CPU" << i << name; \
if (s == c.str()) { \
cout << function << endl; \
} \
} \
}
#define OUTPUT_SOCKET_METRIC (   name,
  function 
)
Value:
for (uint32 i = 0; i < counters.getNumSockets(); ++i) { \
stringstream c; \
c << "Socket" << i << name; \
if (s == c.str()) { \
cout << function << endl; \
} \
}
#define OUTPUT_SYSTEM_METRIC (   name,
  function 
)
Value:
{ \
stringstream c; \
c << name; \
if (s == c.str()) { \
cout << function << endl; \
} \
}