From e2886a4b1fb7fdc9d4c405367598b7d330e80e40 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 17 Jan 2023 12:53:13 +0000 Subject: [PATCH] docs: Update instructions to point to new profiling target This removes the need for the user to manually change the Cargo.toml file for profiling. Signed-off-by: Rob Bradford --- docs/profiling.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 \