Processor Counter Monitor
Classes | Macros | Typedefs | Functions | Variables
pcm-memory.cpp File Reference

Example of using CPU counters: implements a performance counter monitoring utility for memory controller channels and DIMMs (ranks) + PMM memory traffic. More...

#include <iostream>
#include <unistd.h>
#include <signal.h>
#include <sys/time.h>
#include <math.h>
#include <iomanip>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <string>
#include <assert.h>
#include "cpucounters.h"
#include "utils.h"

Classes

struct  memdata
 

Macros

#define HACK_TO_REMOVE_DUPLICATE_ERROR
 
#define READ   0
 
#define WRITE   1
 
#define READ_RANK_A   0
 
#define WRITE_RANK_A   1
 
#define READ_RANK_B   2
 
#define WRITE_RANK_B   3
 
#define PARTIAL   2
 
#define PMM_READ   2
 
#define PMM_WRITE   3
 
#define NM_HIT   0
 
#define PCM_DELAY_DEFAULT   1.0
 
#define PCM_DELAY_MIN   0.015
 
#define PCM_CALIBRATION_INTERVAL   50
 
#define DEFAULT_DISPLAY_COLUMNS   2
 

Typedefs

typedef struct memdata memdata_t
 

Functions

void print_help (const string prog_name)
 
void printSocketBWHeader (uint32 no_columns, uint32 skt, const bool show_channel_output)
 
void printSocketRankBWHeader (uint32 no_columns, uint32 skt)
 
void printSocketChannelBW (PCM *m, memdata_t *md, uint32 no_columns, uint32 skt)
 
void printSocketChannelBW (uint32 no_columns, uint32 skt, uint32 num_imc_channels, const ServerUncorePowerState *uncState1, const ServerUncorePowerState *uncState2, uint64 elapsedTime, int rankA, int rankB)
 
void printSocketBWFooter (uint32 no_columns, uint32 skt, const memdata_t *md)
 
void display_bandwidth (PCM *m, memdata_t *md, uint32 no_columns, const bool show_channel_output)
 
void display_bandwidth_csv_header (PCM *m, memdata_t *md, const bool show_channel_output)
 
void display_bandwidth_csv (PCM *m, memdata_t *md, uint64 elapsedTime, const bool show_channel_output)
 
void calculate_bandwidth (PCM *m, const ServerUncorePowerState uncState1[], const ServerUncorePowerState uncState2[], uint64 elapsedTime, bool csv, bool &csvheader, uint32 no_columns, bool PMM, const bool show_channel_output)
 
void calculate_bandwidth (PCM *m, const ServerUncorePowerState uncState1[], const ServerUncorePowerState uncState2[], uint64 elapsedTime, bool csv, bool &csvheader, uint32 no_columns, int rankA, int rankB)
 
int main (int argc, char *argv[])
 

Variables

const uint32 max_sockets = 256
 
const uint32 max_imc_channels = ServerUncorePowerState::maxChannels
 
const uint32 max_edc_channels = ServerUncorePowerState::maxChannels
 
const uint32 max_imc_controllers = ServerUncorePowerState::maxControllers
 

Detailed Description

Example of using CPU counters: implements a performance counter monitoring utility for memory controller channels and DIMMs (ranks) + PMM memory traffic.