mirror of https://github.com/sbt/sbt.git
Merge pull request #8362 from eed3si9n/wip/profile-docs
[2.x] docs: Update flamegraph guide --lines
This commit is contained in:
commit
9a00d7cf3c
12
PROFILING.md
12
PROFILING.md
|
|
@ -14,10 +14,11 @@ The first one I recommend is async-profiler. This is available for macOS and Lin
|
|||
and works fairly well. See their readme for the details, but see the following to get started.
|
||||
|
||||
1. Download the installer from <https://github.com/async-profiler/async-profiler/releases/tag/v4.2>
|
||||
2. Make symbolic link from `asprof` to `$HOME/bin`, assuming you have PATH to `$HOME/bin`:
|
||||
2. Make symbolic link from `asprof` and `jfrconv` to `$HOME/bin`, assuming you have PATH to `$HOME/bin`:
|
||||
|
||||
```bash
|
||||
$ ln -s $HOME/Applications/async-profiler-4.2/bin/asprof $HOME/bin/asprof
|
||||
$ ln -s $HOME/Applications/async-profiler-4.2/bin/jfrconv $HOME/bin/jfrconv
|
||||
```
|
||||
|
||||
Next, close all Java applications and anything that may affect the profiling, and run sbt in one terminal:
|
||||
|
|
@ -73,6 +74,15 @@ This should produce `/tmp/flamegraph.html` at the end.
|
|||
|
||||

|
||||
|
||||
### include line numbers
|
||||
|
||||
With Scala, sometimes you would get a method name that looks like `sbt/Defaults$.$init$$anonfun$1`, which we'd have no idea which lambda expression it is pointing to. One workaround is to include the line numbers into the flamegraph by first generating in the Java Flight Recorder format.
|
||||
|
||||
```bash
|
||||
$ asprof -d 60 -f /tmp/flamegraph.jfr <process id>
|
||||
$ jfrconv --lines /tmp/flamegraph.jfr /tmp/flamegraph.html
|
||||
```
|
||||
|
||||
### running sbt with standby
|
||||
|
||||
One of the tricky things you come across while profiling is figuring out the process ID,
|
||||
|
|
|
|||
Loading…
Reference in New Issue