|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectavrora.sim.util.RangeProfiler
The RangeProfiler class implements a probe that can be
used to profile a range of addresses in the program. It maintains
a simple array of long that stores the count for each
instruction in the specified range. It is more space efficient than
the ProgramProfiler since it only stores the count for
the range specified instead of for the entire program.
Counter,
ProgramProfiler| Field Summary | |
int |
high_addr
The high_addr stores the highest address in the range. |
long[] |
icount
The icount field stores the invocation count
for each instruction in the range. |
int |
low_addr
The low_addr stores the lowest address in the range. |
Program |
program
The program field stores a reference to the program
being profiled. |
| Constructor Summary | |
RangeProfiler(Program p,
int low,
int high)
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 int low_addr
low_addr stores the lowest address in the range.
public final int high_addr
high_addr stores the highest address in the range.
public final long[] icount
icount field stores the invocation count
for each instruction in the range. It is indexed by byte addresses, with
index 0 corresponding to the lowest address in the range (low_addr).
at program.getInstr(addr).
| Constructor Detail |
public RangeProfiler(Program p,
int low,
int high)
p - the program to profilelow - the low address in the rangehigh - the high address in the range| 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 range profiler, it simply increments the
count of the instruction at the specified address if that address is in
the given range.
i - 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 range profiler, it does nothing.
i - 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 | |||||||||