public class EdgeListener extends ContextListener
Defines update's interface.
EdgeListener communicates with an organizer through a integer array, buffer. Each time this listener is called, it places a triple of integers in buffer that correspond to the callee, caller, and machine code offset of the call site
Modifier and Type | Field and Description |
---|---|
private int[] |
buffer
buffer provides the communication channel between the listener and the
organizer.
|
protected static boolean |
DEBUG |
private int |
desiredSamples
Number of samples to be taken before issuing callback to controller
|
protected int |
samplesTaken
Number of samples taken so far
|
protected int |
updateCalled
Number of times update is called
|
Constructor and Description |
---|
EdgeListener()
Constructor
|
Modifier and Type | Method and Description |
---|---|
(package private) int |
getTimesUpdateCalled() |
void |
report()
No-op.
|
void |
reset()
Reset the listeners data structures in preparation of a new sampling
window.
|
private void |
resetBuffer()
Reset the buffer
|
void |
setBuffer(int[] buffer)
Setup buffer and buffer size.
|
void |
update(Address sfp,
int whereFrom)
This method is called when a call stack edge needs to be
sampled.
|
activate, activateOrganizer, isActive, passivate, setOrganizer
protected static final boolean DEBUG
private int[] buffer
private int desiredSamples
protected int samplesTaken
protected int updateCalled
public EdgeListener()
int getTimesUpdateCalled()
public void setBuffer(int[] buffer)
buffer
- the allocated buffer to contain the samples, size should
be a muliple of 3public final void update(Address sfp, int whereFrom)
NOTE: This method is uninterruptible, therefore we don't need to disable thread switching during stackframe inspection.
update
in class ContextListener
sfp
- a pointer to the stack frame that corresponds to the callee of
the call graph edge that is to be sampled.whereFrom
- Was this a yieldpoint in a PROLOGUE, BACKEDGE, or
EPILOGUE?public void reset()
Listener
private void resetBuffer()