Callgrind is a profiling tool that records call history among functions in a program's run as a call-graph. By default, the collected data consists of the number of instructions executed, their relationship to source lines, the caller/callee relationship between functions, and the numbers of such calls. Optionally, cache simulation and/or branch prediction (similar to Cachegrind) can produce further information about the runtime behavior of an application.
Questions tagged [callgrind]
121 questions
59
votes
5 answers
Valgrind reporting a segment overflow
When running my program with valgrind / callgrind I get the following message a lot:
==21734== brk segment overflow in thread #1: can't grow to 0x4a39000
(with different addresses)
Note that it is not preceded by a stack overflow message.
I can't…

Tim Kuipers
- 1,705
- 2
- 16
- 26
37
votes
7 answers
Windows Callgrind results browser, alternative to KCacheGrind
Is there any tool, other than KCacheGrind, being able to view callgrind results? Preferably for Windows platform?
anon
27
votes
2 answers
Interpreting callgrind data
I need a dynamic call graph for my app. I run it with callgrind tool (valgrind suite) and got callgrind.out.xxxxx file. Now, I want to make a graphical representation of this data. KCacheGrind doesn't help me much because it draws a limited part of…

maverik
- 5,508
- 3
- 35
- 55
26
votes
3 answers
How use callgrind to profiling only a certain period of program execution?
I want to use valgrind to do some profiling, since it does not need re-build the program. (the program I want to profile is already build with “-g")
But valgrind(callgrind) is quite slow ... so here's what I to do:
start the server ( I want to…

superb
- 963
- 1
- 10
- 21
25
votes
1 answer
How to interpret results from kcachegrind
Could anyone tell me how to interest the results from kcachegrind.
I had two versions of my code (v1, v2) both compiled in debug mode. I ran them through valgrind with options:
valgrind --tool=callgrind -v ....
The output files thus generated are…

rkm
- 892
- 2
- 16
- 32
21
votes
1 answer
Is there a tool to examine the difference of two callgrind/valgrind profiles?
I'm trying to understand how a program's performance changes when run with different options—I have a factor of 1.8 I'd like to explain. I've been doing profiling with [valgrind]'s callgrind tool and using kcachegrind to visualize the results.
But…

Norman Ramsey
- 198,648
- 61
- 360
- 533
21
votes
5 answers
Console alternative of kcachegrind?
Kcachegrind rocks and it's of my favorite tools, however from time to time I'm missing the ability to run it in terminal(e.g using ssh) on the remote server.
I know it's possible to setup VNC or X-server forwarding but it's quite clumsy while I…

pachanga
- 3,003
- 4
- 30
- 45
19
votes
2 answers
Callgrind: Profile a specific part of my code
I'm trying to profile (with Callgrind) a specific part of my code by removing noise and computation that I don't care about.
Here is an example of what I want to do:
for (int i=0; i

joetde
- 1,556
- 1
- 16
- 26
14
votes
4 answers
How to profile time spent in memory access in C/C++ applications?
Total Time spent by a function in an application can be broadly divided in to two components:
Time spent on actual computation (Tcomp)
Time spent on memory accesses (Tmem)
Typically profilers provide an estimate of the total time spent by a…

Imran
- 642
- 6
- 25
14
votes
2 answers
Different read and write count using cachegrind and callgrind
I am doing some experiments with Cachegrind, Callgrind and Gem5. I noticed that a number of accesses were counted as read for cachegrind, as write for callgrind and for both read and write by gem5.
Let's take a very simple example:
int main() {
…

Maxime Chéramy
- 17,761
- 8
- 54
- 75
13
votes
4 answers
Kcachegrind. Show only functions from my code
I want to profile my code. So I do:
valgrind --tool=callgrind my_program [programm arguments]
kcachegrind callgrind.out.x
Now I have kcachegrind window like this:
There is a lot of core and library functions, but how can I set up valgrind or…

Kenenbek Arzymatov
- 8,439
- 19
- 58
- 109
10
votes
1 answer
Is callgrind profiling influenced by other processes?
I'd like to profile my application using callgrind. Now, since it takes a very long time, in the meanwhile I go on with web-browsing, compiling and other intensive tasks on the same machine.
Am I biasing the profiling results? I'm expecting that,…

Paolo M
- 12,403
- 6
- 52
- 73
10
votes
2 answers
Using callgrind/kcachegrind to get per-thread statistics
I'd like to be able to see how "expensive" each thread in my application is using callgrind. I profiled with the --separate-thread=yes option which gives you a callgrind file for the whole app and then one per-thread.
This is useful for viewing…

Paul D.
- 1,785
- 2
- 19
- 25
9
votes
1 answer
callgrind slow with instrumentation turned off
I am using callgrind to profile a linux multi-threaded app and mostly it's working great. I start it with instrumentation off (--instr-atstart=no) and then once setup is done i turn it on with callgrind_control -i on. However, when I change certain…

naumcho
- 18,671
- 14
- 48
- 59
8
votes
3 answers
Make callgrind show all function calls in the kcachegrind callgraph
I was using valgrind tool - callgrind and kcachegrind for profiling a large project and was wondering if there is a way that callgrind reports the stats from all the functions (not just the most expensive functions).
To be specific - When I…

user1801733
- 147
- 1
- 3
- 11