CCTLib
Calling-context and data-object attribution library for Intel Pin
cct_data_name.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <iostream>
#include <unistd.h>
#include <assert.h>
#include <string>
#include <math.h>
#include <sstream>
#include <locale>
#include <unordered_map>
#include "pin.H"
#include "cctlib.H"
+ Include dependency graph for cct_data_name.cpp:

Go to the source code of this file.

Classes

struct  DataObj
 

Macros

#define OFFSET   20000000
 
#define USE_TREE_BASED_FOR_DATA_CENTRIC
 

Functions

INT32 Usage2 ()
 
VOID ImageUnload (IMG img, VOID *v)
 
void ClientInit (int argc, char *argv[])
 
VOID SimpleCCTQuery (THREADID id, const uint32_t slot)
 
uint32_t getIndex (uint64_t beg, uint64_t end, void *addr, uint32_t sysIndex, THREADID threadId)
 
void updateDataList (void *addr, DataHandle_t data, THREADID threadId)
 
VOID MemAnalysisRoutine (void *addr, THREADID threadId)
 
VOID InstrumentInsCallback (INS ins, VOID *v, const uint32_t slot)
 
int main (int argc, char *argv[])
 

Variables

FILE * gTraceFile
 
PIN_LOCK clientLock
 
long long CTR = 0
 
int WINDOW_WIDTH = 500 * 1000
 
int MAX_WINDOW_ALLOWED = 1000
 
int ChunkSize = 512 * (1 << 10)
 
int window
 
int TH = 0
 
bool outputflag = true
 
bool errflag = true
 
float OutputTH = 0.5
 
unordered_map< uint32_t, DataObjDataObjectMap
 
unordered_map< uint32_t, long * > DataWindowMap
 
unordered_map< uint32_t, int * > DataThreadMap
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET   20000000

Definition at line 22 of file cct_data_name.cpp.

◆ USE_TREE_BASED_FOR_DATA_CENTRIC

#define USE_TREE_BASED_FOR_DATA_CENTRIC

Definition at line 27 of file cct_data_name.cpp.

Function Documentation

◆ ClientInit()

void ClientInit ( int  argc,
char *  argv[] 
)

Definition at line 193 of file cct_data_name.cpp.

References gTraceFile, ImageUnload(), and MAX_FILE_PATH.

Referenced by main().

◆ getIndex()

uint32_t getIndex ( uint64_t  beg,
uint64_t  end,
void *  addr,
uint32_t  sysIndex,
THREADID  threadId 
)

Definition at line 226 of file cct_data_name.cpp.

References ChunkSize, clientLock, errflag, and OFFSET.

Referenced by updateDataList().

◆ ImageUnload()

◆ InstrumentInsCallback()

VOID InstrumentInsCallback ( INS  ins,
VOID *  v,
const uint32_t  slot 
)

Definition at line 336 of file cct_data_name.cpp.

References MemAnalysisRoutine(), and SimpleCCTQuery().

Referenced by main().

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ MemAnalysisRoutine()

VOID MemAnalysisRoutine ( void *  addr,
THREADID  threadId 
)

◆ SimpleCCTQuery()

VOID SimpleCCTQuery ( THREADID  id,
const uint32_t  slot 
)

Definition at line 221 of file cct_data_name.cpp.

References PinCCTLib::GetContextHandle().

Referenced by InstrumentInsCallback().

◆ updateDataList()

void updateDataList ( void *  addr,
DataHandle_t  data,
THREADID  threadId 
)

◆ Usage2()

INT32 Usage2 ( )

Definition at line 34 of file cct_data_name.cpp.

Referenced by main().

Variable Documentation

◆ ChunkSize

int ChunkSize = 512 * (1 << 10)

Definition at line 54 of file cct_data_name.cpp.

Referenced by getIndex().

◆ clientLock

PIN_LOCK clientLock

Definition at line 48 of file cct_data_name.cpp.

Referenced by getIndex(), MemAnalysisRoutine(), and updateDataList().

◆ CTR

long long CTR = 0

Definition at line 51 of file cct_data_name.cpp.

Referenced by ImageUnload(), and MemAnalysisRoutine().

◆ DataObjectMap

unordered_map<uint32_t, DataObj> DataObjectMap

Definition at line 62 of file cct_data_name.cpp.

Referenced by ImageUnload(), and updateDataList().

◆ DataThreadMap

unordered_map<uint32_t, int*> DataThreadMap

Definition at line 64 of file cct_data_name.cpp.

Referenced by ImageUnload(), and updateDataList().

◆ DataWindowMap

unordered_map<uint32_t, long*> DataWindowMap

Definition at line 63 of file cct_data_name.cpp.

Referenced by ImageUnload(), and updateDataList().

◆ errflag

bool errflag = true

Definition at line 60 of file cct_data_name.cpp.

Referenced by getIndex().

◆ gTraceFile

FILE* gTraceFile

Definition at line 39 of file cct_data_name.cpp.

Referenced by ClientInit(), ImageUnload(), and main().

◆ MAX_WINDOW_ALLOWED

int MAX_WINDOW_ALLOWED = 1000

Definition at line 53 of file cct_data_name.cpp.

Referenced by ImageUnload(), and updateDataList().

◆ outputflag

bool outputflag = true

Definition at line 59 of file cct_data_name.cpp.

Referenced by ImageUnload().

◆ OutputTH

float OutputTH = 0.5

Definition at line 61 of file cct_data_name.cpp.

◆ TH

int TH = 0

Definition at line 57 of file cct_data_name.cpp.

◆ window

int window

Definition at line 56 of file cct_data_name.cpp.

Referenced by ImageUnload(), MemAnalysisRoutine(), and updateDataList().

◆ WINDOW_WIDTH

int WINDOW_WIDTH = 500 * 1000

Definition at line 52 of file cct_data_name.cpp.

Referenced by ImageUnload(), and MemAnalysisRoutine().