|
CCTLib
Calling-context and data-object attribution library for Intel Pin
|
#include <inttypes.h>#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <iostream>#include <unistd.h>#include <assert.h>#include <string.h>#include <list>#include <sys/mman.h>#include <sstream>#include <functional>#include <unordered_set>#include <vector>#include <unordered_map>#include <algorithm>#include "pin.H"#include "pin_isa_compat.H"#include "cctlib.H"
Include dependency graph for redspy_spatial_userdefine_client.cpp:Go to the source code of this file.
Classes | |
| struct | RedSpyThreadData |
| struct | ArrayAnalysis< T, isApprox > |
| struct | RedundacyData |
Macros | |
| #define | USE_TREE_BASED_FOR_DATA_CENTRIC |
| #define | USE_TREE_WITH_ADDR |
| #define | THREAD_MAX (1024) |
| #define | GEN_REG_NUM (16) |
| #define | GEN_REG_LEN (8) |
| #define | X87_REG_NUM (8) |
| #define | X87_REG_LEN (10) |
| #define | SIMD_REG_NUM (16) |
| #define | SIMD_REG_LEN (32) |
| #define | SAME_RATE (0.1) |
| #define | SAME_RECORD_LIMIT (0) |
| #define | RED_RATE (0.9) |
| #define | APPROX_RATE (0.01) |
| #define | ARRAY_UPDATE_THRESHOLD(a) (a / 4) |
| #define | MAKE_CONTEXT_PAIR(a, b) (((uint64_t)(a) << 32) | ((uint64_t)(b))) |
| #define | ARRAY_ANALYSIS_FN_NAME "Analyze_this_array" |
| #define | REG_ANALYSIS_FN_NAME "Analyze_regs" |
Typedefs | |
| using | ValueGroup = struct valueGroup { list< uint32_t > indexes |
| using | IntraRedRecord = struct intraRedRecord { double redundancy |
| using | IntraRegsRed = struct intraRegsRed { double genRegRed |
Functions | |
| RedSpyThreadData * | ClientGetTLS (const THREADID threadId) |
| static INT32 | Usage () |
| static void | ClientInit (int argc, char *argv[]) |
| VOID | RecordIntraRegsRedundancy (uint32_t ctxt, IntraRegsRed redPair, THREADID threadId) |
| VOID | RecordIntraArrayRedundancy (const string &name, const IntraRedRecord &redPair, THREADID threadId) |
| static void | CheckRegValues (CONTEXT *ctxt, THREADID threadId) |
| static VOID | InstrumentInsCallback (INS ins, VOID *v, const uint32_t opaqueHandle) |
| void | new_ARRAY_ANALYSIS_FN_NAME (const char *name, void *addr, uint32_t typeSize, uint32_t stride, bool isApprox, THREADID threadId) |
| VOID | Overrides (IMG img, VOID *v) |
| static string | ConvertListToString (list< uint32_t > inlist) |
| static bool | RedundacyCompare (const struct RedundacyData &first, const struct RedundacyData &second) |
| static void | PrintRedundancyPairs (THREADID threadId) |
| static VOID | ImageUnload (IMG img, VOID *v) |
| static VOID | ThreadFiniFunc (THREADID threadId, const CONTEXT *ctxt, INT32 code, VOID *v) |
| static VOID | FiniFunc (INT32 code, VOID *v) |
| static void | InitThreadData (RedSpyThreadData *tdata) |
| static VOID | ThreadStart (THREADID threadid, CONTEXT *ctxt, INT32 flags, VOID *v) |
| int | main (int argc, char *argv[]) |
Variables | |
| uint32_t | curCtxt |
| list< ValueGroup > | group |
| list< uint32_t > | spatialRedInd |
| double | x87RegRed |
| double | simdRegRed |
| static TLS_KEY | client_tls_key |
| static RedSpyThreadData * | gSingleThreadedTData |
| static FILE * | gTraceFile |
| uint32_t | lastStatic |
| static unordered_map< string, list< IntraRedRecord > > | arrayDataRed [THREAD_MAX] |
| static unordered_map< uint32_t, list< IntraRegsRed > > | regsRed [THREAD_MAX] |
| #define APPROX_RATE (0.01) |
Definition at line 44 of file redspy_spatial_userdefine_client.cpp.
| #define ARRAY_ANALYSIS_FN_NAME "Analyze_this_array" |
Definition at line 49 of file redspy_spatial_userdefine_client.cpp.
Definition at line 46 of file redspy_spatial_userdefine_client.cpp.
| #define GEN_REG_LEN (8) |
Definition at line 35 of file redspy_spatial_userdefine_client.cpp.
| #define GEN_REG_NUM (16) |
Definition at line 34 of file redspy_spatial_userdefine_client.cpp.
Definition at line 47 of file redspy_spatial_userdefine_client.cpp.
| #define RED_RATE (0.9) |
Definition at line 43 of file redspy_spatial_userdefine_client.cpp.
| #define REG_ANALYSIS_FN_NAME "Analyze_regs" |
Definition at line 50 of file redspy_spatial_userdefine_client.cpp.
| #define SAME_RATE (0.1) |
Definition at line 41 of file redspy_spatial_userdefine_client.cpp.
| #define SAME_RECORD_LIMIT (0) |
Definition at line 42 of file redspy_spatial_userdefine_client.cpp.
| #define SIMD_REG_LEN (32) |
Definition at line 39 of file redspy_spatial_userdefine_client.cpp.
| #define SIMD_REG_NUM (16) |
Definition at line 38 of file redspy_spatial_userdefine_client.cpp.
| #define THREAD_MAX (1024) |
Definition at line 32 of file redspy_spatial_userdefine_client.cpp.
| #define USE_TREE_BASED_FOR_DATA_CENTRIC |
Definition at line 26 of file redspy_spatial_userdefine_client.cpp.
| #define USE_TREE_WITH_ADDR |
Definition at line 27 of file redspy_spatial_userdefine_client.cpp.
| #define X87_REG_LEN (10) |
Definition at line 37 of file redspy_spatial_userdefine_client.cpp.
| #define X87_REG_NUM (8) |
Definition at line 36 of file redspy_spatial_userdefine_client.cpp.
| using IntraRedRecord = struct intraRedRecord { double redundancy |
Definition at line 57 of file redspy_spatial_userdefine_client.cpp.
| using IntraRegsRed = struct intraRegsRed { double genRegRed |
Definition at line 64 of file redspy_spatial_userdefine_client.cpp.
| using ValueGroup = struct valueGroup { list<uint32_t> indexes |
Definition at line 53 of file redspy_spatial_userdefine_client.cpp.
|
static |
Definition at line 154 of file redspy_spatial_userdefine_client.cpp.
References GEN_REG_LEN, GEN_REG_NUM, PinCCTLib::GetContextHandle(), RecordIntraRegsRedundancy(), RED_RATE, SIMD_REG_LEN, SIMD_REG_NUM, X87_REG_LEN, and X87_REG_NUM.
Referenced by Overrides().
|
inline |
Definition at line 81 of file redspy_spatial_userdefine_client.cpp.
References client_tls_key, and gSingleThreadedTData.
|
static |
Definition at line 101 of file redspy_spatial_userdefine_client.cpp.
References gTraceFile, and MAX_FILE_PATH.
Referenced by main().
|
inlinestatic |
Definition at line 481 of file redspy_spatial_userdefine_client.cpp.
Referenced by PrintRedundancyPairs().
|
static |
Definition at line 561 of file redspy_spatial_userdefine_client.cpp.
Referenced by main().
|
static |
Definition at line 546 of file redspy_spatial_userdefine_client.cpp.
References arrayDataRed, gTraceFile, and PrintRedundancyPairs().
Referenced by main().
|
static |
Definition at line 566 of file redspy_spatial_userdefine_client.cpp.
References RedSpyThreadData::numIns.
Referenced by ThreadStart().
|
static |
Definition at line 360 of file redspy_spatial_userdefine_client.cpp.
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 583 of file redspy_spatial_userdefine_client.cpp.
References client_tls_key, ClientInit(), FiniFunc(), gTraceFile, ImageUnload(), InstrumentInsCallback(), INTERESTING_INS_MEMORY_ACCESS, Overrides(), PinCCTLib::PinCCTLibInit(), ThreadFiniFunc(), ThreadStart(), and Usage().
| void new_ARRAY_ANALYSIS_FN_NAME | ( | const char * | name, |
| void * | addr, | ||
| uint32_t | typeSize, | ||
| uint32_t | stride, | ||
| bool | isApprox, | ||
| THREADID | threadId | ||
| ) |
Definition at line 364 of file redspy_spatial_userdefine_client.cpp.
References PinCCTLib::GetContextHandle(), PinCCTLib::GetDataObjectHandle(), and RecordIntraArrayRedundancy().
Referenced by Overrides().
| VOID Overrides | ( | IMG | img, |
| VOID * | v | ||
| ) |
Definition at line 439 of file redspy_spatial_userdefine_client.cpp.
References ARRAY_ANALYSIS_FN_NAME, CheckRegValues(), new_ARRAY_ANALYSIS_FN_NAME(), and REG_ANALYSIS_FN_NAME.
Referenced by main().
|
static |
Definition at line 504 of file redspy_spatial_userdefine_client.cpp.
References arrayDataRed, ConvertListToString(), gTraceFile, PinCCTLib::PrintFullCallingContext(), and regsRed.
Referenced by ImageUnload().
|
inline |
Definition at line 142 of file redspy_spatial_userdefine_client.cpp.
References arrayDataRed.
Referenced by new_ARRAY_ANALYSIS_FN_NAME().
|
inline |
Definition at line 130 of file redspy_spatial_userdefine_client.cpp.
References regsRed.
Referenced by CheckRegValues().
|
inlinestatic |
Definition at line 500 of file redspy_spatial_userdefine_client.cpp.
References RedundacyData::frequency.
|
static |
Definition at line 558 of file redspy_spatial_userdefine_client.cpp.
Referenced by main().
|
static |
Definition at line 570 of file redspy_spatial_userdefine_client.cpp.
References client_tls_key, gSingleThreadedTData, and InitThreadData().
Referenced by main().
|
static |
Definition at line 92 of file redspy_spatial_userdefine_client.cpp.
Referenced by main().
|
static |
Definition at line 126 of file redspy_spatial_userdefine_client.cpp.
Referenced by ImageUnload(), PrintRedundancyPairs(), and RecordIntraArrayRedundancy().
|
static |
Definition at line 77 of file redspy_spatial_userdefine_client.cpp.
Referenced by ClientGetTLS(), main(), and ThreadStart().
| uint32_t curCtxt |
Definition at line 59 of file redspy_spatial_userdefine_client.cpp.
Referenced by AnalyzeInsLevelReuse(), CheckAfterLargeRead(), CheckEvictions(), checkMovValueNum(), checkOpcodeValueNum(), and RecordEvictionPair().
| list<ValueGroup> group |
Definition at line 60 of file redspy_spatial_userdefine_client.cpp.
|
static |
Definition at line 78 of file redspy_spatial_userdefine_client.cpp.
Referenced by ClientGetTLS(), and ThreadStart().
|
static |
Definition at line 98 of file redspy_spatial_userdefine_client.cpp.
Referenced by ClientInit(), ImageUnload(), main(), and PrintRedundancyPairs().
| uint32_t lastStatic |
Definition at line 99 of file redspy_spatial_userdefine_client.cpp.
|
static |
Definition at line 127 of file redspy_spatial_userdefine_client.cpp.
Referenced by PrintRedundancyPairs(), and RecordIntraRegsRedundancy().
| double simdRegRed |
Definition at line 67 of file redspy_spatial_userdefine_client.cpp.
| list<uint32_t> spatialRedInd |
Definition at line 61 of file redspy_spatial_userdefine_client.cpp.
| double x87RegRed |
Definition at line 66 of file redspy_spatial_userdefine_client.cpp.