Crates.io | ckb-vm-pprof |
lib.rs | ckb-vm-pprof |
version | 0.119.0 |
source | src |
created_at | 2023-11-16 08:25:22.171136 |
updated_at | 2024-10-25 08:54:48.14956 |
description | Statistical CKB script cycles consumption flame graph |
homepage | |
repository | |
max_upload_size | |
id | 1037398 |
size | 3,452,744 |
This project profiling data in the format expected by the flamegraph visualization tool. It is a sub-project of ckb-vm.
Suppose the program to be tested is:
int fib(int n) {
if (n == 0 || n == 1) {
return n;
} else {
return fib(n-1) + fib(n-2);
}
}
int main() {
if (fib(10) != 55) {
return 1;
}
return 0;
}
We should take the -g
option on compiling for saving the debugging information:
$ riscv64-unknown-elf-gcc -g -o res/fib res/fib.c
To convert the textual representation of a flamegraph to a visual one, first install inferno:
$ cargo install inferno
Then, pass the file created by FlameLayer into inferno-flamegraph:
$ cargo run -- --bin res/fib | inferno-flamegraph > res/fib.svg
Open the svg:
MIT