Processor Counter Monitor
Classes | Macros | Typedefs | Enumerations | Functions
cpucounters.h File Reference

Main CPU counters header. More...

#include "version.h"
#include "types.h"
#include "msr.h"
#include "pci.h"
#include "bw.h"
#include "width_extender.h"
#include "exceptions/unsupported_processor_exception.hpp"
#include <vector>
#include <array>
#include <limits>
#include <string>
#include <memory>
#include <map>
#include <unordered_map>
#include <string.h>
#include <assert.h>
#include <semaphore.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/syscall.h>
#include <unistd.h>
#include "resctrl.h"
Include dependency graph for cpucounters.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pcm::TopologyEntry
 
class  pcm::HWRegister
 
class  pcm::PCICFGRegister64
 
class  pcm::PCICFGRegister32
 
class  pcm::MMIORegister64
 
class  pcm::MMIORegister32
 
class  pcm::MSRRegister
 
class  pcm::CounterWidthExtenderRegister
 
class  pcm::UncorePMU
 
class  pcm::ServerPCICFGUncore
 Object to access uncore counters in a socket/processor with microarchitecture codename SandyBridge-EP (Jaketown) or Ivytown-EP or Ivytown-EX. More...
 
class  pcm::SimpleCounterState
 
class  pcm::PCM
 CPU Performance Monitor. More...
 
struct  pcm::PCM::SimplePCIeDevInfo
 
struct  pcm::PCM::CustomCoreEventDescription
 Custom Core event description. More...
 
struct  pcm::PCM::ExtendedCustomCoreEventDescription
 Extended custom core event description. More...
 
struct  pcm::PCM::CustomIIOEventDescription
 
struct  pcm::PCM::RawPMUConfig
 
class  pcm::BasicCounterState
 Basic core counter state. More...
 
class  pcm::UncoreCounterState
 Basic uncore counter state. More...
 
class  pcm::ServerUncoreCounterState
 Server uncore power counter state. More...
 
class  pcm::CoreCounterState
 (Logical) core-wide counter state More...
 
class  pcm::SocketCounterState
 Socket-wide counter state. More...
 
class  pcm::SystemCounterState
 System-wide counter state. More...
 

Macros

#define PCM_API
 
#define NOMINMAX
 
#define PCM_SKL_PATH_CASES
 
#define PCM_GENERATE_METRIC_AVAILABLE_FUNCTION(m)   bool is##m() const { return m; }
 

Typedefs

typedef SimpleCounterState pcm::PCIeCounterState
 
typedef SimpleCounterState pcm::IIOCounterState
 
typedef std::vector< uint64 > pcm::eventGroup_t
 

Enumerations

enum  ServerUncoreMemoryMetrics { PartialWrites, Pmem, PmemMemoryMode, PmemMixedMode }
 

Functions

uint64 pcm::RDTSC ()
 
uint64 pcm::RDTSCP ()
 
template<class CounterStateType >
int32 pcm::getThermalHeadroom (const CounterStateType &, const CounterStateType &after)
 
template<class CounterStateType >
double pcm::getNormalizedQPIL0pTxCycles (uint32 port, const CounterStateType &before, const CounterStateType &after)
 Returns the ratio of QPI cycles in power saving half-lane mode. More...
 
template<class CounterStateType >
double pcm::getNormalizedQPIL1Cycles (uint32 port, const CounterStateType &before, const CounterStateType &after)
 Returns the ratio of QPI cycles in power saving shutdown mode. More...
 
template<class CounterStateType >
uint64 pcm::getDRAMClocks (uint32 channel, const CounterStateType &before, const CounterStateType &after)
 Returns DRAM clock ticks. More...
 
template<class CounterStateType >
uint64 pcm::getMCDRAMClocks (uint32 channel, const CounterStateType &before, const CounterStateType &after)
 Returns MCDRAM clock ticks. More...
 
template<class CounterStateType >
uint64 pcm::getMCCounter (uint32 channel, uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of memory controller PMU counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getM3UPICounter (uint32 port, uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of M3UPI PMU counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getCBOCounter (uint32 cbo, uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of CHA or CBO PMU counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getUBOXCounter (uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of UBOX PMU counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getIIOCounter (uint32 stack, uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of IIO PMU counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getIRPCounter (uint32 stack, uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of IRP PMU counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getXPICounter (uint32 port, uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of UPI or QPI PMU counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getM2MCounter (uint32 controller, uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of Memory2Mesh controller PMU counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getEDCCounter (uint32 channel, uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of embedded DRAM memory controller counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getPCUCounter (uint32 counter, const CounterStateType &before, const CounterStateType &after)
 Direct read of power control unit PMU counter (counter meaning depends on the programming: power/performance/etc) More...
 
template<class CounterStateType >
uint64 pcm::getPCUClocks (const CounterStateType &before, const CounterStateType &after)
 Returns clock ticks of power control unit. More...
 
template<class CounterStateType >
uint64 pcm::getConsumedEnergy (const CounterStateType &before, const CounterStateType &after)
 Returns energy consumed by processor, excluding DRAM (measured in internal units) More...
 
template<class CounterStateType >
uint64 pcm::getDRAMConsumedEnergy (const CounterStateType &before, const CounterStateType &after)
 Returns energy consumed by DRAM (measured in internal units) More...
 
template<class CounterStateType >
int64 pcm::getFreeRunningCounter (const typename CounterStateType::FreeRunningCounterID &counter, const CounterStateType &before, const CounterStateType &after)
 Returns free running counter if it exists, -1 otherwise. More...
 
template<class CounterStateType >
uint64 pcm::getUncoreClocks (const CounterStateType &before, const CounterStateType &after)
 Returns uncore clock ticks. More...
 
template<class CounterStateType >
double pcm::getConsumedJoules (const CounterStateType &before, const CounterStateType &after)
 Returns Joules consumed by processor (excluding DRAM) More...
 
template<class CounterStateType >
double pcm::getDRAMConsumedJoules (const CounterStateType &before, const CounterStateType &after)
 Returns Joules consumed by DRAM. More...
 
template<class CounterStateType >
uint64 pcm::getQPIClocks (uint32 port, const CounterStateType &before, const CounterStateType &after)
 Returns QPI LL clock ticks. More...
 
template<class CounterStateType >
uint64 pcm::getQPIL0pTxCycles (uint32 port, const CounterStateType &before, const CounterStateType &after)
 Returns the number of QPI cycles in power saving half-lane mode. More...
 
template<class CounterStateType >
uint64 pcm::getQPIL1Cycles (uint32 port, const CounterStateType &before, const CounterStateType &after)
 Returns the number of QPI cycles in power saving shutdown mode. More...
 
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...
 
template<class CounterStateType >
double pcm::getIPC (const CounterStateType &before, const CounterStateType &after)
 Computes average number of retired instructions per core cycle (IPC) More...
 
template<class CounterStateType >
uint64 pcm::getInstructionsRetired (const CounterStateType &before, const CounterStateType &after)
 Computes the number of retired instructions. More...
 
template<class CounterStateType >
double pcm::getExecUsage (const CounterStateType &before, const CounterStateType &after)
 Computes average number of retired instructions per time interval. More...
 
template<class CounterStateType >
uint64 pcm::getInstructionsRetired (const CounterStateType &now)
 Computes the number of retired instructions. More...
 
template<class CounterStateType >
uint64 pcm::getCycles (const CounterStateType &before, const CounterStateType &after)
 Computes the number core clock cycles when signal on a specific core is running (not halted) More...
 
template<class CounterStateType >
uint64 pcm::getRefCycles (const CounterStateType &before, const CounterStateType &after)
 Computes the number of reference clock cycles while clock signal on the core is running. More...
 
template<class CounterStateType >
uint64 pcm::getCycles (const CounterStateType &now)
 Computes the number executed core clock cycles. More...
 
template<class CounterStateType >
double pcm::getCoreIPC (const CounterStateType &before, const CounterStateType &after)
 Computes average number of retired instructions per core cycle for the entire system combining instruction counts from logical cores to corresponding physical cores. More...
 
template<class CounterStateType >
double pcm::getTotalExecUsage (const CounterStateType &before, const CounterStateType &after)
 Computes average number of retired instructions per time interval for the entire system combining instruction counts from logical cores to corresponding physical cores. More...
 
template<class StateType >
double pcm::getAverageFrequencyFromClocks (const int64 clocks, const StateType &before, const StateType &after)
 
template<class CounterStateType >
double pcm::getAverageFrequency (const CounterStateType &before, const CounterStateType &after)
 Computes average core frequency also taking Intel Turbo Boost technology into account. More...
 
template<class UncoreStateType >
double pcm::getAverageUncoreFrequency (const UncoreStateType &before, const UncoreStateType &after)
 Computes average uncore frequency. More...
 
template<class CounterStateType >
double pcm::getActiveAverageFrequency (const CounterStateType &before, const CounterStateType &after)
 Computes average core frequency when not in powersaving C0-state (also taking Intel Turbo Boost technology into account) More...
 
template<class CounterStateType >
double pcm::getRelativeFrequency (const CounterStateType &before, const CounterStateType &after)
 Computes average core frequency also taking Intel Turbo Boost technology into account. More...
 
template<class CounterStateType >
double pcm::getActiveRelativeFrequency (const CounterStateType &before, const CounterStateType &after)
 Computes average core frequency when not in powersaving C0-state (also taking Intel Turbo Boost technology into account) More...
 
template<class CounterStateType >
double pcm::getL2CacheHitRatio (const CounterStateType &before, const CounterStateType &after)
 Computes L2 cache hit ratio. More...
 
template<class CounterStateType >
double pcm::getL3CacheHitRatio (const CounterStateType &before, const CounterStateType &after)
 Computes L3 cache hit ratio. More...
 
template<class CounterStateType >
uint64 pcm::getL3CacheMisses (const CounterStateType &before, const CounterStateType &after)
 Computes number of L3 cache misses. More...
 
template<class CounterStateType >
uint64 pcm::getL2CacheMisses (const CounterStateType &before, const CounterStateType &after)
 Computes number of L2 cache misses. More...
 
template<class CounterStateType >
uint64 pcm::getL2CacheHits (const CounterStateType &before, const CounterStateType &after)
 Computes number of L2 cache hits. More...
 
template<class CounterStateType >
uint64 pcm::getL3CacheOccupancy (const CounterStateType &now)
 Computes L3 Cache Occupancy. More...
 
template<class CounterStateType >
uint64 pcm::getLocalMemoryBW (const CounterStateType &before, const CounterStateType &after)
 Computes Local Memory Bandwidth. More...
 
template<class CounterStateType >
uint64 pcm::getRemoteMemoryBW (const CounterStateType &before, const CounterStateType &after)
 Computes Remote Memory Bandwidth. More...
 
template<class CounterStateType >
uint64 pcm::getL3CacheHitsNoSnoop (const CounterStateType &before, const CounterStateType &after)
 Computes number of L3 cache hits where no snooping in sibling L2 caches had to be done. More...
 
template<class CounterStateType >
uint64 pcm::getL3CacheHitsSnoop (const CounterStateType &before, const CounterStateType &after)
 Computes number of L3 cache hits where snooping in sibling L2 caches had to be done. More...
 
template<class CounterStateType >
uint64 pcm::getL3CacheHits (const CounterStateType &before, const CounterStateType &after)
 Computes total number of L3 cache hits. More...
 
template<class CounterStateType >
uint64 pcm::getInvariantTSC (const CounterStateType &before, const CounterStateType &after)
 Computes number of invariant time stamp counter ticks. More...
 
template<class CounterStateType >
double pcm::getCoreCStateResidency (int state, const CounterStateType &before, const CounterStateType &after)
 Computes residency in the core C-state. More...
 
template<class CounterStateType >
uint64 pcm::getCoreCStateResidency (int state, const CounterStateType &now)
 Reads raw residency counter for the core C-state. More...
 
template<class CounterStateType >
double pcm::getPackageCStateResidency (int state, const CounterStateType &before, const CounterStateType &after)
 Computes residency in the package C-state. More...
 
template<class CounterStateType >
uint64 pcm::getPackageCStateResidency (int state, const CounterStateType &now)
 Reads raw residency counter for the package C-state. More...
 
template<class CounterStateType >
uint64 pcm::getBytesReadFromMC (const CounterStateType &before, const CounterStateType &after)
 Computes number of bytes read from DRAM memory controllers. More...
 
template<class CounterStateType >
uint64 pcm::getBytesWrittenToMC (const CounterStateType &before, const CounterStateType &after)
 Computes number of bytes written to DRAM memory controllers. More...
 
template<class CounterStateType >
uint64 pcm::getBytesReadFromPMM (const CounterStateType &before, const CounterStateType &after)
 Computes number of bytes read from PMM memory. More...
 
template<class CounterStateType >
uint64 pcm::getBytesWrittenToPMM (const CounterStateType &before, const CounterStateType &after)
 Computes number of bytes written to PMM memory. More...
 
template<class CounterStateType >
uint64 pcm::getBytesReadFromEDC (const CounterStateType &before, const CounterStateType &after)
 Computes number of bytes read from MCDRAM memory controllers. More...
 
template<class CounterStateType >
uint64 pcm::getBytesWrittenToEDC (const CounterStateType &before, const CounterStateType &after)
 Computes number of bytes written to MCDRAM memory controllers. More...
 
template<class CounterStateType >
uint64 pcm::getGTRequestBytesFromMC (const CounterStateType &before, const CounterStateType &after)
 Computes number of bytes of read/write requests from GT engine. More...
 
template<class CounterStateType >
uint64 pcm::getIARequestBytesFromMC (const CounterStateType &before, const CounterStateType &after)
 Computes number of bytes of read/write requests from all IA. More...
 
template<class CounterStateType >
uint64 pcm::getIORequestBytesFromMC (const CounterStateType &before, const CounterStateType &after)
 Computes number of bytes of read/write requests from all IO sources. More...
 
template<class CounterStateType >
uint64 pcm::getSMICount (const CounterStateType &before, const CounterStateType &after)
 Returns the number of occurred system management interrupts. More...
 
template<class CounterStateType >
uint64 pcm::getNumberOfCustomEvents (int32 eventCounterNr, const CounterStateType &before, const CounterStateType &after)
 Returns the number of occurred custom core events. More...
 
uint64 pcm::getIncomingQPILinkBytes (uint32 socketNr, uint32 linkNr, const SystemCounterState &before, const SystemCounterState &after)
 Get estimation of QPI data traffic per incoming QPI link. More...
 
double pcm::getIncomingQPILinkUtilization (uint32 socketNr, uint32 linkNr, const SystemCounterState &before, const SystemCounterState &after)
 Get data utilization of incoming QPI link (0..1) More...
 
double pcm::getOutgoingQPILinkUtilization (uint32 socketNr, uint32 linkNr, const SystemCounterState &before, const SystemCounterState &after)
 Get utilization of outgoing QPI link (0..1) More...
 
uint64 pcm::getOutgoingQPILinkBytes (uint32 socketNr, uint32 linkNr, const SystemCounterState &before, const SystemCounterState &after)
 Get estimation of QPI (data+nondata) traffic per outgoing QPI link. More...
 
uint64 pcm::getAllIncomingQPILinkBytes (const SystemCounterState &before, const SystemCounterState &after)
 Get estimation of total QPI data traffic. More...
 
uint64 pcm::getAllOutgoingQPILinkBytes (const SystemCounterState &before, const SystemCounterState &after)
 Get estimation of total QPI data+nondata traffic. More...
 
uint64 pcm::getIncomingQPILinkBytes (uint32 socketNr, uint32 linkNr, const SystemCounterState &now)
 Return current value of the counter of QPI data traffic per incoming QPI link. More...
 
uint64 pcm::getSocketIncomingQPILinkBytes (uint32 socketNr, const SystemCounterState &now)
 Get estimation of total QPI data traffic for this socket. More...
 
uint64 pcm::getAllIncomingQPILinkBytes (const SystemCounterState &now)
 Get estimation of Socket QPI data traffic. More...
 
double pcm::getQPItoMCTrafficRatio (const SystemCounterState &before, const SystemCounterState &after)
 Get QPI data to Memory Controller traffic ratio. More...
 
template<class CounterStateType >
double pcm::getLocalMemoryRequestRatio (const CounterStateType &before, const CounterStateType &after)
 Get local memory access ration measured in home agent. More...
 
template<class CounterType >
uint64 pcm::getNumberOfEvents (const CounterType &before, const CounterType &after)
 Returns the raw count of events. More...
 
template<class CounterStateType >
double pcm::getLLCReadMissLatency (const CounterStateType &before, const CounterStateType &after)
 Returns average last level cache read+prefetch miss latency in ns.
 
template<class CounterStateType >
uint64 pcm::getAllSlots (const CounterStateType &before, const CounterStateType &after)
 
template<class CounterStateType >
uint64 pcm::getAllSlotsRaw (const CounterStateType &before, const CounterStateType &after)
 
template<class CounterStateType >
double pcm::getBackendBound (const CounterStateType &before, const CounterStateType &after)
 Returns unutilized pipeline slots where no uop was delivered due to lack of back-end resources as range 0..1.
 
template<class CounterStateType >
double pcm::getFrontendBound (const CounterStateType &before, const CounterStateType &after)
 Returns unutilized pipeline slots where Front-end did not deliver a uop while back-end is ready as range 0..1.
 
template<class CounterStateType >
double pcm::getBadSpeculation (const CounterStateType &before, const CounterStateType &after)
 Returns wasted pipeline slots due to incorrect speculation, covering whole penalty: Utilized by uops that do not retire, or Recovery Bubbles (unutilized slots) as range 0..1.
 
template<class CounterStateType >
double pcm::getRetiring (const CounterStateType &before, const CounterStateType &after)
 Returns pipeline slots utilized by uops that eventually retire (commit)
 
template<class CounterStateType >
uint64 pcm::getMSREvent (const uint64 &index, const PCM::MSRType &type, const CounterStateType &before, const CounterStateType &after)
 

Detailed Description

Main CPU counters header.

Include this header file if you want to access CPU counters (core and uncore - including memory controller chips and QPI)

Macro Definition Documentation

◆ PCM_SKL_PATH_CASES

#define PCM_SKL_PATH_CASES
Value:
case PCM::SKL_UY: \
case PCM::KBL: \
case PCM::KBL_1: \
case PCM::CML: \
case PCM::ICL: \
case PCM::RKL: \
case PCM::TGL: \
case PCM::SKL:

Function Documentation

◆ getActiveAverageFrequency()

template<class CounterStateType >
double pcm::getActiveAverageFrequency ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes average core frequency when not in powersaving C0-state (also taking Intel Turbo Boost technology into account)

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
frequency in Hz

References pcm::getActiveAverageFrequency(), pcm::PCM::getInstance(), and pcm::PCM::getNominalFrequency().

Referenced by pcm::getActiveAverageFrequency().

◆ getActiveRelativeFrequency()

template<class CounterStateType >
double pcm::getActiveRelativeFrequency ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes average core frequency when not in powersaving C0-state (also taking Intel Turbo Boost technology into account)

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Fraction of nominal frequency (if >1.0 then Turbo was working during the measurement)

References pcm::getActiveRelativeFrequency(), and pcm::PCM::getInstance().

Referenced by pcm::getActiveRelativeFrequency().

◆ getAllIncomingQPILinkBytes() [1/2]

uint64 pcm::getAllIncomingQPILinkBytes ( const SystemCounterState before,
const SystemCounterState after 
)
inline

Get estimation of total QPI data traffic.

Returns an estimation of number of data bytes transferred to all sockets over all Intel(r) Quick Path Interconnect links

Parameters
beforeSystem CPU counter state before the experiment
afterSystem CPU counter state after the experiment
Returns
Number of bytes

References pcm::getAllIncomingQPILinkBytes(), pcm::PCM::getInstance(), and pcm::PCM::getNumSockets().

Referenced by pcm::getAllIncomingQPILinkBytes(), and pcm::getQPItoMCTrafficRatio().

◆ getAllIncomingQPILinkBytes() [2/2]

uint64 pcm::getAllIncomingQPILinkBytes ( const SystemCounterState now)
inline

Get estimation of Socket QPI data traffic.

Returns an estimation of number of data bytes transferred to all sockets over all Intel(r) Quick Path Interconnect links

Parameters
nowSystem CPU counter state
Returns
Number of bytes

References pcm::getAllIncomingQPILinkBytes(), pcm::PCM::getInstance(), pcm::PCM::getNumSockets(), and pcm::getSocketIncomingQPILinkBytes().

◆ getAllOutgoingQPILinkBytes()

uint64 pcm::getAllOutgoingQPILinkBytes ( const SystemCounterState before,
const SystemCounterState after 
)
inline

Get estimation of total QPI data+nondata traffic.

Returns an estimation of number of data and non-data bytes transferred from all sockets over all Intel(r) Quick Path Interconnect links

Parameters
beforeSystem CPU counter state before the experiment
afterSystem CPU counter state after the experiment
Returns
Number of bytes

References pcm::getAllOutgoingQPILinkBytes(), pcm::PCM::getInstance(), and pcm::PCM::getNumSockets().

Referenced by pcm::getAllOutgoingQPILinkBytes().

◆ getAverageFrequency()

template<class CounterStateType >
double pcm::getAverageFrequency ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes average core frequency also taking Intel Turbo Boost technology into account.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
frequency in Hz

References pcm::getAverageFrequency().

Referenced by pcm::getAverageFrequency().

◆ getAverageUncoreFrequency()

template<class UncoreStateType >
double pcm::getAverageUncoreFrequency ( const UncoreStateType &  before,
const UncoreStateType &  after 
)

Computes average uncore frequency.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
frequency in Hz

References pcm::getAverageUncoreFrequency(), and pcm::PCM::getInstance().

Referenced by pcm::getAverageUncoreFrequency().

◆ getBytesReadFromEDC()

template<class CounterStateType >
uint64 pcm::getBytesReadFromEDC ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of bytes read from MCDRAM memory controllers.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::getBytesReadFromEDC(), and pcm::PCM::getInstance().

Referenced by pcm::getBytesReadFromEDC().

◆ getBytesReadFromMC()

template<class CounterStateType >
uint64 pcm::getBytesReadFromMC ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of bytes read from DRAM memory controllers.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::getBytesReadFromMC(), and pcm::PCM::getInstance().

Referenced by pcm::getBytesReadFromMC(), and pcm::getQPItoMCTrafficRatio().

◆ getBytesReadFromPMM()

template<class CounterStateType >
uint64 pcm::getBytesReadFromPMM ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of bytes read from PMM memory.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::getBytesReadFromPMM(), and pcm::PCM::getInstance().

Referenced by pcm::getBytesReadFromPMM(), and pcm::getQPItoMCTrafficRatio().

◆ getBytesWrittenToEDC()

template<class CounterStateType >
uint64 pcm::getBytesWrittenToEDC ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of bytes written to MCDRAM memory controllers.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::getBytesWrittenToEDC(), and pcm::PCM::getInstance().

Referenced by pcm::getBytesWrittenToEDC().

◆ getBytesWrittenToMC()

template<class CounterStateType >
uint64 pcm::getBytesWrittenToMC ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of bytes written to DRAM memory controllers.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::getBytesWrittenToMC(), and pcm::PCM::getInstance().

Referenced by pcm::getBytesWrittenToMC(), and pcm::getQPItoMCTrafficRatio().

◆ getBytesWrittenToPMM()

template<class CounterStateType >
uint64 pcm::getBytesWrittenToPMM ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of bytes written to PMM memory.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::getBytesWrittenToPMM(), and pcm::PCM::getInstance().

Referenced by pcm::getBytesWrittenToPMM(), and pcm::getQPItoMCTrafficRatio().

◆ getCBOCounter()

template<class CounterStateType >
uint64 pcm::getCBOCounter ( uint32  cbo,
uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of CHA or CBO PMU counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
cbocbo or cha number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getCBOCounter().

Referenced by pcm::getCBOCounter().

◆ getConsumedEnergy()

template<class CounterStateType >
uint64 pcm::getConsumedEnergy ( const CounterStateType &  before,
const CounterStateType &  after 
)

Returns energy consumed by processor, excluding DRAM (measured in internal units)

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getConsumedEnergy().

Referenced by pcm::getConsumedEnergy(), and pcm::getConsumedJoules().

◆ getConsumedJoules()

template<class CounterStateType >
double pcm::getConsumedJoules ( const CounterStateType &  before,
const CounterStateType &  after 
)

Returns Joules consumed by processor (excluding DRAM)

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getConsumedEnergy(), pcm::getConsumedJoules(), pcm::PCM::getInstance(), and pcm::PCM::getJoulesPerEnergyUnit().

Referenced by pcm::getConsumedJoules().

◆ getCoreCounterState()

PCM_API CoreCounterState pcm::getCoreCounterState ( uint32  core)

Reads the counter state of a (logical) core.

Helper function. Uses PCM object to access counters.

Parameters
corecore id
Returns
State of counters in the core

References pcm::PCM::getCoreCounterState(), and pcm::PCM::getInstance().

◆ getCoreCStateResidency() [1/2]

template<class CounterStateType >
double pcm::getCoreCStateResidency ( int  state,
const CounterStateType &  before,
const CounterStateType &  after 
)
inline

Computes residency in the core C-state.

Parameters
stateC-state
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
residence ratio (0..1): 0 - 0%, 1.0 - 100%

References pcm::getCoreCStateResidency(), pcm::PCM::getInstance(), pcm::getInvariantTSC(), pcm::getRefCycles(), and pcm::PCM::isCoreCStateResidencySupported().

Referenced by pcm::getCoreCStateResidency().

◆ getCoreCStateResidency() [2/2]

template<class CounterStateType >
uint64 pcm::getCoreCStateResidency ( int  state,
const CounterStateType &  now 
)
inline

Reads raw residency counter for the core C-state.

Parameters
stateC-state #
nowCPU counter state
Returns
raw residency value

References pcm::getCoreCStateResidency().

◆ getCoreIPC()

template<class CounterStateType >
double pcm::getCoreIPC ( const CounterStateType &  before,
const CounterStateType &  after 
)
inline

Computes average number of retired instructions per core cycle for the entire system combining instruction counts from logical cores to corresponding physical cores.

Use this metric to evaluate IPC improvement between SMT(Hyperthreading) on and SMT off.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
IPC

References pcm::getCoreIPC(), pcm::PCM::getInstance(), pcm::getIPC(), pcm::PCM::getNumCores(), pcm::PCM::getNumOnlineCores(), and pcm::PCM::getThreadsPerCore().

Referenced by pcm::getCoreIPC().

◆ getCycles() [1/2]

template<class CounterStateType >
uint64 pcm::getCycles ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes the number core clock cycles when signal on a specific core is running (not halted)

Returns number of used cycles (halted cyles are not counted). The counter does not advance in the following conditions:

  • an ACPI C-state is other than C0 for normal operation
  • HLT
  • STPCLK+ pin is asserted
  • being throttled by TM1
  • during the frequency switching phase of a performance state transition

The performance counter for this event counts across performance state transitions using different core clock frequencies

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
number core clock cycles

References pcm::getCycles().

Referenced by pcm::getCycles().

◆ getCycles() [2/2]

template<class CounterStateType >
uint64 pcm::getCycles ( const CounterStateType &  now)

Computes the number executed core clock cycles.

Returns number of used cycles (halted cyles are not counted).

Parameters
nowCurrent CPU counter state
Returns
number core clock cycles

References pcm::getCycles().

◆ getDRAMClocks()

template<class CounterStateType >
uint64 pcm::getDRAMClocks ( uint32  channel,
const CounterStateType &  before,
const CounterStateType &  after 
)

Returns DRAM clock ticks.

Parameters
channelDRAM channel number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::PCM::getCPUModel(), pcm::getDRAMClocks(), and pcm::PCM::getInstance().

Referenced by pcm::getDRAMClocks().

◆ getDRAMConsumedEnergy()

template<class CounterStateType >
uint64 pcm::getDRAMConsumedEnergy ( const CounterStateType &  before,
const CounterStateType &  after 
)

Returns energy consumed by DRAM (measured in internal units)

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getDRAMConsumedEnergy().

Referenced by pcm::getDRAMConsumedEnergy(), and pcm::getDRAMConsumedJoules().

◆ getDRAMConsumedJoules()

template<class CounterStateType >
double pcm::getDRAMConsumedJoules ( const CounterStateType &  before,
const CounterStateType &  after 
)

Returns Joules consumed by DRAM.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::PCM::getCPUModel(), pcm::getDRAMConsumedEnergy(), pcm::getDRAMConsumedJoules(), pcm::PCM::getInstance(), and pcm::PCM::getJoulesPerEnergyUnit().

Referenced by pcm::getDRAMConsumedJoules().

◆ getEDCCounter()

template<class CounterStateType >
uint64 pcm::getEDCCounter ( uint32  channel,
uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of embedded DRAM memory controller counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
channelchannel number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getEDCCounter(), and pcm::PCM::getInstance().

Referenced by pcm::getEDCCounter().

◆ getExecUsage()

template<class CounterStateType >
double pcm::getExecUsage ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes average number of retired instructions per time interval.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
usage

References pcm::getExecUsage().

Referenced by pcm::getExecUsage(), and pcm::getTotalExecUsage().

◆ getFreeRunningCounter()

template<class CounterStateType >
int64 pcm::getFreeRunningCounter ( const typename CounterStateType::FreeRunningCounterID &  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Returns free running counter if it exists, -1 otherwise.

Parameters
countername of the counter
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getFreeRunningCounter().

Referenced by pcm::getFreeRunningCounter().

◆ getGTRequestBytesFromMC()

template<class CounterStateType >
uint64 pcm::getGTRequestBytesFromMC ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of bytes of read/write requests from GT engine.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::getGTRequestBytesFromMC(), and pcm::PCM::getInstance().

Referenced by pcm::getGTRequestBytesFromMC().

◆ getIARequestBytesFromMC()

template<class CounterStateType >
uint64 pcm::getIARequestBytesFromMC ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of bytes of read/write requests from all IA.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::getIARequestBytesFromMC(), and pcm::PCM::getInstance().

Referenced by pcm::getIARequestBytesFromMC().

◆ getIIOCounter()

template<class CounterStateType >
uint64 pcm::getIIOCounter ( uint32  stack,
uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of IIO PMU counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
stackIIO stack number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getIIOCounter().

Referenced by pcm::getIIOCounter().

◆ getIncomingQPILinkBytes() [1/2]

uint64 pcm::getIncomingQPILinkBytes ( uint32  socketNr,
uint32  linkNr,
const SystemCounterState before,
const SystemCounterState after 
)
inline

Get estimation of QPI data traffic per incoming QPI link.

Returns an estimation of number of data bytes transferred to a socket over Intel(r) Quick Path Interconnect

Parameters
socketNrsocket identifier
linkNrlinkNr
beforeSystem CPU counter state before the experiment
afterSystem CPU counter state after the experiment
Returns
Number of bytes

References pcm::getIncomingQPILinkBytes(), and pcm::PCM::getInstance().

Referenced by pcm::getIncomingQPILinkBytes(), and pcm::getIncomingQPILinkUtilization().

◆ getIncomingQPILinkBytes() [2/2]

uint64 pcm::getIncomingQPILinkBytes ( uint32  socketNr,
uint32  linkNr,
const SystemCounterState now 
)
inline

Return current value of the counter of QPI data traffic per incoming QPI link.

Returns the number of incoming data bytes to a socket over Intel(r) Quick Path Interconnect

Parameters
socketNrsocket identifier
linkNrlinkNr
nowCurrent System CPU counter state
Returns
Number of bytes

References pcm::getIncomingQPILinkBytes(), and pcm::PCM::getInstance().

◆ getIncomingQPILinkUtilization()

double pcm::getIncomingQPILinkUtilization ( uint32  socketNr,
uint32  linkNr,
const SystemCounterState before,
const SystemCounterState after 
)
inline

Get data utilization of incoming QPI link (0..1)

Returns an estimation of utilization of QPI link by data traffic transferred to a socket over Intel(r) Quick Path Interconnect

Parameters
socketNrsocket identifier
linkNrlinkNr
beforeSystem CPU counter state before the experiment
afterSystem CPU counter state after the experiment
Returns
utilization (0..1)

References pcm::getIncomingQPILinkBytes(), pcm::getIncomingQPILinkUtilization(), pcm::PCM::getInstance(), pcm::getInvariantTSC(), pcm::PCM::getNominalFrequency(), pcm::PCM::getNumOnlineCores(), and pcm::PCM::getQPILinkSpeed().

Referenced by pcm::getIncomingQPILinkUtilization().

◆ getInstructionsRetired() [1/2]

template<class CounterStateType >
uint64 pcm::getInstructionsRetired ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes the number of retired instructions.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
number of retired instructions

References pcm::getInstructionsRetired().

Referenced by pcm::getInstructionsRetired().

◆ getInstructionsRetired() [2/2]

template<class CounterStateType >
uint64 pcm::getInstructionsRetired ( const CounterStateType &  now)

Computes the number of retired instructions.

Parameters
nowCurrent CPU counter state
Returns
number of retired instructions

References pcm::getInstructionsRetired().

◆ getInvariantTSC()

template<class CounterStateType >
uint64 pcm::getInvariantTSC ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of invariant time stamp counter ticks.

This counter counts irrespectively of C-, P- or T-states

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
number of time stamp counter ticks

References pcm::getInvariantTSC().

Referenced by pcm::getCoreCStateResidency(), pcm::getIncomingQPILinkUtilization(), pcm::getInvariantTSC(), pcm::getLLCReadMissLatency(), pcm::getOutgoingQPILinkBytes(), pcm::getOutgoingQPILinkUtilization(), and pcm::getPackageCStateResidency().

◆ getIORequestBytesFromMC()

template<class CounterStateType >
uint64 pcm::getIORequestBytesFromMC ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of bytes of read/write requests from all IO sources.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::PCM::getInstance(), and pcm::getIORequestBytesFromMC().

Referenced by pcm::getIORequestBytesFromMC().

◆ getIPC()

template<class CounterStateType >
double pcm::getIPC ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes average number of retired instructions per core cycle (IPC)

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
IPC

References pcm::getIPC().

Referenced by pcm::getCoreIPC(), and pcm::getIPC().

◆ getIRPCounter()

template<class CounterStateType >
uint64 pcm::getIRPCounter ( uint32  stack,
uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of IRP PMU counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
stackIIO stack number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getIRPCounter().

Referenced by pcm::getIRPCounter().

◆ getL2CacheHitRatio()

template<class CounterStateType >
double pcm::getL2CacheHitRatio ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes L2 cache hit ratio.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Warning
Works only in the DEFAULT_EVENTS programming mode (see program() method)
Returns
value between 0 and 1

References pcm::PCM::getInstance(), pcm::getL2CacheHitRatio(), pcm::getL2CacheHits(), and pcm::getL2CacheMisses().

Referenced by pcm::getL2CacheHitRatio().

◆ getL2CacheHits()

template<class CounterStateType >
uint64 pcm::getL2CacheHits ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of L2 cache hits.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Warning
Works only in the DEFAULT_EVENTS programming mode (see program() method)
Returns
number of hits

References pcm::PCM::getInstance(), and pcm::getL2CacheHits().

Referenced by pcm::getL2CacheHitRatio(), and pcm::getL2CacheHits().

◆ getL2CacheMisses()

template<class CounterStateType >
uint64 pcm::getL2CacheMisses ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of L2 cache misses.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Warning
Works only in the DEFAULT_EVENTS programming mode (see program() method)
Returns
number of misses

References pcm::PCM::getInstance(), and pcm::getL2CacheMisses().

Referenced by pcm::getL2CacheHitRatio(), and pcm::getL2CacheMisses().

◆ getL3CacheHitRatio()

template<class CounterStateType >
double pcm::getL3CacheHitRatio ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes L3 cache hit ratio.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Warning
Works only in the DEFAULT_EVENTS programming mode (see program() method)
Returns
value between 0 and 1

References pcm::PCM::getInstance(), pcm::getL3CacheHitRatio(), pcm::getL3CacheHits(), and pcm::getL3CacheMisses().

Referenced by pcm::getL3CacheHitRatio().

◆ getL3CacheHits()

template<class CounterStateType >
uint64 pcm::getL3CacheHits ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes total number of L3 cache hits.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Warning
Works only in the DEFAULT_EVENTS programming mode (see program() method)
Returns
number of hits

References pcm::PCM::getInstance(), pcm::getL3CacheHits(), pcm::getL3CacheHitsNoSnoop(), and pcm::getL3CacheHitsSnoop().

Referenced by pcm::getL3CacheHitRatio(), and pcm::getL3CacheHits().

◆ getL3CacheHitsNoSnoop()

template<class CounterStateType >
uint64 pcm::getL3CacheHitsNoSnoop ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of L3 cache hits where no snooping in sibling L2 caches had to be done.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Warning
Works only in the DEFAULT_EVENTS programming mode (see program() method)
Returns
number of hits

References pcm::PCM::getInstance(), and pcm::getL3CacheHitsNoSnoop().

Referenced by pcm::getL3CacheHits(), and pcm::getL3CacheHitsNoSnoop().

◆ getL3CacheHitsSnoop()

template<class CounterStateType >
uint64 pcm::getL3CacheHitsSnoop ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of L3 cache hits where snooping in sibling L2 caches had to be done.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Warning
Works only in the DEFAULT_EVENTS programming mode (see program() method)
Returns
number of hits

References pcm::PCM::getInstance(), pcm::getL3CacheHitsSnoop(), and pcm::getL3CacheMisses().

Referenced by pcm::getL3CacheHits(), and pcm::getL3CacheHitsSnoop().

◆ getL3CacheMisses()

template<class CounterStateType >
uint64 pcm::getL3CacheMisses ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes number of L3 cache misses.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Warning
Works only in the DEFAULT_EVENTS programming mode (see program() method)
Returns
number of misses

References pcm::PCM::getInstance(), and pcm::getL3CacheMisses().

Referenced by pcm::getL3CacheHitRatio(), pcm::getL3CacheHitsSnoop(), and pcm::getL3CacheMisses().

◆ getL3CacheOccupancy()

template<class CounterStateType >
uint64 pcm::getL3CacheOccupancy ( const CounterStateType &  now)

Computes L3 Cache Occupancy.

References pcm::PCM::getInstance(), and pcm::getL3CacheOccupancy().

Referenced by pcm::getL3CacheOccupancy().

◆ getLocalMemoryBW()

template<class CounterStateType >
uint64 pcm::getLocalMemoryBW ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes Local Memory Bandwidth.

References pcm::PCM::getInstance(), and pcm::getLocalMemoryBW().

Referenced by pcm::getLocalMemoryBW(), and pcm::getRemoteMemoryBW().

◆ getLocalMemoryRequestRatio()

template<class CounterStateType >
double pcm::getLocalMemoryRequestRatio ( const CounterStateType &  before,
const CounterStateType &  after 
)
inline

Get local memory access ration measured in home agent.

Parameters
beforeSystem CPU counter state before the experiment
afterSystem CPU counter state after the experiment
Returns
Ratio

References pcm::PCM::getInstance(), and pcm::getLocalMemoryRequestRatio().

Referenced by pcm::getLocalMemoryRequestRatio().

◆ getM2MCounter()

template<class CounterStateType >
uint64 pcm::getM2MCounter ( uint32  controller,
uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of Memory2Mesh controller PMU counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
controllercontroller number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getM2MCounter().

Referenced by pcm::getM2MCounter().

◆ getM3UPICounter()

template<class CounterStateType >
uint64 pcm::getM3UPICounter ( uint32  port,
uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of M3UPI PMU counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
portUPI port number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getM3UPICounter().

Referenced by pcm::getM3UPICounter().

◆ getMCCounter()

template<class CounterStateType >
uint64 pcm::getMCCounter ( uint32  channel,
uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of memory controller PMU counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
channelchannel number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getMCCounter().

Referenced by pcm::getMCCounter().

◆ getMCDRAMClocks()

template<class CounterStateType >
uint64 pcm::getMCDRAMClocks ( uint32  channel,
const CounterStateType &  before,
const CounterStateType &  after 
)

Returns MCDRAM clock ticks.

Parameters
channelMCDRAM channel number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getMCDRAMClocks().

Referenced by pcm::getMCDRAMClocks().

◆ getNormalizedQPIL0pTxCycles()

template<class CounterStateType >
double pcm::getNormalizedQPIL0pTxCycles ( uint32  port,
const CounterStateType &  before,
const CounterStateType &  after 
)

Returns the ratio of QPI cycles in power saving half-lane mode.

Parameters
portQPI port number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
0..1 - ratio of QPI cycles in power saving half-lane mode

References pcm::getNormalizedQPIL0pTxCycles(), pcm::getQPIClocks(), and pcm::getQPIL0pTxCycles().

Referenced by pcm::getNormalizedQPIL0pTxCycles().

◆ getNormalizedQPIL1Cycles()

template<class CounterStateType >
double pcm::getNormalizedQPIL1Cycles ( uint32  port,
const CounterStateType &  before,
const CounterStateType &  after 
)

Returns the ratio of QPI cycles in power saving shutdown mode.

Parameters
portQPI port number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
0..1 - ratio of QPI cycles in power saving shutdown mode

References pcm::getNormalizedQPIL1Cycles(), pcm::getQPIClocks(), and pcm::getQPIL1Cycles().

Referenced by pcm::getNormalizedQPIL1Cycles().

◆ getNumberOfCustomEvents()

template<class CounterStateType >
uint64 pcm::getNumberOfCustomEvents ( int32  eventCounterNr,
const CounterStateType &  before,
const CounterStateType &  after 
)

Returns the number of occurred custom core events.

Read number of events programmed with the CUSTOM_CORE_EVENTS

Parameters
eventCounterNrEvent/counter number (value from 0 to 3)
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of bytes

References pcm::getNumberOfCustomEvents().

Referenced by pcm::getNumberOfCustomEvents().

◆ getNumberOfEvents()

template<class CounterType >
uint64 pcm::getNumberOfEvents ( const CounterType &  before,
const CounterType &  after 
)
inline

Returns the raw count of events.

Parameters
beforecounter state before the experiment
aftercounter state after the experiment

References pcm::getNumberOfEvents().

Referenced by pcm::getNumberOfEvents().

◆ getOutgoingQPILinkBytes()

uint64 pcm::getOutgoingQPILinkBytes ( uint32  socketNr,
uint32  linkNr,
const SystemCounterState before,
const SystemCounterState after 
)
inline

Get estimation of QPI (data+nondata) traffic per outgoing QPI link.

Returns an estimation of number of data bytes transferred from a socket over Intel(r) Quick Path Interconnect

Parameters
socketNrsocket identifier
linkNrlinkNr
beforeSystem CPU counter state before the experiment
afterSystem CPU counter state after the experiment
Returns
Number of bytes

References pcm::PCM::getInstance(), pcm::getInvariantTSC(), pcm::PCM::getNominalFrequency(), pcm::PCM::getNumOnlineCores(), pcm::getOutgoingQPILinkBytes(), pcm::getOutgoingQPILinkUtilization(), and pcm::PCM::getQPILinkSpeed().

Referenced by pcm::getOutgoingQPILinkBytes().

◆ getOutgoingQPILinkUtilization()

double pcm::getOutgoingQPILinkUtilization ( uint32  socketNr,
uint32  linkNr,
const SystemCounterState before,
const SystemCounterState after 
)
inline

Get utilization of outgoing QPI link (0..1)

Returns an estimation of utilization of QPI link by (data+nondata) traffic transferred from a socket over Intel(r) Quick Path Interconnect

Parameters
socketNrsocket identifier
linkNrlinkNr
beforeSystem CPU counter state before the experiment
afterSystem CPU counter state after the experiment
Returns
utilization (0..1)

References pcm::PCM::getInstance(), pcm::getInvariantTSC(), pcm::PCM::getNominalFrequency(), pcm::PCM::getNumOnlineCores(), pcm::getOutgoingQPILinkUtilization(), and pcm::PCM::getQPILinkSpeed().

Referenced by pcm::getOutgoingQPILinkBytes(), and pcm::getOutgoingQPILinkUtilization().

◆ getPackageCStateResidency() [1/2]

template<class CounterStateType >
double pcm::getPackageCStateResidency ( int  state,
const CounterStateType &  before,
const CounterStateType &  after 
)
inline

Computes residency in the package C-state.

Parameters
stateC-state
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
residence ratio (0..1): 0 - 0%, 1.0 - 100%

References pcm::PCM::getInstance(), pcm::getInvariantTSC(), pcm::getPackageCStateResidency(), and pcm::PCM::isPackageCStateResidencySupported().

Referenced by pcm::getPackageCStateResidency().

◆ getPackageCStateResidency() [2/2]

template<class CounterStateType >
uint64 pcm::getPackageCStateResidency ( int  state,
const CounterStateType &  now 
)
inline

Reads raw residency counter for the package C-state.

Parameters
stateC-state #
nowCPU counter state
Returns
raw residency value

References pcm::getPackageCStateResidency().

◆ getPCUClocks()

template<class CounterStateType >
uint64 pcm::getPCUClocks ( const CounterStateType &  before,
const CounterStateType &  after 
)

Returns clock ticks of power control unit.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getPCUClocks(), and pcm::getPCUCounter().

Referenced by pcm::getPCUClocks().

◆ getPCUCounter()

template<class CounterStateType >
uint64 pcm::getPCUCounter ( uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of power control unit PMU counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getPCUCounter().

Referenced by pcm::getPCUClocks(), and pcm::getPCUCounter().

◆ getQPIClocks()

template<class CounterStateType >
uint64 pcm::getQPIClocks ( uint32  port,
const CounterStateType &  before,
const CounterStateType &  after 
)

Returns QPI LL clock ticks.

Parameters
portQPI port number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getQPIClocks(), and pcm::getXPICounter().

Referenced by pcm::getNormalizedQPIL0pTxCycles(), pcm::getNormalizedQPIL1Cycles(), and pcm::getQPIClocks().

◆ getQPIL0pTxCycles()

template<class CounterStateType >
uint64 pcm::getQPIL0pTxCycles ( uint32  port,
const CounterStateType &  before,
const CounterStateType &  after 
)

Returns the number of QPI cycles in power saving half-lane mode.

Parameters
portQPI port number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getQPIL0pTxCycles(), and pcm::getXPICounter().

Referenced by pcm::getNormalizedQPIL0pTxCycles(), and pcm::getQPIL0pTxCycles().

◆ getQPIL1Cycles()

template<class CounterStateType >
uint64 pcm::getQPIL1Cycles ( uint32  port,
const CounterStateType &  before,
const CounterStateType &  after 
)

Returns the number of QPI cycles in power saving shutdown mode.

Parameters
portQPI port number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getQPIL1Cycles(), and pcm::getXPICounter().

Referenced by pcm::getNormalizedQPIL1Cycles(), and pcm::getQPIL1Cycles().

◆ getQPItoMCTrafficRatio()

double pcm::getQPItoMCTrafficRatio ( const SystemCounterState before,
const SystemCounterState after 
)
inline

Get QPI data to Memory Controller traffic ratio.

Ideally for NUMA-optmized programs the ratio should be close to 0.

Parameters
beforeSystem CPU counter state before the experiment
afterSystem CPU counter state after the experiment
Returns
Ratio

References pcm::getAllIncomingQPILinkBytes(), pcm::getBytesReadFromMC(), pcm::getBytesReadFromPMM(), pcm::getBytesWrittenToMC(), pcm::getBytesWrittenToPMM(), pcm::PCM::getInstance(), and pcm::getQPItoMCTrafficRatio().

Referenced by pcm::getQPItoMCTrafficRatio().

◆ getRefCycles()

template<class CounterStateType >
uint64 pcm::getRefCycles ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes the number of reference clock cycles while clock signal on the core is running.

The reference clock operates at a fixed frequency, irrespective of core frequency changes due to performance state transitions. See Intel(r) Software Developer's Manual for more details

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
number core clock cycles

References pcm::getRefCycles().

Referenced by pcm::getCoreCStateResidency(), and pcm::getRefCycles().

◆ getRelativeFrequency()

template<class CounterStateType >
double pcm::getRelativeFrequency ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes average core frequency also taking Intel Turbo Boost technology into account.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Fraction of nominal frequency

References pcm::getRelativeFrequency().

Referenced by pcm::getRelativeFrequency().

◆ getRemoteMemoryBW()

template<class CounterStateType >
uint64 pcm::getRemoteMemoryBW ( const CounterStateType &  before,
const CounterStateType &  after 
)

Computes Remote Memory Bandwidth.

References pcm::PCM::getInstance(), pcm::getLocalMemoryBW(), and pcm::getRemoteMemoryBW().

Referenced by pcm::getRemoteMemoryBW().

◆ getSMICount()

template<class CounterStateType >
uint64 pcm::getSMICount ( const CounterStateType &  before,
const CounterStateType &  after 
)

Returns the number of occurred system management interrupts.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
Number of SMIs (system manegement interrupts)

References pcm::getSMICount().

Referenced by pcm::getSMICount().

◆ getSocketCounterState()

PCM_API SocketCounterState pcm::getSocketCounterState ( uint32  socket)

Reads the counter state of a socket.

Helper function. Uses PCM object to access counters.

Parameters
socketsocket id
Returns
State of counters in the socket

References pcm::PCM::getInstance(), and pcm::PCM::getSocketCounterState().

◆ getSocketIncomingQPILinkBytes()

uint64 pcm::getSocketIncomingQPILinkBytes ( uint32  socketNr,
const SystemCounterState now 
)
inline

Get estimation of total QPI data traffic for this socket.

Returns an estimation of number of bytes transferred to this sockets over all Intel(r) Quick Path Interconnect links on this socket

Parameters
beforeSystem CPU counter state before the experiment
afterSystem CPU counter state after the experiment
Returns
Number of bytes

References pcm::PCM::getInstance(), and pcm::getSocketIncomingQPILinkBytes().

Referenced by pcm::getAllIncomingQPILinkBytes(), and pcm::getSocketIncomingQPILinkBytes().

◆ getSystemCounterState()

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.

Returns
State of counters in the entire system

References pcm::PCM::getInstance(), and pcm::PCM::getSystemCounterState().

◆ getTotalExecUsage()

template<class CounterStateType >
double pcm::getTotalExecUsage ( const CounterStateType &  before,
const CounterStateType &  after 
)
inline

Computes average number of retired instructions per time interval for the entire system combining instruction counts from logical cores to corresponding physical cores.

Use this metric to evaluate cores utilization improvement between SMT(Hyperthreading) on and SMT off.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment
Returns
usage

References pcm::getExecUsage(), pcm::PCM::getInstance(), pcm::PCM::getNumCores(), pcm::PCM::getNumOnlineCores(), pcm::PCM::getThreadsPerCore(), and pcm::getTotalExecUsage().

Referenced by pcm::getTotalExecUsage().

◆ getUBOXCounter()

template<class CounterStateType >
uint64 pcm::getUBOXCounter ( uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of UBOX PMU counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getUBOXCounter().

Referenced by pcm::getUBOXCounter().

◆ getUncoreClocks()

template<class CounterStateType >
uint64 pcm::getUncoreClocks ( const CounterStateType &  before,
const CounterStateType &  after 
)

Returns uncore clock ticks.

Parameters
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getUncoreClocks().

Referenced by pcm::getUncoreClocks(), and pcm::PCM::isClientCPU().

◆ getXPICounter()

template<class CounterStateType >
uint64 pcm::getXPICounter ( uint32  port,
uint32  counter,
const CounterStateType &  before,
const CounterStateType &  after 
)

Direct read of UPI or QPI PMU counter (counter meaning depends on the programming: power/performance/etc)

Parameters
countercounter number
portUPI/QPI port number
beforeCPU counter state before the experiment
afterCPU counter state after the experiment

References pcm::getXPICounter().

Referenced by pcm::getQPIClocks(), pcm::getQPIL0pTxCycles(), pcm::getQPIL1Cycles(), and pcm::getXPICounter().