|
ChampSim
|
#include <fstream>#include <iostream>#include <stdlib.h>#include <string.h>#include <string>#include "../../inc/trace_instruction.h"#include "pin.H"
Typedefs | |
| using | trace_instr_format_t = input_instr |
Functions | |
| KNOB< std::string > | KnobOutputFile (KNOB_MODE_WRITEONCE, "pintool", "o", "champsim.trace", "specify file name for Champsim tracer output") |
| KNOB< UINT64 > | KnobSkipInstructions (KNOB_MODE_WRITEONCE, "pintool", "s", "0", "How many instructions to skip before tracing begins") |
| KNOB< UINT64 > | KnobTraceInstructions (KNOB_MODE_WRITEONCE, "pintool", "t", "1000000", "How many instructions to trace") |
| INT32 | Usage () |
| void | ResetCurrentInstruction (VOID *ip) |
| BOOL | ShouldWrite () |
| void | WriteCurrentInstruction () |
| void | BranchOrNot (UINT32 taken) |
| template<typename T > | |
| void | WriteToSet (T *begin, T *end, UINT32 r) |
| VOID | Instruction (INS ins, VOID *v) |
| VOID | Fini (INT32 code, VOID *v) |
| int | main (int argc, char *argv[]) |
Variables | |
| UINT64 | instrCount = 0 |
| std::ofstream | outfile |
| trace_instr_format_t | curr_instr |
This is an example of the PIN tool that demonstrates some basic PIN APIs and could serve as the starting point for developing your first PIN tool
| using trace_instr_format_t = input_instr |
| void BranchOrNot | ( | UINT32 | taken | ) |
| VOID Fini | ( | INT32 | code, |
| VOID * | v | ||
| ) |
Print out analysis results. This function is called when the application exits.
| [in] | code | exit code of the application |
| [in] | v | value specified by the tool in the PIN_AddFiniFunction function call |
| VOID Instruction | ( | INS | ins, |
| VOID * | v | ||
| ) |
| KNOB<std::string> KnobOutputFile | ( | KNOB_MODE_WRITEONCE | , |
| "pintool" | , | ||
| "o" | , | ||
| "champsim.trace" | , | ||
| "specify file name for Champsim tracer output" | |||
| ) |
| KNOB<UINT64> KnobSkipInstructions | ( | KNOB_MODE_WRITEONCE | , |
| "pintool" | , | ||
| "s" | , | ||
| "0" | , | ||
| "How many instructions to skip before tracing begins" | |||
| ) |
| KNOB<UINT64> KnobTraceInstructions | ( | KNOB_MODE_WRITEONCE | , |
| "pintool" | , | ||
| "t" | , | ||
| "1000000" | , | ||
| "How many instructions to trace" | |||
| ) |
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
The main procedure of the tool. This function is called when the application image is loaded but not yet started.
| [in] | argc | total number of elements in the argv array |
| [in] | argv | array of command line arguments, including pin -t <toolname> – ... |
| void ResetCurrentInstruction | ( | VOID * | ip | ) |
| BOOL ShouldWrite | ( | ) |
| INT32 Usage | ( | ) |
Print out help message.
| void WriteCurrentInstruction | ( | ) |
| void WriteToSet | ( | T * | begin, |
| T * | end, | ||
| UINT32 | r | ||
| ) |
| trace_instr_format_t curr_instr |
| UINT64 instrCount = 0 |
| std::ofstream outfile |