diff --git a/docs/profiling.md b/docs/profiling.md index c341c52ed..1831f70ce 100644 --- a/docs/profiling.md +++ b/docs/profiling.md @@ -4,20 +4,12 @@ ## Building a suitable binary -Modify the `Cargo.toml` file to add `debug = 1` to the `[profile.release]` block. It should look like this: - -``` -[profile.release] -lto = true -debug = 1 -``` - This adds the symbol information to the release binary but does not otherwise affect the performance. The binary must also be built with frame pointers included so that the call graph can be captured by the profiler. ``` -$ cargo clean && RUSTFLAGS='-C force-frame-pointers=y' cargo build --release +$ cargo clean && RUSTFLAGS='-C force-frame-pointers=y' cargo build --profile profiling ``` ## Profiling @@ -27,7 +19,7 @@ $ cargo clean && RUSTFLAGS='-C force-frame-pointers=y' cargo build --release e.g. ``` -$ perf record -g target/release/cloud-hypervisor \ +$ perf record -g target/profiling/cloud-hypervisor \ --kernel ~/src/linux/vmlinux \ --pmem file=~/workloads/focal.raw \ --cpus boot=1 --memory size=1G \