From 5ef0a9a274a71b1c55460b1da852c2165adf61b2 Mon Sep 17 00:00:00 2001 From: Alex Ott <66271487+AlexanderHott@users.noreply.github.com> Date: Tue, 15 Sep 2026 00:49:44 -0400 Subject: [PATCH 1/2] Update cachegrind example command to simulate cache https://valgrind.org/docs/manual/dist.news.html Valgrind 3.21.0: --cache-sim=no is now the default. The cache simulation is old and unlikely to match any real modern machine. --- content/english/hpc/profiling/simulation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/english/hpc/profiling/simulation.md b/content/english/hpc/profiling/simulation.md index 75401b8a..5126b0ce 100644 --- a/content/english/hpc/profiling/simulation.md +++ b/content/english/hpc/profiling/simulation.md @@ -20,8 +20,8 @@ There are many subcategories of such profilers, differing in which aspect of com Cachegrind essentially inspects the binary for "interesting" instructions — that perform memory reads / writes and conditional / indirect jumps — and replaces them with code that simulates corresponding hardware operations using software data structures. It therefore doesn't need access to the source code and can work with already compiled programs, and can be run on any program like this: ```bash -valgrind --tool=cachegrind --branch-sim=yes ./run -# also simulate branch prediction ^ ^ any command, not necessarily one process +valgrind --tool=cachegrind --branch-sim=yes --cache-sim=yes ./run +# branch prediction cache simulation any command ``` It instruments all involved binaries, runs them, and outputs a summary similar to [perf stat](../events): From 969f5b744a86aad84c5c25cdd9c4d9faa0b21c57 Mon Sep 17 00:00:00 2001 From: Alexander Ott <66271487+AlexanderHott@users.noreply.github.com> Date: Mon, 14 Sep 2026 22:14:00 -0700 Subject: [PATCH 2/2] Enable cache simulation in annotation example --- content/english/hpc/profiling/simulation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/english/hpc/profiling/simulation.md b/content/english/hpc/profiling/simulation.md index 5126b0ce..8d6e2880 100644 --- a/content/english/hpc/profiling/simulation.md +++ b/content/english/hpc/profiling/simulation.md @@ -90,7 +90,7 @@ The whole source-to-analysis process would therefore go like this: ```bash g++ -O3 -g sort-and-search.cc -o run -valgrind --tool=cachegrind --branch-sim=yes --cachegrind-out-file=cachegrind.out ./run +valgrind --tool=cachegrind --cache-sim=yes --branch-sim=yes --cachegrind-out-file=cachegrind.out ./run cg_annotate cachegrind.out --auto=yes --show=Dr,D1mr,DLmr,Bc,Bcm ```