Load async-profiler.jar if possible when using -Xprofile

Instead of requiring it to be on the compiler classpath.

This will make it much easier to profile the Kotlin compiler daemon in
Gradle, by just specifying a compiler argument instead of also manually
patching the compiler jar.
This commit is contained in:
Alexander Udalov
2021-07-06 13:25:38 +02:00
parent 787ce6335c
commit 25f0beed12
3 changed files with 41 additions and 23 deletions
+3 -3
View File
@@ -100,9 +100,9 @@ where advanced options include:
0 means use a thread per processor core.
Default value is 1
-Xprofile=<profilerPath:command:outputDir>
Debug option: Run compiler with async profiler, save snapshots to outputDir, command is passed to async-profiler on start
You'll have to provide async-profiler.jar on classpath to use this
profilerPath is a path to libasyncProfiler.so
Debug option: Run compiler with async profiler and save snapshots to `outputDir`; `command` is passed to async-profiler on start.
`profilerPath` is a path to libasyncProfiler.so; async-profiler.jar should be on the compiler classpath.
If it's not on the classpath, the compiler will attempt to load async-profiler.jar from the containing directory of profilerPath.
Example: -Xprofile=<PATH_TO_ASYNC_PROFILER>/async-profiler/build/libasyncProfiler.so:event=cpu,interval=1ms,threads,start,framebuf=50000000:<SNAPSHOT_DIR_PATH>
-Xrepeat=<number> Debug option: Repeats modules compilation <number> times
-Xsam-conversions={class|indy} Select code generation scheme for SAM conversions.