Processor Counter Monitor
|
The bulk of PCM implementation. More...
#include <stdio.h>
#include <assert.h>
#include "cpucounters.h"
#include "msr.h"
#include "pci.h"
#include "types.h"
#include "utils.h"
#include "topology.h"
#include <pthread.h>
#include <errno.h>
#include <sys/time.h>
#include <string.h>
#include <limits>
#include <map>
#include <algorithm>
#include <thread>
#include <future>
#include <functional>
#include <queue>
#include <condition_variable>
#include <mutex>
#include <atomic>
Classes | |
class | pcm::TemporalThreadAffinity |
class | pcm::CoreTaskQueue |
Functions | |
int32 | pcm::extractThermalHeadroom (uint64 val) |
uint64 | pcm::get_frequency_from_cpuid () |
void | pcm::pcm_cpuid (const unsigned leaf, const unsigned subleaf, PCM_CPUID_INFO &info) |
void | pcm::initSocket2Bus (std::vector< std::pair< uint32, uint32 > > &socket2bus, uint32 device, uint32 function, const uint32 DEV_IDS[], uint32 devIdsSize) |
void | pcm::initSocket2Ubox0Bus () |
uint64 | pcm::RDTSC () |
SystemCounterState | pcm::getSystemCounterState () |
Reads the counter state of the system. More... | |
SocketCounterState | pcm::getSocketCounterState (uint32 socket) |
Reads the counter state of a socket. More... | |
CoreCounterState | pcm::getCoreCounterState (uint32 core) |
Reads the counter state of a (logical) core. More... | |
void | pcm::print_mcfg (const char *path) |
int | pcm::getBusFromSocket (const uint32 socket) |
Variables | |
std::mutex | pcm::instanceCreationMutex |
std::vector< std::pair< uint32, uint32 > > | pcm::socket2UBOX0bus |
std::mutex | pcm::printErrorMutex |
Mutex | pcm::socket2busMutex |
The bulk of PCM implementation.
#define CPUCNT_INIT_THE_REST_OF_EVTCNT |
#define PCM_CSTATE_ARRAY | ( | array_, | |
val | |||
) |
#define PCM_PCICFG_EDC_INIT | ( | controller, | |
clock, | |||
arch | |||
) |
#define PCM_PCICFG_HA_INIT | ( | x, | |
arch | |||
) |
#define PCM_PCICFG_M2M_INIT | ( | x, | |
arch | |||
) |
#define PCM_PCICFG_M3UPI_INIT | ( | port, | |
arch | |||
) |
#define PCM_PCICFG_MC_INIT | ( | controller, | |
channel, | |||
arch | |||
) |
#define PCM_PCICFG_QPI_INIT | ( | port, | |
arch | |||
) |
#define SAFE_SYSCTLBYNAME | ( | message, | |
ret_value | |||
) |
PCM_API CoreCounterState pcm::getCoreCounterState | ( | uint32 | core | ) |
Reads the counter state of a (logical) core.
Helper function. Uses PCM object to access counters.
core | core id |
References pcm::PCM::getCoreCounterState(), and pcm::PCM::getInstance().
PCM_API SocketCounterState pcm::getSocketCounterState | ( | uint32 | socket | ) |
Reads the counter state of a socket.
Helper function. Uses PCM object to access counters.
socket | socket id |
References pcm::PCM::getInstance(), and pcm::PCM::getSocketCounterState().
PCM_API SystemCounterState pcm::getSystemCounterState | ( | ) |
Reads the counter state of the system.
Helper function. Uses PCM object to access counters.
System consists of several sockets (CPUs). Socket has a CPU in it. Socket (CPU) consists of several (logical) cores.
References pcm::PCM::getInstance(), and pcm::PCM::getSystemCounterState().