Skip to content

Commit 5e44b45

Browse files
committed
New tools documentation
1 parent 4dc2402 commit 5e44b45

File tree

7 files changed

+206
-61
lines changed

7 files changed

+206
-61
lines changed

doc/contributor/profiling.md

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,17 @@
11
# Profiling TruffleRuby
22

3-
There is no shortage of tools for profiling TruffleRuby. When running in JVM mode, we can
4-
use standard JVM tooling, such as VisualVM and Java Flight Recorder. When run as a native
5-
image we can use callgrind from the valgrind tool suite and other system tools, such as
6-
strace. As an instrumented Truffle language, we can also use Truffle's profiling
7-
capabilities. For a broad enough definition of profiling, we can also use the Ideal Graph
8-
Visualizer (IGV) and C1 Visualizer to inspect Graal's output.
3+
There is no shortage of tools for profiling TruffleRuby. When running in JVM
4+
mode, we can use standard JVM tooling, such as VisualVM and Java Flight
5+
Recorder. When run as a native image we can use callgrind from the Valgrind
6+
tool suite and other system tools, such as strace. As an instrumented Truffle
7+
language, we can also use Truffle's profiling capabilities and other [user
8+
tools](../user/tools.md). For a broad enough definition of profiling, we can
9+
also use the Ideal Graph Visualizer (IGV) and C1 Visualizer to inspect Graal's
10+
output.
911

1012
This document is less about how to use each tool and more about suggestions for extracting
1113
the most useful information from the tools, assuming basic knowledge of their usage.
1214

13-
## Truffle Profiling
14-
15-
Truffle provides both a CPU sampler and a CPU tracer. To see the full list of options, run
16-
`jt ruby --help:tools`. By default, the output is a histogram format that looks quite
17-
similar to gprof's flat profile and it is printed directly to STDOUT.
18-
19-
### CPU Tracer
20-
21-
The CPU tracer can be invoked via `jt ruby --cputracer`. It provides method invocation
22-
counts, but not elapsed time. It can be a good way to see which methods should be optimized
23-
or for discovering calls that are being called more frequently than expected.
24-
25-
### CPU Sampler
26-
27-
The CPU sampler can be invoked via `jt ruby --cpusampler`. It provides sampled execution
28-
times for both the total time of the method call (i.e., the method & its subcalls)
29-
and just the method's execution time (i.e., ignoring calls made from the method). It does
30-
not provide invocation counts.
31-
3215
### Creating a Flame Graph
3316

3417
#### The Easy Way

doc/contributor/stdlib.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| `csv` | | Ruby | As MRI (not in source repo) | As MRI | Specs, MRI | |
1616
| `date` | | Ruby | As MRI | As MRI | Specs, MRI | |
1717
| `dbm` | Key-value store manager | C extension | As MRI | Unsupported | MRI | |
18-
| `debug` | Debugger using `tracer` | Ruby | As MRI, but think it needs a command-line flag | As MRI | C extension parts in MRI | |
18+
| `debug` | Debugger using `tracer` | Ruby | As MRI, but think it needs a command-line flag | As MRI | C extension parts in MRI | Use `--inspect` instead |
1919
| `delegate` | Method-call forwarding | Ruby | As MRI | As MRI | Specs, MRI | |
2020
| `digest` | | C extension | Java extension | Ruby and Java primitives | Specs, MRI | Some third-party C extensions link against the C extension |
2121
| `drb` | Distributed object system | Ruby | As MRI | As MRI | Specs (limited), MRI | |
@@ -57,12 +57,12 @@
5757
| `pp` | `Kernel#pp` | Ruby | As MRI | As MRI | Specs, MRI | |
5858
| `prettyprint` | | Ruby | As MRI | As MRI | MRI | |
5959
| `prime` | Prime numbers | Ruby | As MRI | As MRI | Specs, MRI | |
60-
| `profile` | Interface to `profiler` | Ruby | As MRI | As MRI, but not sure it really works | C extension parts in MRI | |
61-
| `profiler` | Profiler using `TracePoint` | Ruby | As MRI | As MRI, but not sure it really works | C extension parts in MRI | |
60+
| `profile` | Interface to `profiler` | Ruby | As MRI | As MRI, but not sure it really works | C extension parts in MRI | Use `--cpusampler` instead |
61+
| `profiler` | Profiler using `TracePoint` | Ruby | As MRI | As MRI, but not sure it really works | C extension parts in MRI | Use `--cpusampler` instead |
6262
| `pstore` | Persist objects to files | Ruby | As MRI | As MRI | MRI | |
6363
| `psych` | YAML parser, implementation for `yaml` | C extension | Java extension using SnakeYAML | As MRI | Specs (via YAML), MRI | |
6464
| `pty` | Terminals | C extension | Ruby using FFI | Unsupported | MRI | |
65-
| `racc` (runtime only) | Parser generator | Ruby and C extension | Ruby and Java extension | Ruby (no extension) | None | We use the pure Ruby version of the extension |
65+
| `racc` (runtime only) | Parser generator | Ruby and C extension | Ruby and Java extension | Ruby (no extension) | None | We use the pure Ruby version of the extension |
6666
| `rake` | Ruby `make` equivalent | Ruby | As MRI | As MRI | None | |
6767
| `rbconfig` | System and build configuration information | Generated Ruby | Java extension | Ruby | MRI | |
6868
| `rdoc` | Documentation system | Ruby | As MRI (not in source repo) | As MRI | MRI | |

doc/user/compatibility.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ The following standard libraries are unsupported.
6060
* `dbm`
6161
* `gdbm`
6262
* `sdbm`
63-
* `debug` (could be implemented in the future) <!-- TODO CS 26 Feb 19 document alternatives -->
64-
* `profile` (could be implemented in the future)
65-
* `profiler` (could be implemented in the future)
63+
* `debug` (could be implemented in the future, use [`--inspect`](tools.md) instead)
64+
* `profile` (could be implemented in the future, use [`--cpusampler`](tools.md) instead)
65+
* `profiler` (could be implemented in the future, use [`--cpusampler`](tools.md) instead)
6666
* `io/console` (partially implemented, could be implemented in the future)
6767
* `io/wait` (partially implemented, could be implemented in the future)
6868
* `pty` (could be implemented in the future)

doc/user/images/chrome.png

312 KB
Loading

doc/user/images/netbeans.png

301 KB
Loading

doc/user/netbeans.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)