Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/english/hpc/profiling/simulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
```

Expand Down