Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: activate cycle-tracker with RUST_LOG=info #707

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions book/writing-programs/cycle-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ Note that to use the macro, you must add the `sp1-derive` crate to your dependen
sp1-derive = { git = "https://github.com/succinctlabs/sp1.git" }
```

In the script for proof generation, setup the logger with `utils::setup_logger()` and run the script with `RUST_LOG=debug cargo run --release`. You should see the following output:
In the script for proof generation, setup the logger with `utils::setup_logger()` and run the script with `RUST_LOG=info cargo run --release`. You should see the following output:

```
$ RUST_LOG=debug cargo run --release
$ RUST_LOG=info cargo run --release
Finished release [optimized] target(s) in 0.21s
Running `target/release/cycle-tracking-script`
2024-03-13T02:03:40.567500Z INFO execute: loading memory image
2024-03-13T02:03:40.567751Z INFO execute: starting execution
2024-03-13T02:03:40.567760Z INFO execute: clk = 0 pc = 0x2013b8
2024-03-13T02:03:40.567822Z DEBUG execute: ┌╴setup
2024-03-13T02:03:40.568095Z DEBUG execute: └╴4,398 cycles
2024-03-13T02:03:40.568122Z DEBUG execute: ┌╴main-body
2024-03-13T02:03:40.568149Z DEBUG execute: │ ┌╴expensive_function
2024-03-13T02:03:40.568250Z DEBUG execute: │ └╴1,368 cycles
2024-03-13T02:03:40.567822Z INFO execute: ┌╴setup
2024-03-13T02:03:40.568095Z INFO execute: └╴4,398 cycles
2024-03-13T02:03:40.568122Z INFO execute: ┌╴main-body
2024-03-13T02:03:40.568149Z INFO execute: │ ┌╴expensive_function
2024-03-13T02:03:40.568250Z INFO execute: │ └╴1,368 cycles
stdout: result: 5561
2024-03-13T02:03:40.568373Z DEBUG execute: │ ┌╴expensive_function
2024-03-13T02:03:40.568470Z DEBUG execute: │ └╴1,368 cycles
2024-03-13T02:03:40.568373Z INFO execute: │ ┌╴expensive_function
2024-03-13T02:03:40.568470Z INFO execute: │ └╴1,368 cycles
stdout: result: 2940
2024-03-13T02:03:40.568556Z DEBUG execute: └╴5,766 cycles
2024-03-13T02:03:40.568556Z INFO execute: └╴5,766 cycles
2024-03-13T02:03:40.568566Z INFO execute: finished execution clk = 11127 pc = 0x0
2024-03-13T02:03:40.569251Z INFO execute: close time.busy=1.78ms time.idle=21.1µs
```
Expand Down
2 changes: 1 addition & 1 deletion core/src/syscall/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Syscall for SyscallWrite {
let (start, depth) = rt.cycle_tracker.remove(fn_name).unwrap_or((0, 0));
// Leftpad by 2 spaces for each depth.
let padding = (0..depth).map(|_| "│ ").collect::<String>();
log::debug!(
log::info!(
"{}└╴{} cycles",
padding,
num_to_comma_separated(rt.state.global_clk - start as u64)
Expand Down