|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.uka.ipd.sdq.ByCounter.instrumentation.InstrumentationParameters
public final class InstrumentationParameters
A collection of properties that determine the way the instrumentation is done.
Some combination of parameters only make sense in combination with others. The following list summarizes these dependencies.
setWriteClassesToDiskDirectory(File)
only applies if getWriteClassesToDisk()
== truesetRecordBlockExecutionOrder(boolean)
only applies if either range blocks or basic blocks are used, i.e. if getUseBasicBlocks()
== truesetUseArrayParameterRecording(boolean)
is currently only supported when not using basic/range blocks.
Constructor Summary | |
---|---|
InstrumentationParameters()
This is intended only for construction in multiple steps. |
|
InstrumentationParameters(java.util.List<MethodDescriptor> pMethodsToInstrument)
Assumes dynamic analysis and usage of the CountingResultCollector. |
|
InstrumentationParameters(java.util.List<MethodDescriptor> pMethodsToInstrument,
boolean pUseHighRegistersForCounting,
boolean pUseResultCollector,
boolean pUseArrayParameterRecording,
boolean countStatically,
InstrumentationCounterPrecision counterPrecision)
|
Method Summary | |
---|---|
InstrumentationParameters |
clone()
|
void |
disableResultLogWriter()
Disable result log writing. |
void |
enableResultLogWriter(java.lang.String resultLogFileName)
Enable writing of result logs and set the filename for the log that is created. |
InstrumentationCounterPrecision |
getCounterPrecision()
|
boolean |
getCountStatically()
Deprecated. Static counting is implemented only in it's basics (opcode and method call counts). It is not a focus of ByCounter. |
java.lang.String[] |
getIgnoredPackagePrefixes()
|
InstrumentationScopeModeEnum |
getInstrumentationScopeOverrideClassLevel()
|
InstrumentationScopeModeEnum |
getInstrumentationScopeOverrideMethodLevel()
|
boolean |
getInstrumentRecursively()
|
int |
getInstrumentRecursivelyMaxDepth()
|
java.util.List<MethodDescriptor> |
getMethodsToInstrument()
|
boolean |
getProvideOnlineSectionExecutionUpdates()
CountingResultCollector provides a mechanism for monitoring
online updates on incoming results. |
boolean |
getRecordBlockExecutionOrder()
When true, record the exact order in which blocks are executed. |
java.lang.String |
getResultLogFileName()
|
boolean |
getTraceAndIdentifyRequests()
RequestIDs are UUIDs used to track the method call graph across threads. |
boolean |
getUseArrayParameterRecording()
Decides whether instrumentation for the recording of parameters of array construction takes place. |
boolean |
getUseBasicBlocks()
When true, bytecode instructions will be counted in groups made up of identified basic blocks. |
boolean |
getUseHighRegistersForCounting()
|
boolean |
getUseResultCollector()
|
boolean |
getUseResultLogWriter()
|
boolean |
getWriteClassesToDisk()
When true, ByCounter will write the instrumented class files to the "bin_instrumented" directory. |
java.io.File |
getWriteClassesToDiskDirectory()
|
boolean |
hasMethodsWithCodeAreas()
|
void |
setCounterPrecision(InstrumentationCounterPrecision counterPrecision)
|
void |
setCountStatically(boolean countStatically)
Deprecated. Static counting is implemented only in it's basics (opcode and method call counts). It is not a focus of ByCounter. |
static void |
setIgnoredPackagePrefixes(java.lang.String[] ignoredPackagePrefixes)
|
void |
setInstrumentationScopeOverrideClassLevel(InstrumentationScopeModeEnum instrumentationScopeOverrideClassLevel)
|
void |
setInstrumentationScopeOverrideMethodLevel(InstrumentationScopeModeEnum instrumentationScopeOverrideMethodLevel)
|
void |
setInstrumentRecursively(boolean instrumentRecursively)
When set, instruments methods called from the setMethodsToInstrument(List) that
are not Java API methods (packages java.*, javax.* sun.*) and not
native methods. |
void |
setInstrumentRecursively(boolean instrumentRecursively,
int maxDepth)
|
void |
setMethodsToInstrument(java.util.List<MethodDescriptor> methodsToInstrument)
|
void |
setProvideOnlineSectionExecutionUpdates(boolean provideOnlineSectionExecutionUpdates)
|
void |
setRecordBlockExecutionOrder(boolean recordBlockExecutionOrder)
|
void |
setTraceAndIdentifyRequests(boolean traceAndIdentifyRequests)
RequestIDs are UUIDs used to track the method call graph across threads. |
void |
setUseArrayParameterRecording(boolean useArrayParameterRecording)
Decides whether instrumentation for the recording of parameters of array construction takes place. |
void |
setUseBasicBlocks(boolean useBasicBlocks)
When true, bytecode instructions will be counted in groups made up of identified basic blocks. |
void |
setUseHighRegistersForCounting(boolean useHighRegistersForCounting)
Decides whether to preallocate registers near max_locals instead of using LocalVariablesSorter. |
void |
setUseResultCollector(boolean useResultCollector)
|
void |
setWriteClassesToDisk(boolean write)
Sets the value of writeClassesToDisk. |
void |
setWriteClassesToDiskDirectory(java.io.File outputClassDirectory)
If getWriteClassesToDisk() is enabled, classes will be written
to the here specified directory. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] IGNORED_PACKAGES_DEFAULT
getIgnoredPackagePrefixes()
.
public static final boolean USE_BASIC_BLOCKS_DEFAULT
getUseBasicBlocks()
:
false
public static final boolean RECORD_BLOCK_EXECUTION_ORDER_DEFAULT
getRecordBlockExecutionOrder()
:
true
public static final InstrumentationScopeModeEnum INSTRUMENTATION_SCOPE_OVERRIDE_CLASS_LEVEL_DEFAULT
getInstrumentationScopeOverrideClassLevel()
.
public static final InstrumentationScopeModeEnum INSTRUMENTATION_SCOPE_OVERRIDE_METHOD_LEVEL_DEFAULT
getInstrumentationScopeOverrideMethodLevel()
.
public static final java.io.File WRITE_CLASSES_TO_DISK_DIRECTORY_DEFAULT
getWriteClassesToDiskDirectory()
.
public static final boolean TRACE_AND_IDENTIFY_REQUESTS_DEFAULT
getTraceAndIdentifyRequests()
.
public static final boolean WRITE_CLASSES_TO_DISK_DEFAULT
getWriteClassesToDisk()
.
public static final boolean INSTRUMENT_RECURSIVELY_DEFAULT
getInstrumentRecursively()
.
public static final int INSTRUMENT_RECURSIVELY_MAX_DEPTH_DEFAULT
getInstrumentRecursivelyMaxDepth()
.
public static final java.util.List<MethodDescriptor> METHODS_TO_INSTRUMENT_DEFAULT
getMethodsToInstrument()
.
public static final boolean USE_HIGH_REGISTERS_FOR_COUNTING_DEFAULT
getUseHighRegistersForCounting()
.
public static final boolean USE_RESULT_COLLECTOR_DEFAULT
getUseResultCollector()
.
public static final boolean USE_RESULT_LOG_WRITER_DEFAULT
getUseResultLogWriter()
.
public static final boolean USE_ARRAY_PARAMETER_RECORDING
getUseArrayParameterRecording()
.
public static final boolean COUNT_STATICALLY_DEFAULT
getCountStatically()
.
public static final java.lang.String RESULT_LOG_DEFAULT_DIRECTORY
getUseResultCollector()
== true
.
RESULT_LOG_DEFAULT_PREFIX
,
Constant Field Valuespublic static final java.lang.String RESULT_LOG_DEFAULT_PREFIX
getUseResultCollector()
== true
.
RESULT_LOG_DEFAULT_DIRECTORY
Constructor Detail |
---|
public InstrumentationParameters()
public InstrumentationParameters(java.util.List<MethodDescriptor> pMethodsToInstrument)
pMethodsToInstrument
- Name of the methods that shall be instrumented.
When false, results are written to disk directly.public InstrumentationParameters(java.util.List<MethodDescriptor> pMethodsToInstrument, boolean pUseHighRegistersForCounting, boolean pUseResultCollector, boolean pUseArrayParameterRecording, boolean countStatically, InstrumentationCounterPrecision counterPrecision)
pMethodsToInstrument
- Name of the methods that shall be instrumented.pUseHighRegistersForCounting
- Decides whether to preallocate registers near max_locals instead of using LocalVariablesSorter.pUseResultCollector
- Decides whether to use the CountingResultCollector framework.pUseArrayParameterRecording
- Decides whether instrumentation for the recording of parameters of array construction takes place. Causes some additional overhead.countStatically
- When true, ByCounter makes a static analysis of the specified code.counterPrecision
- Decides on the precision of the variables used
for counting. See the COUNTER_PRECISION_ constants.Method Detail |
---|
public InstrumentationParameters clone()
clone
in class java.lang.Object
public boolean getCountStatically()
public boolean getInstrumentRecursively()
setInstrumentRecursively(boolean)
.public java.util.List<MethodDescriptor> getMethodsToInstrument()
MethodDescriptor
.public java.lang.String getResultLogFileName()
getUseResultLogWriter()
== true.
The given filename is a prefix to the generated filename that includes
the method descriptor and a timestamp.enableResultLogWriter(String)
,
getUseResultLogWriter()
public boolean getUseArrayParameterRecording()
public boolean getUseHighRegistersForCounting()
public boolean getUseResultCollector()
CountingResultCollector
.public boolean getUseResultLogWriter()
public boolean getWriteClassesToDisk()
public void setCountStatically(boolean countStatically)
countStatically
- When true, no runtime analysis is done. Instead the
method is statically analysed.public void setMethodsToInstrument(java.util.List<MethodDescriptor> methodsToInstrument)
methodsToInstrument
- Sets the methods to instrument described as MethodDescriptor
.public void enableResultLogWriter(java.lang.String resultLogFileName)
RESULT_LOG_DEFAULT_PREFIX
that consists of a time stamp and the class and method name,
and will be written to
the RESULT_LOG_DEFAULT_DIRECTORY
directory.
The given filename is a prefix to the generated filename that includes
the method descriptor and a timestamp.
resultLogFileName
- The prefix of written log files.public void disableResultLogWriter()
enableResultLogWriter(String)
,
setUseResultCollector(boolean)
public void setUseArrayParameterRecording(boolean useArrayParameterRecording)
useArrayParameterRecording
- Set to true if recording is to be inserted, false otherwise.public void setUseHighRegistersForCounting(boolean useHighRegistersForCounting)
useHighRegistersForCounting
- Defaults to false.public void setUseResultCollector(boolean useResultCollector)
useResultCollector
- Set whether to use the
CountingResultCollector
.getUseResultCollector()
,
getUseResultLogWriter()
,
enableResultLogWriter(String)
,
disableResultLogWriter()
public void setWriteClassesToDisk(boolean write)
write
- The new value for writeClassesToDisk.public java.lang.String toString()
toString
in class java.lang.Object
public void setUseBasicBlocks(boolean useBasicBlocks)
useBasicBlocks
- the useBasicBlocks to setpublic boolean getUseBasicBlocks()
public void setTraceAndIdentifyRequests(boolean traceAndIdentifyRequests)
traceAndIdentifyRequests
- True, when request IDs are to be used.
False otherwise.
Default is false.public boolean getTraceAndIdentifyRequests()
public void setWriteClassesToDiskDirectory(java.io.File outputClassDirectory)
getWriteClassesToDisk()
is enabled, classes will be written
to the here specified directory.
outputClassDirectory
- The directory where instrumented class files
will be written to.public java.io.File getWriteClassesToDiskDirectory()
getWriteClassesToDisk()
is enabled, classes will be written
to the here specified directory.public void setInstrumentationScopeOverrideClassLevel(InstrumentationScopeModeEnum instrumentationScopeOverrideClassLevel)
instrumentationScopeOverrideClassLevel
- the instrumentationScopeOverrideClassLevel to setpublic InstrumentationScopeModeEnum getInstrumentationScopeOverrideClassLevel()
public void setInstrumentationScopeOverrideMethodLevel(InstrumentationScopeModeEnum instrumentationScopeOverrideMethodLevel)
instrumentationScopeOverrideMethodLevel
- the instrumentationScopeOverrideMethodLevel to setpublic InstrumentationScopeModeEnum getInstrumentationScopeOverrideMethodLevel()
public java.lang.String[] getIgnoredPackagePrefixes()
public InstrumentationCounterPrecision getCounterPrecision()
InstrumentationCounterPrecision
public void setCounterPrecision(InstrumentationCounterPrecision counterPrecision)
counterPrecision
- The precision to set.InstrumentationCounterPrecision
public void setInstrumentRecursively(boolean instrumentRecursively)
setMethodsToInstrument(List)
that
are not Java API methods (packages java.*, javax.* sun.*) and not
native methods.
Recursion will stop when getInstrumentRecursivelyMaxDepth()
is
reached.
instrumentRecursively
- When true, the above aplies.
specified for instrumentation (@see setMethodsToInstrument(java.util.List)
).public void setInstrumentRecursively(boolean instrumentRecursively, int maxDepth)
setInstrumentRecursively(boolean)
public int getInstrumentRecursivelyMaxDepth()
setInstrumentRecursively(boolean)
public static void setIgnoredPackagePrefixes(java.lang.String[] ignoredPackagePrefixes)
ignoredPackagePrefixes
- Prefixes of packages that are ignored.getIgnoredPackagePrefixes()
public void setRecordBlockExecutionOrder(boolean recordBlockExecutionOrder)
recordBlockExecutionOrder
- the recordBlockExecutionOrder to setgetRecordBlockExecutionOrder()
public boolean getRecordBlockExecutionOrder()
CountingResultCollector
then reflects the execution order.
If this flag is set to false, the execution counts for each section are
aggregated.
Note that enabling this option may result in memory and processing overhead if the instrumented code contains sections that are executed extremely often.
public boolean getProvideOnlineSectionExecutionUpdates()
CountingResultCollector
provides a mechanism for monitoring
online updates on incoming results.
getRecordBlockExecutionOrder()
is also set to true.Observable.addObserver(java.util.Observer)
public void setProvideOnlineSectionExecutionUpdates(boolean provideOnlineSectionExecutionUpdates)
provideOnlineSectionExecutionUpdates
- When true, instrumentation
for providing updates is added.getRecordBlockExecutionOrder()
,
getProvideOnlineSectionExecutionUpdates()
public boolean hasMethodsWithCodeAreas()
MethodDescriptor.setCodeAreasToInstrument(LineNumberRange[])
method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |