Profiling and repeat support for JVM CLI Compiler

This commit is contained in:
simon.ogorodnik
2020-06-03 21:44:17 +03:00
parent ce1ef6c159
commit cd9273028b
9 changed files with 189 additions and 9 deletions
@@ -352,6 +352,23 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
)
var noKotlinNothingValueException: Boolean by FreezableVar(false)
@Argument(
value = "-Xprofile",
valueDescription = "<profilerPath:command:outputDir>",
description = "Debug option: Run compiler with async profiler, save snapshots to outputDir, command is passed to async-profiler on start\n" +
"You'll have to provide async-profiler.jar on classpath to use this\n" +
"profilerPath is a path to libasyncProfiler.so\n" +
"Example: -Xprofile=<PATH_TO_ASYNC_PROFILER>/async-profiler/build/libasyncProfiler.so:event=cpu,interval=1ms,threads,start,framebuf=50000000:<SNAPSHOT_DIR_PATH>"
)
var profileCompilerCommand: String? by NullableStringFreezableVar(null)
@Argument(
value = "-Xrepeat",
valueDescription = "<number>",
description = "Debug option: Repeats modules compilation <number> times"
)
var repeatCompileModules: String? by NullableStringFreezableVar(null)
override fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
val result = super.configureAnalysisFlags(collector)
result[JvmAnalysisFlags.strictMetadataVersionSemantics] = strictMetadataVersionSemantics