Cachegrind simulates how your program interacts with a machine's cache hierarchy and (optionally) branch predictor. It simulates a machine with independent first-level instruction and data caches (I1 and D1), backed by a unified second-level cache (L2).
Questions tagged [cachegrind]
32 questions
3
votes
0 answers
How to force a whole crate to use a deterministic hasher (even dependencies)?
I have a fairly large Rust crate with some dependencies. Now, I want to implement some benchmarks. To get the most stable measurements possible, I'm using cachegrind with bheisler's iai.
Even after disabling ASLR, there remains some jitter in the…

Martin
- 381
- 4
- 17
3
votes
1 answer
Cachegrind output interpretation
This is part of cachegrind output. This part of code has been executed for 1224 times. elmg1 is an array of unsigned long of size 16 x 20. My machine L1 cache size is 32KB, 64B cache line size and 8-way set associative.
for (i = 0; i < 20; i++) …

anup
- 529
- 5
- 14
3
votes
0 answers
xdebug.profiler_enable causes cachegrind files that take up too much memory
Good morning,
My mac ran out of working memory today, which was odd. I checked out where the space was being used, and it was in my log/xdebug file, nearly 20 GB of cachegrind.out files! I've only had xdebug.profiler_enable on for about 3-4 weeks,…

Jeremy John
- 13,686
- 2
- 16
- 16
3
votes
1 answer
Why is the L3 cache ignored by cachegrind, contradicting documentation?
I want to learn how people do cache optimization and I was suggested cachegrind by a friend
as a useful tool towards this goal.
Valgrind being a CPU simulator, assumes a 2-level cache, as mentioned here, when using cachegrind
Cachegrind simulates…

smilingbuddha
- 14,334
- 33
- 112
- 189
2
votes
0 answers
cachegrind: set cache size
I'm trying to test my program's performance on different cache sizes using cachegrind.
How do I set the cache size for the last level in the command? (I have read that the flag --LL should be used but it doesn't work. Can you please give me an…

user2740785
- 141
- 1
- 3
- 9
2
votes
0 answers
Cache usage and derived types
I am new to profiling code with valgrind and cachegrind, and I recently started using these tools to see how my code was doing in regards to cache utilization. I found that a simple if-statement appears to cause a cache miss almost every single time…

cstraats
- 117
- 4
1
vote
0 answers
Detect whether a cache line is reused due to spatial or temporal locality
Is there a practical tool to detect whether a cache line is reused (a cache miss is avoided) due to either spatial or temporal locality?
I could not find a related discussion in cachegrind.
I was able to find only this and this papers but not the…

Kadir
- 1,345
- 3
- 15
- 25
1
vote
1 answer
Why is wincachegrind giving me the wrong cumulative time for curl_exec?
I was wracking my brains over this apparent discrepancy:
My page is taking about 8 seconds to load.
Wincachegrind says my page is only taking .8 seconds
I finally loaded the same cachegrind file in kcachegrind and got results inline with the…

fbas
- 1,676
- 3
- 16
- 26
1
vote
0 answers
Cachegrind not showing function-level results?
I am profiling my C++ application with Valgrind's Cachegrind, using this terminal line:
valgrind --branch-sim=yes --tool=cachegrind ./myProgram
and from the online guides I have seen this should automatically present function-level profiling…

user997112
- 29,025
- 43
- 182
- 361
1
vote
1 answer
QCacheGrind source code path wrong
Trying to profile my code with QCacheGrind and everything loads fine but I can't see the source code inside the program.
For some reason the source code path is wrong.
Right now it is cachegrind file location + php file location
It should be only…

mend
- 153
- 2
- 14
1
vote
0 answers
Interpreting cachegrind Ir count for function declaration lines
I have cachegrind line-by-line counts for two similar functions, used exactly the same way. The Ir counts for the function declaration lines (void f(...)) are very different: 999,999,993 for one and only 284 for the other. What does this mean?

zoo
- 1,901
- 1
- 17
- 25
0
votes
0 answers
How shoud the results from cachegrind be interpretated?
I need to profile a program in development to understand what bottlenecks there may be and in particular whether there are any due to memory accesses.
To do this I used cachegrind built into valgrind.
I compiled the program using gcc and the -g flag…

Dresult
- 171
- 1
- 11
0
votes
1 answer
Running cachegrind on OpenJDK JVM
I want to use cachegrind to do some performance profiling on the OpenJDK JVM. (BTW, if this is Not A Good Idea, I would like to understand why.)
The problem is it keeps tripping up assertions in the JVM. So what can I do to get a run using…

starflyer
- 484
- 1
- 11
- 23
0
votes
1 answer
Limiting data collection of Cachegrind, in Valgrind
It is well known that, the callgrind analysis tool of the valgrind suit, provides the possibility to start and stop the colection of data via command line instruction callgrind_control -i on or callgrind_control -i off. For instance, the following…

Antonio Ragagnin
- 2,278
- 4
- 24
- 39
0
votes
1 answer
call graph for MySQL sessions
I am trying to create a valgrind (cachegrind) analysis of MySQL client connections.
I am running valgrind with --trace-children=yes.
What I want to find is one of the internal method calls, to see the call graph when it is being used...
After…

evenro
- 2,626
- 20
- 35