Skip to content

Commit

Permalink
Merge pull request #296 from a16z/book/tracing
Browse files Browse the repository at this point in the history
docs: add chrome tracing info
  • Loading branch information
sragss authored Apr 15, 2024
2 parents 1c9a2b4 + 2e83c7d commit 4be3bb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions book/src/dev/tools.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Development Tools
## Tracing
Jolt is instrumented using [tokio-rs/tracing](https://github.com/tokio-rs/tracing). These traces can be displayed using the `--format chrome` flag, for example:
`cargo run -p jolt-core --release -- trace --name sha3 --format chrome`
`cargo run -p jolt-core --release -- trace --name sha2-chain --format chrome`

After tracing, files can be found in the workspace root with a name `trace-<timestamp>.json`. Load these traces into `chrome://tracing` or `https://ui.perfetto.dev/`.
After tracing, files can be found in the workspace root with a name `trace-<timestamp>.json`. Load these traces into [perfetto](https://ui.perfetto.dev/).

![Tracing in Jolt](../imgs/tracing.png)

Often it's easiest to debug performance for a particular segment by adding granular tracing, adjusting code, rerunning the `sha2-chain` end-to-end benchmark and looking through the Chrome traces.


## Objdump
Debugging the emulator / tracer can be hard. Use `riscv64-unknown-elf-objdump` to compare the actual ELF to the `.bytecode` / `.jolttrace` files.

0 comments on commit 4be3bb8

Please sign in to comment.