Intel(r) Performance Counter Monitor
|
The bulk of Intel PCM implementation. More...
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include "cpucounters.h"
#include "msr.h"
#include "pci.h"
#include "types.h"
#include "utils.h"
#include <pthread.h>
#include <errno.h>
#include <sys/time.h>
#include <string.h>
#include <limits>
#include <map>
#include <fstream>
#include <algorithm>
Classes | |
class | InstanceLock |
union | PCM_CPUID_INFO |
class | TemporalThreadAffinity |
Macros | |
#define | PCM_INSTANCE_LOCK_SEMAPHORE_NAME "Intel(r) PCM inst lock" |
#define | PCM_NUM_INSTANCES_SEMAPHORE_NAME "Num Intel(r) PCM insts" |
#define | PCM_PARAM_PROTECT(...) __VA_ARGS__ |
#define | PCM_CSTATE_ARRAY(array_, val) |
#define | SAFE_SYSCTLBYNAME(message, ret_value) |
#define | CPUCNT_INIT_THE_REST_OF_EVTCNT |
#define | PCM_PCICFG_MC_INIT(controller, channel, arch) |
#define | PCM_PCICFG_SETUP_MC_HANDLE(controller, channel) |
#define | PCM_PCICFG_QPI_INIT(port, arch) |
Functions | |
int | bitCount (uint64 n) |
uint32 | build_bit_ui (int beg, int end) |
uint32 | extract_bits_ui (uint32 myin, uint32 beg, uint32 end) |
uint64 | build_bit (uint32 beg, uint32 end) |
uint64 | extract_bits (uint64 myin, uint32 beg, uint32 end) |
int32 | extractThermalHeadroom (uint64 val) |
uint64 | get_frequency_from_cpuid () |
void | pcm_cpuid (int leaf, PCM_CPUID_INFO &info) |
void | pcm_cpuid (const unsigned leaf, const unsigned subleaf, PCM_CPUID_INFO &info) |
uint64 | RDTSC () |
uint64 | RDTSCP () |
SystemCounterState | getSystemCounterState () |
Reads the counter state of the system. More... | |
SocketCounterState | getSocketCounterState (uint32 socket) |
Reads the counter state of a socket. More... | |
CoreCounterState | getCoreCounterState (uint32 core) |
Reads the counter state of a (logical) core. More... | |
void | print_mcfg (const char *path) |
int | getBusFromSocket (const uint32 socket) |
void * | WatchDogProc (void *state) |
Variables | |
pthread_mutex_t | processIntanceMutex = PTHREAD_MUTEX_INITIALIZER |
The bulk of Intel PCM implementation.
#define CPUCNT_INIT_THE_REST_OF_EVTCNT |
#define PCM_CSTATE_ARRAY | ( | array_, | |
val | |||
) |
#define PCM_PCICFG_MC_INIT | ( | controller, | |
channel, | |||
arch | |||
) |
#define PCM_PCICFG_QPI_INIT | ( | port, | |
arch | |||
) |
#define PCM_PCICFG_SETUP_MC_HANDLE | ( | controller, | |
channel | |||
) |
#define SAFE_SYSCTLBYNAME | ( | message, | |
ret_value | |||
) |
CoreCounterState getCoreCounterState | ( | uint32 | core | ) |
Reads the counter state of a (logical) core.
Helper function. Uses PCM object to access counters.
core | core id |
References PCM::getCoreCounterState(), and PCM::getInstance().
SocketCounterState getSocketCounterState | ( | uint32 | socket | ) |
Reads the counter state of a socket.
Helper function. Uses PCM object to access counters.
socket | socket id |
References PCM::getInstance(), and PCM::getSocketCounterState().
SystemCounterState 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::getInstance(), and PCM::getSystemCounterState().