INSTLIB::ICOUNT Class Reference
[ICOUNT]

#include <icount.H>

List of all members.

Public Member Functions

UINT64 Count (THREADID tid=0) const
UINT64 CountWithREP (THREADID tid=0) const
VOID SetCount (UINT64 count, THREADID tid=0)
VOID Activate ()


Detailed Description

The example below can be found in InstLibExamples/icount.cpp

#include <iostream>

#include "pin.H"
#include "instlib.H"

INSTLIB::ICOUNT icount;

// This function is called when the application exits
VOID Fini(INT32 code, VOID *v)
{
    std::cerr << "Count " << icount.Count() << " with rep " << icount.CountWithREP() << endl;
}

// argc, argv are the entire command line, including pin -t <toolname> -- ...
int main(int argc, char * argv[])
{
    // Initialize pin
    PIN_Init(argc, argv);

    // Activate instruction counter
    icount.Activate();

    // Register Fini to be called when the application exits
    PIN_AddFiniFunction(Fini, 0);
    
    // Start the program, never returns
    PIN_StartProgram();
    
    return 0;
}



The documentation for this class was generated from the following file:
Generated on Thu May 15 03:23:41 2008 for Pin by  doxygen 1.4.6