Skip to content

Commit 8b759f8

Browse files
authored
added uftrace tip
Signed-off-by: Anton-4 <[email protected]>
1 parent 690e690 commit 8b759f8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

devtools/debug_tips.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ It can be valuable if you want to compare two compiler versions/commits and see
8989
### Getting started with uftrace
9090

9191
1. [Install uftrace](https://github.com/namhyung/uftrace?tab=readme-ov-file#how-to-build-and-install-uftrace)
92-
2. In the roc repo in rust-toolchain.toml, switch to the commented out nightly channel
93-
3. `export RUSTFLAGS="-Awarnings -Z instrument-mcount -C passes=ee-instrument<post-inline>"`
94-
4. `cargo build --bin roc`
95-
5. Example usage: `uftrace record --filter 'roc_*' ./target/debug/roc build yourFile.roc`
96-
6. Show the trace and drop all functions that do not start with `roc`: `uftrace replay -f none --notrace '^[^r]|^r[^o]|^ro[^c]' -D 5`. `-D 5` sets the function call depth, feel free to modify it to best suit your purpose.
92+
1. In the roc repo in rust-toolchain.toml, switch to the commented out nightly channel
93+
1. `export RUSTFLAGS="-Awarnings -Z instrument-mcount -C passes=ee-instrument<post-inline>"`
94+
1. set the [threads variable](https://github.com/roc-lang/roc/blob/690e690bb7c9333825157f54fc471a8a15b92aae/crates/compiler/load_internal/src/file.rs#L1555) to `Threads::Single`.
95+
1. `cargo build --bin roc`
96+
1. Example usage: `uftrace record --filter 'roc_*' ./target/debug/roc build yourFile.roc`
97+
1. Show the trace and drop all functions that do not start with `roc`: `uftrace replay -f none --notrace '^[^r]|^r[^o]|^ro[^c]' -D 5`. `-D 5` sets the function call depth, feel free to modify it to best suit your purpose.
9798

9899
Depending on which functions you are interested in, you may also want to set `let threads = Threads::Single;` in the function `load` in `crates/compiler/load_internal/src/file.rs`. That avoids function calls from being obscured between multiple threads.
99100

0 commit comments

Comments
 (0)