public final class AOSLogging extends Object
Right now this is fairly primitive, an evolving number of events are defined and log entries are quite unsophisticated.
Some obvious TODO items:
NOTE: All code that writes to the log is synchronized on the PrintStream object to avoid interspersed messages, which can happen when the compilation thread and the controller thread try to log a message "at the same time".
The current logging levels are:
Modifier and Type | Field and Description |
---|---|
private boolean |
booted |
private PrintStream |
log |
static AOSLogging |
logger
Singleton instance of the logger
|
Constructor and Description |
---|
AOSLogging() |
Modifier and Type | Method and Description |
---|---|
void |
boot()
Called from ControllerThread.run to initialize the logging subsystem
|
boolean |
booted() |
void |
compileAllMethodsCompleted() |
void |
controllerNotifiedForHotness(CompiledMethod hotMethod,
double numSamples)
This method logs that the controller is notified of a
candidate to be recompiled due to hotness;
i.e., the method has been inserted in the controller queue.
|
void |
debug(String s) |
void |
decayingCounters()
This method logs when the decay organizer runs.
|
void |
decayStatistics(int decayCount)
Call this method to dump statistics related to decaying
|
PrintStream |
getLog() |
private String |
getTime() |
void |
logOsrEvent(String s) |
void |
oldVersionStillHot(HotMethodEvent hme)
this method logs the event when the controller discovers a method that has
been recompiled and the previous version is still regarded as hot,
i.e., still on the stack and significant.
|
void |
onStackReplacementAborted(CompilationPlan plan) |
void |
onStackReplacementCompleted(CompilationPlan plan) |
void |
onStackReplacementStarted(CompilationPlan plan) |
void |
organizerThresholdReached()
This Method logs when the organizer thread has reached its
sampling threshold
|
void |
printControllerStats()
Dumps lots of controller statistics to the log file
|
void |
recompilationAborted(CompilationPlan plan)
This method logs the abortion of an adaptively selected recompilation
|
void |
recompilationCompleted(CompilationPlan plan)
This method logs the successful completion of an adaptively
selected recompilation
|
void |
recompilationScheduled(CompilationPlan plan,
double priority)
This method logs the scheduling of a recompilation,
i.e., it being inserted in the compilation queue.
|
void |
recompilationStarted(CompilationPlan plan)
This method logs the beginning of an adaptively selected recompilation
|
void |
recompilingAllDynamicallyLoadedMethods()
Call this method when one run of the application begins
|
void |
recordCompileTime(CompiledMethod cm,
double expectedCompilationTime)
This method logs the actual compilation time for the given compiled method.
|
void |
recordControllerEstimateCostDoNothing(RVMMethod method,
int optLevel,
double cost)
This method logs a controller cost estimate for doing nothing.
|
void |
recordControllerEstimateCostOpt(RVMMethod method,
String choiceDesc,
double compilationTime,
double futureTime)
This method logs a controller cost estimate.
|
void |
recordOSRRecompilationDecision(ControllerPlan plan)
This method logs the successful completion of an adaptively
selected recompilation
|
void |
recordUpdatedCompilationRates(byte compiler,
RVMMethod method,
int BCLength,
int totalBCLength,
int MCLength,
int totalMCLength,
double compTime,
double totalCompTime,
double totalLogOfRates,
int totalLogValueMethods,
int totalMethods)
Records lots of details about the online computation of a compilation rate
|
void |
reportBenefitRatio(int compiler1,
int compiler2,
double rate)
This method reports the benefit ratio from one compiler to the other
|
void |
reportCompilationRate(int compiler,
double rate)
This method reports the basic compilation rate for a compiler
|
void |
reportCompileTimeRatio(int compiler1,
int compiler2,
double rate)
This method reports the compile time ratio from one compiler to
the other
|
void |
reportSpeedupRate(int compiler,
double rate)
This method reports the basic speedup rate for a compiler
|
public static final AOSLogging logger
private PrintStream log
private boolean booted
public AOSLogging()
public PrintStream getLog()
public boolean booted()
public void boot()
public void decayStatistics(int decayCount)
decayCount
- the number of decay eventspublic void recompilingAllDynamicallyLoadedMethods()
public void printControllerStats()
public void reportSpeedupRate(int compiler, double rate)
compiler
- the compiler you are reporting aboutrate
- the speedup ratepublic void reportCompilationRate(int compiler, double rate)
compiler
- the compiler you are reporting aboutrate
- the compilation rate (bytecodes per millisecond)public void reportBenefitRatio(int compiler1, int compiler2, double rate)
compiler1
- the first compilercompiler2
- the second compilerrate
- the improvement from going from a compiler1-compiled method
to a compiler2-compiled methodpublic void reportCompileTimeRatio(int compiler1, int compiler2, double rate)
compiler1
- the first compilercompiler2
- the second compilerrate
- the ratio of compiler1 compilation rate to
compiler2 compilation ratepublic void recompilationScheduled(CompilationPlan plan, double priority)
plan
- the Compilation plan being executed.priority
- a number from 0.0 to 1.0 encoding the plan's priority.public void recompilationStarted(CompilationPlan plan)
plan
- the Compilation plan being executed.public void recompilationCompleted(CompilationPlan plan)
plan
- the Compilation plan being executed.public void recompilationAborted(CompilationPlan plan)
plan
- the Compilation plan being executed.public void recordCompileTime(CompiledMethod cm, double expectedCompilationTime)
cm
- the compiled methodexpectedCompilationTime
- the model-derived expected compilation timepublic void oldVersionStillHot(HotMethodEvent hme)
hme
- the hot method event of the method that was recompiledpublic void decayingCounters()
public void organizerThresholdReached()
public void controllerNotifiedForHotness(CompiledMethod hotMethod, double numSamples)
hotMethod
- method to be recompiled, andnumSamples
- number of samples attributed to the methodpublic void recordControllerEstimateCostDoNothing(RVMMethod method, int optLevel, double cost)
method
- the method of interestoptLevel
- the opt level being estimated, -1 = baselinecost
- the computed cost for this method and levelpublic void recordControllerEstimateCostOpt(RVMMethod method, String choiceDesc, double compilationTime, double futureTime)
method
- the method of interestchoiceDesc
- a String describing the choice pointcompilationTime
- the computed compilation cost for this method and levelfutureTime
- the computed future time, including cost and executionpublic void recordUpdatedCompilationRates(byte compiler, RVMMethod method, int BCLength, int totalBCLength, int MCLength, int totalMCLength, double compTime, double totalCompTime, double totalLogOfRates, int totalLogValueMethods, int totalMethods)
compiler
- compiler of interestmethod
- the methodBCLength
- the number of bytecodestotalBCLength
- cumulative number of bytecodesMCLength
- size of machine codetotalMCLength
- cumulative size of machine codecompTime
- compilation time for this methodtotalCompTime
- cumulative compilation time for this methodtotalLogOfRates
- running sum of the natural logs of the ratestotalLogValueMethods
- number of methods used in the log of ratestotalMethods
- total number of methodspublic void compileAllMethodsCompleted()
public void recordOSRRecompilationDecision(ControllerPlan plan)
plan
- the Compilation plan being executed.public void onStackReplacementStarted(CompilationPlan plan)
public void onStackReplacementCompleted(CompilationPlan plan)
public void onStackReplacementAborted(CompilationPlan plan)
public void logOsrEvent(String s)