From 38380b7689e2867031c41f8fcdc924c2c896fd2f Mon Sep 17 00:00:00 2001 From: Martin Entlicher Date: Thu, 28 Mar 2019 16:34:43 +0100 Subject: [PATCH] [GR-14328] Mark the stable options in inspector and profiler. --- .../instrument/InspectorInstrument.java | 22 +++++----- .../tools/profiler/impl/CPUSamplerCLI.java | 44 +++++++++++-------- .../tools/profiler/impl/CPUTracerCLI.java | 37 +++++++++------- 3 files changed, 59 insertions(+), 44 deletions(-) diff --git a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/instrument/InspectorInstrument.java b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/instrument/InspectorInstrument.java index 719c4c8d8df5..14510f90c137 100644 --- a/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/instrument/InspectorInstrument.java +++ b/tools/src/com.oracle.truffle.tools.chromeinspector/src/com/oracle/truffle/tools/chromeinspector/instrument/InspectorInstrument.java @@ -44,6 +44,7 @@ import org.graalvm.options.OptionDescriptor; import org.graalvm.options.OptionDescriptors; import org.graalvm.options.OptionKey; +import org.graalvm.options.OptionStability; import org.graalvm.options.OptionType; import org.graalvm.options.OptionValues; import org.graalvm.polyglot.io.MessageEndpoint; @@ -154,25 +155,26 @@ private static URI createURIFromPath(String path) throws URISyntaxException { } } - @com.oracle.truffle.api.Option(name = "", help = "Start the Chrome inspector on [[host:]port]. (default: :" + DEFAULT_PORT + ")", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(name = "", help = "Start the Chrome inspector on [[host:]port]. (default: :" + DEFAULT_PORT + + ")", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey Inspect = new OptionKey<>(DEFAULT_ADDRESS, ADDRESS_OR_BOOLEAN); @com.oracle.truffle.api.Option(help = "Attach to an existing endpoint instead of creating a new one. (default:false)", category = OptionCategory.INTERNAL) // static final OptionKey Attach = new OptionKey<>(false); - @com.oracle.truffle.api.Option(help = "Suspend the execution at first executed source line. (default:true)", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(help = "Suspend the execution at first executed source line. (default:true)", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey Suspend = new OptionKey<>(true); - @com.oracle.truffle.api.Option(help = "Do not execute any source code until inspector client is attached. (default:false)", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(help = "Do not execute any source code until inspector client is attached. (default:false)", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey WaitAttached = new OptionKey<>(false); - @com.oracle.truffle.api.Option(help = "Specifies list of directories or ZIP/JAR files representing source path. (default:none)", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(help = "Specifies list of directories or ZIP/JAR files representing source path. (default:none)", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey> SourcePath = new OptionKey<>(Collections.emptyList(), SOURCE_PATH); @com.oracle.truffle.api.Option(help = "Hide internal errors that can occur as a result of debugger inspection. (default:false)", category = OptionCategory.EXPERT) // static final OptionKey HideErrors = new OptionKey<>(false); - @com.oracle.truffle.api.Option(help = "Path to the chrome inspect. (default: randomly generated)", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(help = "Path to the chrome inspect. (default: randomly generated)", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey Path = new OptionKey<>(""); @com.oracle.truffle.api.Option(help = "Inspect internal sources. (default:false)", category = OptionCategory.INTERNAL) // @@ -181,19 +183,19 @@ private static URI createURIFromPath(String path) throws URISyntaxException { @com.oracle.truffle.api.Option(help = "Inspect language initialization. (default:false)", category = OptionCategory.INTERNAL) // static final OptionKey Initialization = new OptionKey<>(false); - @com.oracle.truffle.api.Option(help = "Use TLS/SSL. (default: false for loopback address, true otherwise)", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(help = "Use TLS/SSL. (default: false for loopback address, true otherwise)", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey Secure = new OptionKey<>(true); - @com.oracle.truffle.api.Option(help = "File path to keystore used for secure connection. (default:javax.net.ssl.keyStore system property)", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(help = "File path to keystore used for secure connection. (default:javax.net.ssl.keyStore system property)", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey KeyStore = new OptionKey<>(""); - @com.oracle.truffle.api.Option(help = "The keystore type. (default:javax.net.ssl.keyStoreType system property, or \\\"JKS\\\")", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(help = "The keystore type. (default:javax.net.ssl.keyStoreType system property, or \\\"JKS\\\")", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey KeyStoreType = new OptionKey<>(""); - @com.oracle.truffle.api.Option(help = "The keystore password. (default:javax.net.ssl.keyStorePassword system property)", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(help = "The keystore password. (default:javax.net.ssl.keyStorePassword system property)", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey KeyStorePassword = new OptionKey<>(""); - @com.oracle.truffle.api.Option(help = "Password for recovering keys from a keystore. (default:javax.net.ssl.keyPassword system property, or keystore password)", category = OptionCategory.USER) // + @com.oracle.truffle.api.Option(help = "Password for recovering keys from a keystore. (default:javax.net.ssl.keyPassword system property, or keystore password)", category = OptionCategory.USER, stability = OptionStability.STABLE) // static final OptionKey KeyPassword = new OptionKey<>(""); public static final String INSTRUMENT_ID = "inspect"; diff --git a/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/impl/CPUSamplerCLI.java b/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/impl/CPUSamplerCLI.java index 0828c8dd269c..6d0c8e24c189 100644 --- a/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/impl/CPUSamplerCLI.java +++ b/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/impl/CPUSamplerCLI.java @@ -34,6 +34,7 @@ import com.oracle.truffle.tools.utils.json.JSONObject; import org.graalvm.options.OptionCategory; import org.graalvm.options.OptionKey; +import org.graalvm.options.OptionStability; import org.graalvm.options.OptionType; import java.io.PrintStream; @@ -83,40 +84,47 @@ public CPUSampler.Mode apply(String s) { } }); - @Option(name = "", help = "Enable the CPU sampler.", category = OptionCategory.USER) static final OptionKey ENABLED = new OptionKey<>(false); + @Option(name = "", help = "Enable the CPU sampler.", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey ENABLED = new OptionKey<>(false); // @formatter:off @Option(name = "Mode", help = "Describe level of sampling detail. NOTE: Increased detail can lead to reduced accuracy. Modes: 'exclude_inlined_roots' - sample roots excluding inlined functions (default), " + - "'roots' - sample roots including inlined functions, 'statements' - sample all statements.", category = OptionCategory.USER) + "'roots' - sample roots including inlined functions, 'statements' - sample all statements.", category = OptionCategory.USER, stability = OptionStability.STABLE) static final OptionKey MODE = new OptionKey<>(CPUSampler.Mode.EXCLUDE_INLINED_ROOTS, CLI_MODE_TYPE); // @formatter:om - @Option(name = "Period", help = "Period in milliseconds to sample the stack.", category = OptionCategory.USER) static final OptionKey SAMPLE_PERIOD = new OptionKey<>(1L); + @Option(name = "Period", help = "Period in milliseconds to sample the stack.", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey SAMPLE_PERIOD = new OptionKey<>(1L); - @Option(name = "Delay", help = "Delay the sampling for this many milliseconds (default: 0).", category = OptionCategory.USER) static final OptionKey DELAY_PERIOD = new OptionKey<>(0L); + @Option(name = "Delay", help = "Delay the sampling for this many milliseconds (default: 0).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey DELAY_PERIOD = new OptionKey<>(0L); - @Option(name = "StackLimit", help = "Maximum number of maximum stack elements.", category = OptionCategory.USER) static final OptionKey STACK_LIMIT = new OptionKey<>(10000); + @Option(name = "StackLimit", help = "Maximum number of maximum stack elements.", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey STACK_LIMIT = new OptionKey<>(10000); - @Option(name = "Output", help = "Print a 'histogram', 'calltree' or 'json' as output (default:HISTOGRAM).", category = OptionCategory.USER) static final OptionKey OUTPUT = new OptionKey<>( - Output.HISTOGRAM, CLI_OUTPUT_TYPE); + @Option(name = "Output", help = "Print a 'histogram', 'calltree' or 'json' as output (default:HISTOGRAM).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey OUTPUT = new OptionKey<>(Output.HISTOGRAM, CLI_OUTPUT_TYPE); - @Option(name = "FilterRootName", help = "Wildcard filter for program roots. (eg. Math.*, default:*).", category = OptionCategory.USER) static final OptionKey FILTER_ROOT = new OptionKey<>( - new Object[0], WILDCARD_FILTER_TYPE); + @Option(name = "FilterRootName", help = "Wildcard filter for program roots. (eg. Math.*, default:*).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey FILTER_ROOT = new OptionKey<>(new Object[0], WILDCARD_FILTER_TYPE); - @Option(name = "FilterFile", help = "Wildcard filter for source file paths. (eg. *program*.sl, default:*).", category = OptionCategory.USER) static final OptionKey FILTER_FILE = new OptionKey<>( - new Object[0], WILDCARD_FILTER_TYPE); + @Option(name = "FilterFile", help = "Wildcard filter for source file paths. (eg. *program*.sl, default:*).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey FILTER_FILE = new OptionKey<>(new Object[0], WILDCARD_FILTER_TYPE); - @Option(name = "FilterMimeType", help = "Only profile languages with mime-type. (eg. +, default:no filter).", category = OptionCategory.USER) static final OptionKey FILTER_MIME_TYPE = new OptionKey<>( - ""); + @Option(name = "FilterMimeType", help = "Only profile languages with mime-type. (eg. +, default:no filter).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey FILTER_MIME_TYPE = new OptionKey<>(""); - @Option(name = "FilterLanguage", help = "Only profile languages with given ID. (eg. js, default:no filter).", category = OptionCategory.USER) static final OptionKey FILTER_LANGUAGE = new OptionKey<>( - ""); + @Option(name = "FilterLanguage", help = "Only profile languages with given ID. (eg. js, default:no filter).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey FILTER_LANGUAGE = new OptionKey<>(""); - @Option(name = "SampleInternal", help = "Capture internal elements (default:false).", category = OptionCategory.INTERNAL) static final OptionKey SAMPLE_INTERNAL = new OptionKey<>(false); + @Option(name = "SampleInternal", help = "Capture internal elements (default:false).", category = OptionCategory.INTERNAL) // + static final OptionKey SAMPLE_INTERNAL = new OptionKey<>(false); - @Option(name = "SummariseThreads", help = "Print output as a summary of all 'per thread' profiles. (default: false)", category = OptionCategory.USER) static final OptionKey SUMMARISE_THREADS = new OptionKey<>(false); + @Option(name = "SummariseThreads", help = "Print output as a summary of all 'per thread' profiles. (default: false)", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey SUMMARISE_THREADS = new OptionKey<>(false); - @Option(name = "GatherHitTimes", help = "Save a timestamp for each taken sample (default:false).", category = OptionCategory.USER) static final OptionKey GATHER_HIT_TIMES = new OptionKey<>(false); + @Option(name = "GatherHitTimes", help = "Save a timestamp for each taken sample (default:false).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey GATHER_HIT_TIMES = new OptionKey<>(false); static void handleOutput(TruffleInstrument.Env env, CPUSampler sampler) { PrintStream out = new PrintStream(env.out()); diff --git a/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/impl/CPUTracerCLI.java b/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/impl/CPUTracerCLI.java index 0891b5fa06a7..47ab702a0986 100644 --- a/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/impl/CPUTracerCLI.java +++ b/tools/src/com.oracle.truffle.tools.profiler/src/com/oracle/truffle/tools/profiler/impl/CPUTracerCLI.java @@ -31,6 +31,7 @@ import com.oracle.truffle.tools.utils.json.JSONObject; import org.graalvm.options.OptionCategory; import org.graalvm.options.OptionKey; +import org.graalvm.options.OptionStability; import org.graalvm.options.OptionType; import java.io.PrintStream; @@ -61,31 +62,35 @@ public Output apply(String s) { } }); - @Option(name = "", help = "Enable the CPU tracer (default: false).", category = OptionCategory.USER) static final OptionKey ENABLED = new OptionKey<>(false); + @Option(name = "", help = "Enable the CPU tracer (default: false).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey ENABLED = new OptionKey<>(false); - @Option(name = "TraceRoots", help = "Capture roots when tracing (default:true).", category = OptionCategory.USER) static final OptionKey TRACE_ROOTS = new OptionKey<>(true); + @Option(name = "TraceRoots", help = "Capture roots when tracing (default:true).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey TRACE_ROOTS = new OptionKey<>(true); - @Option(name = "TraceStatements", help = "Capture statements when tracing (default:false).", category = OptionCategory.USER) static final OptionKey TRACE_STATEMENTS = new OptionKey<>( - false); + @Option(name = "TraceStatements", help = "Capture statements when tracing (default:false).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey TRACE_STATEMENTS = new OptionKey<>(false); - @Option(name = "TraceCalls", help = "Capture calls when tracing (default:false).", category = OptionCategory.USER) static final OptionKey TRACE_CALLS = new OptionKey<>(false); + @Option(name = "TraceCalls", help = "Capture calls when tracing (default:false).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey TRACE_CALLS = new OptionKey<>(false); - @Option(name = "TraceInternal", help = "Trace internal elements (default:false).", category = OptionCategory.INTERNAL) static final OptionKey TRACE_INTERNAL = new OptionKey<>(false); + @Option(name = "TraceInternal", help = "Trace internal elements (default:false).", category = OptionCategory.INTERNAL) // + static final OptionKey TRACE_INTERNAL = new OptionKey<>(false); - @Option(name = "FilterRootName", help = "Wildcard filter for program roots. (eg. Math.*, default:*).", category = OptionCategory.USER) static final OptionKey FILTER_ROOT = new OptionKey<>( - new Object[0], WILDCARD_FILTER_TYPE); + @Option(name = "FilterRootName", help = "Wildcard filter for program roots. (eg. Math.*, default:*).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey FILTER_ROOT = new OptionKey<>(new Object[0], WILDCARD_FILTER_TYPE); - @Option(name = "FilterFile", help = "Wildcard filter for source file paths. (eg. *program*.sl, default:*).", category = OptionCategory.USER) static final OptionKey FILTER_FILE = new OptionKey<>( - new Object[0], WILDCARD_FILTER_TYPE); + @Option(name = "FilterFile", help = "Wildcard filter for source file paths. (eg. *program*.sl, default:*).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey FILTER_FILE = new OptionKey<>(new Object[0], WILDCARD_FILTER_TYPE); - @Option(name = "FilterMimeType", help = "Only profile languages with mime-type. (eg. +, default:no filter).", category = OptionCategory.USER) static final OptionKey FILTER_MIME_TYPE = new OptionKey<>( - ""); + @Option(name = "FilterMimeType", help = "Only profile languages with mime-type. (eg. +, default:no filter).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey FILTER_MIME_TYPE = new OptionKey<>(""); - @Option(name = "FilterLanguage", help = "Only profile languages with given ID. (eg. js, default:no filter).", category = OptionCategory.USER) static final OptionKey FILTER_LANGUAGE = new OptionKey<>( - ""); + @Option(name = "FilterLanguage", help = "Only profile languages with given ID. (eg. js, default:no filter).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey FILTER_LANGUAGE = new OptionKey<>(""); - @Option(name = "Output", help = "Print a 'histogram' or 'json' as output (default:HISTOGRAM).", category = OptionCategory.USER) static final OptionKey OUTPUT = new OptionKey<>( - Output.HISTOGRAM, CLI_OUTPUT_TYPE); + @Option(name = "Output", help = "Print a 'histogram' or 'json' as output (default:HISTOGRAM).", category = OptionCategory.USER, stability = OptionStability.STABLE) // + static final OptionKey OUTPUT = new OptionKey<>(Output.HISTOGRAM, CLI_OUTPUT_TYPE); public static void handleOutput(TruffleInstrument.Env env, CPUTracer tracer) { PrintStream out = new PrintStream(env.out());