Crates.io | ckb-vm-pprof |
lib.rs | ckb-vm-pprof |
version | 0.116.1 |
source | src |
created_at | 2023-11-16 08:25:22.171136 |
updated_at | 2024-05-11 09:50:08.695927 |
description | Statistical CKB script cycles consumption flame graph |
homepage | |
repository | |
max_upload_size | |
id | 1037398 |
size | 3,448,611 |
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