|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jikesrvm.adaptive.measurements.listeners.Listener
org.jikesrvm.adaptive.measurements.listeners.MethodListener
public final class MethodListener
A MethodListener defines a listener to collect method invocation samples. Samples are collected in a buffer. When sampleSize samples have been collected the listener's organizer is activated to process them. Defines update's interface to be a compiled method identifier, CMID.
| Field Summary | |
|---|---|
(package private) int |
numSamples
Number of samples taken so far |
(package private) int[] |
samples
The sample buffer Key Invariant: samples.length >= sampleSize |
(package private) int |
sampleSize
Number of samples to be gathered before they are processed |
| Constructor Summary | |
|---|---|
MethodListener(int sampleSize)
|
|
| Method Summary | |
|---|---|
int |
getNumSamples()
|
int[] |
getSamples()
|
private void |
recordSample(int CMID)
This method records a sample containing the CMID (compiled method ID) passed. |
void |
report()
Entry point to dump what has been collected. |
void |
reset()
Reset the buffer to prepare to take more samples. |
void |
update(int cmid,
int callerCmid,
int whereFrom)
This method is called when a sample is taken. |
| Methods inherited from class org.jikesrvm.adaptive.measurements.listeners.Listener |
|---|
activate, activateOrganizer, isActive, passivate, setOrganizer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
int sampleSize
int numSamples
int[] samples
| Constructor Detail |
|---|
public MethodListener(int sampleSize)
sampleSize - the initial sampleSize for the listener| Method Detail |
|---|
public void update(int cmid,
int callerCmid,
int whereFrom)
NOTE: There can be multiple threads executing this method at the same time. We attempt to ensure that the resulting race conditions are safely handled, but make no guarentee that every sample is actually recorded.
cmid - the compiled method ID to updatecallerCmid - a compiled method id for the caller, -1 if nonewhereFrom - Was this a yieldpoint in a PROLOGUE, BACKEDGE, or
EPILOGUE?private void recordSample(int CMID)
CMID - compiled method ID to recordpublic void report()
Listener
report in class Listenerpublic void reset()
reset in class Listenerpublic int[] getSamples()
public int getNumSamples()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||