Filters are used to select static parts of the program to instrument. A user may only want to instrument specific routines or may way to ignore shared libraries.
The example below can be foundin InstLibExamples/filter.cpp
#include <iomanip>
#include <iostream>
#include "pin.H"
#include "instlib.H"
using std::ofstream;
using std::hex;
using std::setw;
ofstream out;
"o", "filter.out", "specify output file name");
INT32 Usage()
{
cerr <<
"This pin tool demonstrates use of FILTER to identify instrumentation points\n"
"\n";
cerr << KNOB_BASE::StringKnobSummary() << endl;
return -1;
}
VOID Trace(
TRACE trace, VOID * val)
{
return;
{
{
{
}
}
}
}
}
VOID Fini(INT32 code, VOID * junk)
{
out.close();
}
int main(int argc, char * argv[])
{
{
return Usage();
}
out.open(KnobOutputFile.Value().c_str());
return 0;
}