Classes | |
class | INSTLIB::ALARM_ICOUNT |
Functions | |
INT64 | INSTLIB::ALARM_ICOUNT::Count (THREADID tid=0) const |
VOID | INSTLIB::ALARM_ICOUNT::SetAlarm (INT64 count, ALARM_HANDLER handler, VOID *val, THREADID tid=0, BOOL rearm=FALSE, BOOL always_armed=FALSE) |
VOID | INSTLIB::ALARM_ICOUNT::Activate () |
VOID | INSTLIB::ALARM_ICOUNT::ReActivate () |
VOID | INSTLIB::ALARM_ICOUNT::DeActivate () |
BOOL | INSTLIB::ALARM_ICOUNT::Active () const |
The example below can be found in InstLibExamples/alarm_icount.cpp
#include <iostream> #include "pin.H" #include "instlib.H" INSTLIB::ALARM_ICOUNT ialarm; VOID Handler(VOID * val, CONTEXT * ctxt, VOID * ip, THREADID tid) { INSTLIB::ALARM_ICOUNT * al = static_cast<INSTLIB::ALARM_ICOUNT *>(val); std::cout << "Alarm fired, resetting" << endl; al->SetAlarm(50000, Handler, al); } // argc, argv are the entire command line, including pin -t <toolname> -- ... int main(int argc, char * argv[]) { // Initialize pin PIN_Init(argc, argv); // Activate alarm, must be done before PIN_StartProgram ialarm.Activate(); ialarm.SetAlarm(50000, Handler, &ialarm); // Start the program, never returns PIN_StartProgram(); return 0; }
|
This function initializes an alarm and must be called before PIN_StartProgram. It does turn the alarm on. Use SetAlarm. |
|
Is this ALARM_ICOUNT active? |
|
|
|
De-activate the counter, should call PIN_RemoveInstrumentation() after de-activating |
|
This function re-enables the alarm following a DeActivate(); must have called Activate() before. |
|
Turn on an alarm. You should call Activate for this alarm before PIN_StartProgram
|