public final class DebugContext extends Object implements AutoCloseable
MetricKeys.
A DebugContext object must only be used on the thread that created it. This means it
needs to be passed around as a parameter. For convenience, it can be encapsulated in a widely
used object that is in scope wherever a DebugContext is needed. However, care must be
taken when such objects can be exposed to multiple threads (e.g., they are in a non-thread-local
cache).| Modifier and Type | Class and Description |
|---|---|
static class |
DebugContext.Activation
An object used to undo the changes made by DebugContext#activate().
|
static class |
DebugContext.Builder
Object used to create a
DebugContext. |
static interface |
DebugContext.CompilerPhaseScope
Scope for a compiler phase event.
|
static class |
DebugContext.Description
Describes the computation associated with a
DebugContext. |
static interface |
DebugContext.Scope
Represents a debug scope entered by
DebugContext.scope(Object) or
DebugContext.sandbox(CharSequence, DebugConfig, Object...). |
| Modifier and Type | Field and Description |
|---|---|
static int |
BASIC_LEVEL
Basic debug level.
|
static int |
DETAILED_LEVEL
Detailed debug level.
|
static String |
DUMP_FILE_MESSAGE_FORMAT
The format of the message printed on the console by
DebugContext.getDumpPath(java.lang.String, boolean) when
DebugOptions.ShowDumpFiles is true. |
static String |
DUMP_FILE_MESSAGE_REGEXP
The regular expression for matching the message derived from
DebugContext.DUMP_FILE_MESSAGE_FORMAT. |
static int |
ENABLED_LEVEL
A special dump level that indicates the dumping machinery is enabled but no dumps will be
produced except through other options.
|
static int |
INFO_LEVEL
Informational debug level.
|
static Iterable<DebugHandlersFactory> |
NO_CONFIG_CUSTOMIZERS |
static DebugContext.Description |
NO_DESCRIPTION |
static GlobalMetrics |
NO_GLOBAL_METRIC_VALUES |
static int |
VERBOSE_LEVEL
Verbose debug level.
|
static int |
VERY_DETAILED_LEVEL
Very detailed debug level.
|
| Modifier and Type | Method and Description |
|---|---|
DebugContext.Activation |
activate()
Activates this object as the debug context for the
current thread.
|
long[] |
addValuesTo(long[] tally)
Gets a tally of the metric values in this context and a given tally.
|
static Map<Object,Object> |
addVersionProperties(Map<Object,Object> properties)
Adds version properties to the provided map.
|
static String |
applyFormattingFlagsAndWidth(String s,
int flags,
int width) |
boolean |
areMetricsEnabled() |
boolean |
areScopesEnabled()
Determines if dynamic scopes are enabled.
|
<G,N,M> GraphOutput<G,M> |
buildOutput(GraphOutput.Builder<G,N,M> builder)
Gets an object for describing a graph and sending it to IGV.
|
void |
close() |
void |
closeDumpHandlers(boolean ignoreErrors) |
Iterable<Object> |
context() |
<T> T |
contextLookup(Class<T> clazz)
Searches the current debug scope, bottom up, for a context object that is an instance of a
given type.
|
<T> T |
contextLookupTopdown(Class<T> clazz)
Searches the current debug scope, top down, for a context object that is an instance of a
given type.
|
<T> List<T> |
contextSnapshot(Class<T> clazz) |
static Object |
convertFormatArg(Object arg) |
static org.graalvm.collections.EconomicMap<MetricKey,Long> |
convertValuesToKeyValueMap(long[] values)
Creates and returns a sorted map from metric names to their values in
values. |
static CounterKey |
counter(CharSequence name)
Creates a counter.
|
static CounterKey |
counter(String format,
Object arg)
Creates a debug counter.
|
static CounterKey |
counter(String format,
Object arg1,
Object arg2)
Creates a debug counter.
|
DebugContext.Scope |
disable()
Disables all metrics and scope related functionality until
close() is called on the
returned object. |
static DebugContext |
disabled(OptionValues options)
Create a DebugContext with debugging disabled.
|
DebugCloseable |
disableIntercept()
Opens a scope in which exception
interception is
disabled.
|
void |
dump(int dumpLevel,
Object object,
String msg) |
void |
dump(int dumpLevel,
Object object,
String format,
Object arg) |
void |
dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2) |
void |
dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3) |
void |
dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4) |
void |
dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5) |
void |
dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6) |
void |
dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7) |
DebugContext.CompilerPhaseScope |
enterCompilerPhase(CharSequence phaseName)
Notifies this object that the compiler is entering a phase.
|
DebugContext.CompilerPhaseScope |
enterCompilerPhase(Supplier<CharSequence> phaseName)
Notifies this object that the compiler is entering a phase.
|
void |
forceDump(Object object,
String format,
Object... args)
Forces an unconditional dump.
|
DebugContext.Scope |
forceLog() |
static DebugContext |
forCurrentThread()
Gets the debug context for the current thread.
|
DebugConfig |
getConfig() |
String |
getCurrentScopeName()
Gets a string composed of the names in the current nesting of debug
scopes separated by
'.'. |
static PrintStream |
getDefaultLogStream() |
DebugContext.Description |
getDescription()
Gets a description of the computation associated with this debug context.
|
String |
getDumpPath(String extension,
boolean createMissingDirectory) |
GlobalMetrics |
getGlobalMetrics()
Gets the global metrics associated with this debug context.
|
Map<MetricKey,Long> |
getMetricsSnapshot() |
OptionValues |
getOptions()
Gets the options this debug context was constructed with.
|
RuntimeException |
handle(Throwable exception)
Handles an exception in the context of the debug scope just exited.
|
boolean |
hasCompilationListener()
|
Indent |
indent()
Opens a new indentation level (by adding some spaces) based on the current indentation level.
|
boolean |
inNestedScope()
Determines if scopes are enabled and this context is in a non-top-level scope.
|
boolean |
isCountEnabled() |
boolean |
isDumpEnabled(int dumpLevel) |
boolean |
isDumpEnabledForMethod() |
boolean |
isLogEnabled() |
boolean |
isLogEnabled(int logLevel) |
boolean |
isLogEnabledForMethod() |
boolean |
isMemUseTrackingEnabled() |
boolean |
isTimeEnabled() |
boolean |
isVerifyEnabled()
Determines if verification is enabled in the current scope.
|
boolean |
isVerifyEnabledForMethod()
Determines if verification is enabled for any
JavaMethod in the current scope. |
void |
log(int logLevel,
String msg)
Prints a message to the current debug scope's logging stream if logging is enabled.
|
void |
log(int logLevel,
String format,
int arg)
Prints a message to the current debug scope's logging stream if logging is enabled.
|
void |
log(int logLevel,
String format,
int arg1,
int arg2) |
void |
log(int logLevel,
String format,
int arg1,
int arg2,
int arg3) |
void |
log(int logLevel,
String format,
int arg1,
Object arg2) |
void |
log(int logLevel,
String format,
Object arg)
Prints a message to the current debug scope's logging stream if logging is enabled.
|
void |
log(int logLevel,
String format,
Object arg1,
int arg2) |
void |
log(int logLevel,
String format,
Object arg1,
Object arg2) |
void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3) |
void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4) |
void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5) |
void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6) |
void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7) |
void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8) |
void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8,
Object arg9) |
void |
log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8,
Object arg9,
Object arg10) |
void |
log(String msg) |
void |
log(String format,
int arg) |
void |
log(String format,
int arg1,
int arg2) |
void |
log(String format,
int arg1,
int arg2,
int arg3) |
void |
log(String format,
int arg1,
Object arg2) |
void |
log(String format,
Object arg) |
void |
log(String format,
Object arg1,
int arg2) |
void |
log(String format,
Object arg1,
Object arg2) |
void |
log(String format,
Object arg1,
Object arg2,
Object arg3) |
void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4) |
void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5) |
void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6) |
void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7) |
void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8) |
void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8,
Object arg9) |
void |
log(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8,
Object arg9,
Object arg10) |
Indent |
logAndIndent(int logLevel,
String msg)
A convenience function which combines
DebugContext.log(String) and DebugContext.indent(). |
Indent |
logAndIndent(int logLevel,
String format,
int arg)
A convenience function which combines
DebugContext.log(String, Object) and DebugContext.indent(). |
Indent |
logAndIndent(int logLevel,
String format,
int arg1,
int arg2) |
Indent |
logAndIndent(int logLevel,
String format,
int arg1,
int arg2,
int arg3) |
Indent |
logAndIndent(int logLevel,
String format,
int arg1,
Object arg2) |
Indent |
logAndIndent(int logLevel,
String format,
Object arg)
A convenience function which combines
DebugContext.log(String, Object) and DebugContext.indent(). |
Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
int arg2) |
Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
int arg2,
int arg3) |
Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2) |
Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3) |
Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4) |
Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5) |
Indent |
logAndIndent(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6) |
Indent |
logAndIndent(String msg) |
Indent |
logAndIndent(String format,
int arg) |
Indent |
logAndIndent(String format,
int arg1,
int arg2) |
Indent |
logAndIndent(String format,
int arg1,
int arg2,
int arg3) |
Indent |
logAndIndent(String format,
int arg1,
Object arg2) |
Indent |
logAndIndent(String format,
Object arg) |
Indent |
logAndIndent(String format,
Object arg1,
int arg2) |
Indent |
logAndIndent(String format,
Object arg1,
int arg2,
int arg3) |
Indent |
logAndIndent(String format,
Object arg1,
Object arg2) |
Indent |
logAndIndent(String format,
Object arg1,
Object arg2,
Object arg3) |
Indent |
logAndIndent(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4) |
Indent |
logAndIndent(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5) |
Indent |
logAndIndent(String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6) |
void |
logv(int logLevel,
String format,
Object... args)
Prints a message to the current debug scope's logging stream.
|
void |
logv(String format,
Object... args) |
Indent |
logvAndIndent(int logLevel,
String format,
Object... args)
A convenience function which combines
DebugContext.logv(int, String, Object...) and
DebugContext.indent(). |
static MemUseTrackerKey |
memUseTracker(CharSequence name)
Creates a memory use tracker.
|
static MemUseTrackerKey |
memUseTracker(String format,
Object arg)
Creates a debug memory use tracker.
|
static MemUseTrackerKey |
memUseTracker(String format,
Object arg1,
Object arg2)
Creates a debug memory use tracker.
|
void |
notifyInlining(ResolvedJavaMethod caller,
ResolvedJavaMethod callee,
boolean succeeded,
CharSequence message,
int bci)
Notifies this object when the compiler considers inlining
callee into caller. |
void |
printMetrics(DebugContext.Description desc)
Prints metric values in this object to the file (if any) specified by
DebugOptions.MetricsFile. |
DebugContext.Scope |
sandbox(CharSequence name,
DebugConfig config,
Object... context)
Creates and enters a new debug scope which will be disjoint from the current debug scope.
|
DebugContext.Scope |
scope(Object name)
Similar to
DebugContext.scope(Object, Object[]) but without context objects. |
DebugContext.Scope |
scope(Object name,
Object context) |
DebugContext.Scope |
scope(Object name,
Object[] contextObjects)
Creates and enters a new debug scope which will be a child of the current debug scope.
|
DebugContext.Scope |
scope(Object name,
Object context1,
Object context2) |
DebugContext.Scope |
scope(Object name,
Object context1,
Object context2,
Object context3) |
static TimerKey |
timer(CharSequence name)
Creates a timer.
|
static TimerKey |
timer(String format,
Object arg)
Creates a debug timer.
|
static TimerKey |
timer(String format,
Object arg1,
Object arg2)
Creates a debug timer.
|
void |
verify(Object object,
String message)
Calls all
DebugVerifyHandlers in the current config to
perform verification on a given object. |
void |
verify(Object object,
String format,
Object arg)
Calls all
DebugVerifyHandlers in the current config to
perform verification on a given object. |
DebugContext.Scope |
withContext(Object context)
Create an unnamed scope that appends some context to the current scope.
|
public static final String DUMP_FILE_MESSAGE_FORMAT
DebugContext.getDumpPath(java.lang.String, boolean) when
DebugOptions.ShowDumpFiles is true. The %s placeholder is replaced with the
absolute path of the dump file (i.e. the value returned by the method).public static final String DUMP_FILE_MESSAGE_REGEXP
DebugContext.DUMP_FILE_MESSAGE_FORMAT.
Keep in sync with the catch_files array in common.json.public static final DebugContext.Description NO_DESCRIPTION
public static final GlobalMetrics NO_GLOBAL_METRIC_VALUES
public static final Iterable<DebugHandlersFactory> NO_CONFIG_CUSTOMIZERS
public static final int ENABLED_LEVEL
public static final int BASIC_LEVEL
public static final int INFO_LEVEL
public static final int VERBOSE_LEVEL
public static final int DETAILED_LEVEL
public static final int VERY_DETAILED_LEVEL
public static PrintStream getDefaultLogStream()
public boolean areScopesEnabled()
public <G,N,M> GraphOutput<G,M> buildOutput(GraphOutput.Builder<G,N,M> builder) throws IOException
IOExceptionpublic static Map<Object,Object> addVersionProperties(Map<Object,Object> properties)
properties map are prefixed with
"version." prefix.properties - map to add the version properties to or nullproperties with version properties added or an unmodifiable map containing
the version properties if properties == nullpublic OptionValues getOptions()
public DebugContext.Activation activate()
DebugContext.Activation.close() is called on itpublic static DebugContext disabled(OptionValues options)
public static DebugContext forCurrentThread()
public DebugContext.Description getDescription()
null if no description is availablepublic boolean hasCompilationListener()
DebugContext.enterCompilerPhase(java.lang.CharSequence) and DebugContext.notifyInlining(ResolvedJavaMethod, ResolvedJavaMethod, boolean, java.lang.CharSequence, int) do anything.true if there is a listener for compiler phase and inlining events attached
to this object, false otherwisepublic DebugContext.CompilerPhaseScope enterCompilerPhase(CharSequence phaseName)
phaseName - name of the phase being enterednull if DebugContext.hasCompilationListener() returns false otherwise an
object whose DebugContext.CompilerPhaseScope.close() method must be called when the phase
endspublic DebugContext.CompilerPhaseScope enterCompilerPhase(Supplier<CharSequence> phaseName)
phaseName - name of the phase being enterednull if DebugContext.hasCompilationListener() returns false otherwise an
object whose DebugContext.CompilerPhaseScope.close() method must be called when the phase
endspublic void notifyInlining(ResolvedJavaMethod caller,
ResolvedJavaMethod callee,
boolean succeeded,
CharSequence message,
int bci)
callee into caller.
A call to this method should be guarded with DebugContext.hasCompilationListener() if
message is not a string literal or pre-computed valuecaller - caller methodcallee - callee method considered for inlining into callersucceeded - true if callee was inlined into callermessage - extra information about inlining decisionbci - byte code index of call sitepublic GlobalMetrics getGlobalMetrics()
null if no global metrics are availablepublic boolean isDumpEnabled(int dumpLevel)
public boolean isVerifyEnabledForMethod()
JavaMethod in the current scope.DebugContext.verify(Object, String)public boolean isVerifyEnabled()
DebugContext.verify(Object, String)public boolean isCountEnabled()
public boolean isTimeEnabled()
public boolean isMemUseTrackingEnabled()
public boolean isDumpEnabledForMethod()
public boolean isLogEnabledForMethod()
public boolean isLogEnabled()
public boolean isLogEnabled(int logLevel)
public String getCurrentScopeName()
'.'.public DebugContext.Scope scope(Object name, Object[] contextObjects) throws Throwable
It is recommended to use the try-with-resource statement for managing entering and leaving debug scopes. For example:
try (Scope s = Debug.scope("InliningGraph", inlineeGraph)) {
...
} catch (Throwable e) {
throw Debug.handle(e);
}
The name argument is subject to the following type based conversion before having
Object.toString() called on it:
Type | Conversion
------------------+-----------------
java.lang.Class | arg.getSimpleName()
|
name - the name of the new scopecontextObjects - an array of object to be appended to the current debug contextDebugContext.Scope.close()
method is calledThrowable - used to enforce a catch block.public DebugContext.Scope scope(Object name)
DebugContext.scope(Object, Object[]) but without context objects. Therefore the catch
block can be omitted.DebugContext.scope(Object, Object[])public DebugContext.Scope scope(Object name, Object context) throws Throwable
context - an object to be appended to the current debug contextThrowableDebugContext.scope(Object, Object[])public DebugContext.Scope scope(Object name, Object context1, Object context2) throws Throwable
context1 - first object to be appended to the current debug
contextcontext2 - second object to be appended to the current debug
contextThrowableDebugContext.scope(Object, Object[])public DebugContext.Scope scope(Object name, Object context1, Object context2, Object context3) throws Throwable
context1 - first object to be appended to the current debug
contextcontext2 - second object to be appended to the current debug
contextcontext3 - third object to be appended to the current debug
contextThrowableDebugContext.scope(Object, Object[])public DebugContext.Scope withContext(Object context) throws Throwable
public DebugContext.Scope sandbox(CharSequence name, DebugConfig config, Object... context) throws Throwable
It is recommended to use the try-with-resource statement for managing entering and leaving debug scopes. For example:
try (Scope s = Debug.sandbox("CompilingStub", null, stubGraph)) {
...
} catch (Throwable e) {
throw Debug.handle(e);
}
name - the name of the new scopeconfig - the debug configuration to use for the new scope or null to disable the
scoping mechanism within the sandbox scopecontext - objects to be appended to the current debug contextDebugContext.Scope.close()
method is calledThrowablepublic boolean inNestedScope()
public DebugContext.Scope disable()
close() is called on the
returned object.public DebugContext.Scope forceLog() throws Throwable
Throwablepublic DebugCloseable disableIntercept()
DebugCloseable.close()
is called on the returned object.
This is particularly useful to suppress extraneous output in JUnit tests that are expected to
throw an exception.public RuntimeException handle(Throwable exception)
DebugContext.scope(Object) and
DebugContext.sandbox(CharSequence, DebugConfig, Object...) is usedpublic void log(String msg)
public void log(int logLevel,
String msg)
msg - the message to logpublic void log(int logLevel,
String format,
Object arg)
format - a format stringarg - the argument referenced by the format specifiers in formatpublic void log(String format, int arg)
public void log(int logLevel,
String format,
int arg)
format - a format stringarg - the argument referenced by the format specifiers in formatpublic void log(int logLevel,
String format,
Object arg1,
Object arg2)
DebugContext.log(int, String, Object)public void log(int logLevel,
String format,
int arg1,
Object arg2)
DebugContext.log(int, String, Object)public void log(int logLevel,
String format,
Object arg1,
int arg2)
DebugContext.log(int, String, Object)public void log(String format, int arg1, int arg2)
public void log(int logLevel,
String format,
int arg1,
int arg2)
DebugContext.log(int, String, Object)public void log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3)
DebugContext.log(int, String, Object)public void log(String format, int arg1, int arg2, int arg3)
public void log(int logLevel,
String format,
int arg1,
int arg2,
int arg3)
DebugContext.log(int, String, Object)public void log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
DebugContext.log(int, String, Object)public void log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
DebugContext.log(int, String, Object)public void log(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
public void log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6)
DebugContext.log(int, String, Object)public void log(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7)
public void log(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8)
public void log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7)
DebugContext.log(int, String, Object)public void log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8)
public void log(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9)
public void log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8,
Object arg9)
public void log(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10)
public void log(int logLevel,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7,
Object arg8,
Object arg9,
Object arg10)
public void logv(int logLevel,
String format,
Object... args)
log() methods in this
class that take a fixed number of parameters.format - a format stringargs - the arguments referenced by the format specifiers in formatpublic void forceDump(Object object, String format, Object... args)
public void dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3)
public void dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
public void dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
public void dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6)
public void dump(int dumpLevel,
Object object,
String format,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6,
Object arg7)
public void verify(Object object, String message)
DebugVerifyHandlers in the current config to
perform verification on a given object.object - object to verifymessage - description of verification contextDebugVerifyHandler.verify(org.graalvm.compiler.debug.DebugContext, java.lang.Object, java.lang.String, java.lang.Object...)public void verify(Object object, String format, Object arg)
DebugVerifyHandlers in the current config to
perform verification on a given object.object - object to verifyformat - a format string for the description of the verification contextarg - the argument referenced by the format specifiers in formatDebugVerifyHandler.verify(org.graalvm.compiler.debug.DebugContext, java.lang.Object, java.lang.String, java.lang.Object...)public Indent indent()
DebugContext.logAndIndent(int, String),
DebugContext.logAndIndent(int, String, Object)public Indent logAndIndent(int logLevel, String msg)
DebugContext.log(String) and DebugContext.indent().msg - the message to logpublic Indent logAndIndent(int logLevel, String format, Object arg)
DebugContext.log(String, Object) and DebugContext.indent().format - a format stringarg - the argument referenced by the format specifiers in formatpublic Indent logAndIndent(int logLevel, String format, int arg)
DebugContext.log(String, Object) and DebugContext.indent().format - a format stringarg - the argument referenced by the format specifiers in formatpublic Indent logAndIndent(int logLevel, String format, Object arg1, Object arg2, Object arg3)
public Indent logAndIndent(int logLevel, String format, Object arg1, int arg2, int arg3)
public Indent logAndIndent(String format, Object arg1, Object arg2, Object arg3, Object arg4)
public Indent logAndIndent(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4)
public Indent logAndIndent(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
public Indent logAndIndent(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5)
public Indent logAndIndent(String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
public Indent logAndIndent(int logLevel, String format, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6)
public Indent logvAndIndent(int logLevel, String format, Object... args)
DebugContext.logv(int, String, Object...) and
DebugContext.indent().format - a format stringargs - the arguments referenced by the format specifiers in formatpublic <T> T contextLookup(Class<T> clazz)
public <T> T contextLookupTopdown(Class<T> clazz)
public static MemUseTrackerKey memUseTracker(CharSequence name)
public static MemUseTrackerKey memUseTracker(String format, Object arg)
Debug.memUseTracker(format, arg, null)except that the string formatting only happens if mem tracking is enabled.
public static MemUseTrackerKey memUseTracker(String format, Object arg1, Object arg2)
Debug.memUseTracker(String.format(format, arg1, arg2))except that the string formatting only happens if memory use tracking is enabled. In addition, each argument is subject to the following type based conversion before being passed as an argument to
String.format(String, Object...):
Type | Conversion
------------------+-----------------
java.lang.Class | arg.getSimpleName()
|
DebugContext.memUseTracker(CharSequence)public static CounterKey counter(CharSequence name)
public long[] addValuesTo(long[] tally)
tally - the tally to which the metrics should be addedtally. This will be
tally if this context has no metric values or tally is wide enough to
hold all the metric values in this context otherwise it will be a new array.public static org.graalvm.collections.EconomicMap<MetricKey,Long> convertValuesToKeyValueMap(long[] values)
values.values - values for metrics in the KeyRegistry.public static String applyFormattingFlagsAndWidth(String s, int flags, int width)
public static CounterKey counter(String format, Object arg)
Debug.counter(format, arg, null)except that the string formatting only happens if count is enabled.
public static CounterKey counter(String format, Object arg1, Object arg2)
Debug.counter(String.format(format, arg1, arg2))except that the string formatting only happens if count is enabled. In addition, each argument is subject to the following type based conversion before being passed as an argument to
String.format(String, Object...):
Type | Conversion
------------------+-----------------
java.lang.Class | arg.getSimpleName()
|
DebugContext.counter(CharSequence)public DebugConfig getConfig()
public static TimerKey timer(CharSequence name)
A disabled timer has virtually no overhead.
public static TimerKey timer(String format, Object arg)
Debug.timer(format, arg, null)except that the string formatting only happens if timing is enabled.
public static TimerKey timer(String format, Object arg1, Object arg2)
Debug.timer(String.format(format, arg1, arg2))except that the string formatting only happens if timing is enabled. In addition, each argument is subject to the following type based conversion before being passed as an argument to
String.format(String, Object...):
Type | Conversion
------------------+-----------------
java.lang.Class | arg.getSimpleName()
|
DebugContext.timer(CharSequence)public boolean areMetricsEnabled()
public void close()
close in interface AutoCloseablepublic void closeDumpHandlers(boolean ignoreErrors)
public void printMetrics(DebugContext.Description desc)
DebugOptions.MetricsFile.