/*! * The main procedure of the tool. */ int main(int argc, char *argv[]) { PIN_InitSymbols(); PIN_Init(argc, argv); RTN_AddInstrumentFunction(InstrumentRoutine, 0); CODECACHE_AddCacheFlushedFunction(OnCacheFlush, 0); PIN_StartProgram(); return 0; }
int main(INT32 argc, CHAR **argv) { PIN_Init(argc, argv); INS_AddInstrumentFunction(InstrumentRoutine, 0); CODECACHE_AddCacheFlushedFunction(OnCacheFlush, 0); PIN_AddFiniFunction(Fini, 0); PIN_StartProgram(); return 0; }
int main(INT32 argc, CHAR **argv) { PIN_InitSymbols(); PIN_Init(argc, argv); Out = fopen("mtflush.out", "w"); RTN_AddInstrumentFunction(InstrumentRoutine, 0); CODECACHE_AddCacheFlushedFunction(OnCacheFlush, 0); PIN_StartProgram(); return 0; }
// argc, argv are the entire command line, including pin -t <toolname> -- ... int main(int argc, char * argv[]) { // Initialize pin if (PIN_Init(argc, argv)) return CodeCacheStressUsage(); OutFile.open(KnobOutputFile.Value().c_str()); // Register CacheFlushedCallback to be called when the PIN flushes the code cache CODECACHE_AddCacheFlushedFunction(CacheFlushedCallback, NULL); // Register Fini to be called when the application exits PIN_AddFiniFunction(Fini, 0); ToolStartTime = clock(); // Start the program, never returns PIN_StartProgram(); return 0; }