|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.adaptive.measurements.instrumentation.ManagedCounterData
public class ManagedCounterData
This class provides the basic functionality for instrumented data that use counters allocated from a InstrumentedEventCounterManager. It provides the basic interface to access counters, forwarding those requests to the counter manager.
Nested Class Summary | |
---|---|
(package private) static class |
ManagedCounterData.Counter
Auxiliary class |
Field Summary | |
---|---|
protected boolean |
automaticallyGrowCounters
|
protected InstrumentedEventCounterManager |
counterManager
Basic block instrumentation stores its counters using an abstracted counter allocation technique (a counterManager) |
protected int |
handle
When a data object is registered with a counter manager, it is given an id, which is stored here. |
protected int |
numCounters
How many counters are needed by this data? |
Constructor Summary | |
---|---|
ManagedCounterData(InstrumentedEventCounterManager counterManager)
|
Method Summary | ||
---|---|---|
void |
automaticallyGrowCounters(boolean autoGrow)
Tell the data to automatically expand the counters if there is a request to count an event that is greater than the current size. |
|
Instruction |
createEventCounterInstruction(int counterNumber)
Create a place holder instruction to represent an increment of a particular counted event. |
|
(package private) Instruction |
createEventCounterInstruction(int counterNumber,
double incrementValue)
Create a place holder instruction to represent the counted event. |
|
double |
getCounter(int counterNumber)
Return the count for the given (relative) index |
|
InstrumentedEventCounterManager |
getCounterManager()
Return the counter manager for this data. |
|
int |
getHandle()
Counter Managers give id's that identify the counter space they have given to each data. |
|
int |
getNumCounters()
Return the number of counters currently allocated for this data |
|
void |
initializeCounters(int countersNeeded)
This method must be called before creating any counters for this data. |
|
(package private) void |
report(CounterNameFunction f)
This method prints the (sorted) nonzero elements a counter array. |
|
void |
resizeCounters(int countersNeeded)
Used to reset the number of counters for this data |
|
void |
setCounter(int counterNumber,
double value)
Set the count for the given index |
|
private void |
sort(Vector<?> v)
Sort a Vector |
|
private
|
swap(Vector<T> vec,
int i,
int j)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int numCounters
protected int handle
protected InstrumentedEventCounterManager counterManager
protected boolean automaticallyGrowCounters
Constructor Detail |
---|
ManagedCounterData(InstrumentedEventCounterManager counterManager)
counterManager
- The counterManager that will provide the counter spaceMethod Detail |
---|
public void initializeCounters(int countersNeeded)
countersNeeded
- How many counters are needed by this datapublic void automaticallyGrowCounters(boolean autoGrow)
autoGrow
- Whether the counters should grow automatically.public void resizeCounters(int countersNeeded)
countersNeeded
- The number of counters neededpublic double getCounter(int counterNumber)
counterNumber
- The event number within the data
public void setCounter(int counterNumber, double value)
counterNumber
- The event number within the datavalue
- The new value of the counterpublic int getNumCounters()
public int getHandle()
public InstrumentedEventCounterManager getCounterManager()
public Instruction createEventCounterInstruction(int counterNumber)
counterNumber
- The number of the counter to increment
Instruction createEventCounterInstruction(int counterNumber, double incrementValue)
counterNumber
- The number of the counter to incrementincrementValue
- The value to add to the given counter
final void report(CounterNameFunction f)
f
- a function that gets the "name" for each counterprivate void sort(Vector<?> v)
Shell sort
Reference: "The C Programming Language", Kernighan & Ritchie, p. 116
private <T> void swap(Vector<T> vec, int i, int j)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |