|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectavrora.sim.util.ProgramProfiler
The ProgramProfiler class implements a probe that can be used to profile pieces of the program
or the whole program. It maintains a simple array of long that stores the count for every
instruction.
Counter| Field Summary | |
long[] |
icount
The itime field stores the invocation count for each instruction in the program. |
Program |
program
The program field stores a reference to the program being profiled. |
| Constructor Summary | |
ProgramProfiler(Program p)
The constructor for the program profiler constructs the required internal state to store the invocation counts of each instruction. |
|
| Method Summary | |
void |
fireAfter(Instr i,
int address,
State state)
The fireAfter() method is called after the probed instruction executes. |
void |
fireBefore(Instr i,
int address,
State state)
The fireBefore() method is called before the probed instruction executes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final Program program
program field stores a reference to the program being profiled.
public final long[] icount
itime field stores the invocation count for each instruction in the program. It is
indexed by byte addresses. Thus itime[addr] corresponds to the invocation for the
instruction at program.getInstr(addr).
| Constructor Detail |
public ProgramProfiler(Program p)
p - the program to profile| Method Detail |
public void fireBefore(Instr i,
int address,
State state)
fireBefore() method is called before the probed instruction executes. In the
implementation of the program profiler, it simply increments the count of the instruction at the
specified address.
fireBefore in interface Simulator.Probei - the instruction being probedaddress - the address at which this instruction residesstate - the state of the simulation
public void fireAfter(Instr i,
int address,
State state)
fireAfter() method is called after the probed instruction executes. In the
implementation of the profiler, it does nothing.
fireAfter in interface Simulator.Probei - the instruction being probedaddress - the address at which this instruction residesstate - the state of the simulation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||