20 PIN_ERROR(
"Pin tool to gather calling context on each load and store.\n" + KNOB_BASE::StringKnobSummary() +
"\n");
31 char* envPath = getenv(
"CCTLIB_CLIENT_OUTPUT_FILE");
35 snprintf(name,
sizeof(name),
"%s", envPath);
38 gethostname(name + strlen(name),
MAX_FILE_PATH - strlen(name));
40 sprintf(name + strlen(name),
"%d", pid);
41 cerr <<
"\n Creating log file at:" << name <<
"\n";
46 for (
int i = 0; i < argc; i++) {
58 if (INS_IsMemoryRead(ins) || INS_IsMemoryWrite(ins))
59 INS_InsertPredicatedCall(ins, IPOINT_BEFORE, (AFUNPTR)
SimpleCCTQuery, IARG_THREAD_ID, IARG_END);
64 if (INS_IsMemoryRead(ins) || INS_IsMemoryWrite(ins))
65 INS_InsertPredicatedCall(ins, IPOINT_BEFORE, (AFUNPTR)
SimpleCCTQuery, IARG_THREAD_ID, IARG_UINT32, slot, IARG_END);
68 int main(
int argc,
char* argv[]) {
70 if (PIN_Init(argc, argv))
int main(int argc, char *argv[])
void ClientInit(int argc, char *argv[])
VOID InstrumentIns(INS ins, VOID *v)
VOID SimpleCCTQuery(THREADID id, const uint32_t slot)
VOID InstrumentInsCallback(INS ins, VOID *v, const uint32_t slot)
#define INTERESTING_INS_MEMORY_ACCESS
int PinCCTLibInit(IsInterestingInsFptr isInterestingIns, FILE *logFile, CCTLibInstrumentInsCallback userCallback, VOID *userCallbackArg, BOOL doDataCentric=false)
ContextHandle_t GetContextHandle(const THREADID id, const uint32_t slot)