blob: 8adf91638ac2a3c83e5bd0bce4138bf912fbade8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!/bin/sh
# investigate good cache usage
sudo perf stat ./main -1
# investigate bad cache usage
sudo perf stat ./main -2
# look at actual instruction and cache statistics
sudo perf stat -e instructions -e cache-misses ./main -1
sudo perf stat -e instructions -e cache-misses ./main -2
# more detailed events like L1-dcache-loads and L1-dcache-load-misses
# may be available on the system (sudo perf list)
# investigate which lines of code cause the problem
sudo perf record -e cache-misses ./main -2
sudo perf report
|