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
1
vote
1 answer
what exactly does callgrind collect
Is it sampling or is it recording every instruction executed?
Does it just capture the executing function or does it also have the line number?

pm100
- 48,078
- 23
- 82
- 145
1
vote
1 answer
Callgrind Anotate not working in OS X 10.10
i want ask you for some question what can be incorrect,
i write a program in C and translate it in
gcc -Wall -pedantic
and run
valgrind --simulate-cache=yes --tool=callgrind ./a.out
that create callgrind.out.[pid-number]
and if i…

Tomichi
- 11
- 1
1
vote
0 answers
Is callgrind able to include kernel functions in the call graph?
I am looking for a tool that generates the call graph for an application and includes the kernel functions as well. More specifically, I'm interested to know how many times a function was called. Is there a way to do that with callgrind? Or any…

soofyaan
- 299
- 3
- 12
1
vote
0 answers
Callgrind (Valgrind profiler) doesn't output useful results
I have written some C++ code that is structured as follows:
double kernel(params)
{
//code
}
void optimize(params)
{
//some code
double x = kernel();
//some more code
}
int main()
{
//some code
optimize();
//some more code
}
I tried…

user2966082
- 71
- 5
1
vote
1 answer
callgrind function names are not shown in child processes
I have process A wich forks process B. A and B - are different application. Both compiled with -g flag.
to run it with callgrind I use command:
valgrind --tool=callgrind --trace-children=yes ./A [params]
callgrind.out.xxx for parent process (A)…

user331241
- 31
- 4
1
vote
1 answer
Callgrind: How to use Callgrind tool to evaluate function speed
I am interested in testing speed of some function calls from the code written in C/C++. I searched and I was directed to use Valgrind platform with Callgrind tool.
I have briefly read the manual, but I am still wondering how I can utilize the…

ElectroJunkie
- 301
- 5
- 16
1
vote
1 answer
Callgrind on O1 or O3 for performance profiling?
I need to profile my C++ code, and valgrind --tool=callgrind is a phenomenal tool for that. I was wondering, however, if I should be profiling my code with -g -pg -O1 or -g -pg -O3 (GCC 4.4.7)? The latter gives a more accurate depiction of my…

Suedocode
- 2,504
- 3
- 23
- 41
1
vote
0 answers
What is the effect of Callgrind in code perfomance?
I am using Callgrind in order to see how many times specific functions are called. However, I am also interested in the execution time.
I know the programs take much longer when running on Callgrind, since it has to take information. However, what I…

Javi
- 3,440
- 5
- 29
- 43
1
vote
2 answers
LibreOffice: determine source code part responsible for printing
I am trying to implement some additional functionality to the LibreOffice printing process (some special info should be added automatically to the margins of every printed page). I am using RHEL 6.4 with LibreOffice 4.0.4 and Gnome 2.28.
My purpose…

Vitaly Isaev
- 5,392
- 6
- 45
- 64
1
vote
1 answer
Parsing a tokenized free form grammar with Boost.Spirit
I've got stuck trying to create a Boost.Spirit parser for the callgrind tool's output which is part of valgrind. Callgrind outputs a domain specific embedded programming language (DSEL) which lets you do all sorts of cool stuff like custom…

Niall Douglas
- 9,212
- 2
- 44
- 54
1
vote
2 answers
How to call Apache2 in single process mode by using callgrind to debug
all
I've been trying to get apache to run in signal process / debug mode,in order to use callgrind with it, and have a simple single process to work with for debugging.
Does anyone have experience with running apache in single process mode?
I've…

user1859969
- 11
- 2
0
votes
1 answer
-toggle-collect option in valgrind/callgrind not working
When I run callgrind with "--toggle-collect=fun" or "--toggle-collect=main" it does not work.
I tried with adding return type also but nothing worked. "--toggle-collect=void fun" or "--toggle-collect=int main". any idea why it is not working?
cmd…

ravi
- 9
- 5
0
votes
0 answers
Callgrind and objdump don't point to the same address on ARMv7
When I run Callgrind on a simple program on an ARMv7 system, I get the following dump (extract):
ob=(6) /lib/arm-linux-gnueabihf/libm-2.31.so
fl=(68) ./csu/../sysdeps/arm/crti.S
fn=(280) 0x00007570
0x7570 64 1
0x7574 65 1
0x7578 67 1
0x757c 68…

Benjamin Barrois
- 2,566
- 13
- 30
0
votes
0 answers
How do I profile some code using callgrind_control in c++?
I am trying to see where my code spends time on many instructions (doesn't have to be time, just number of instructions).
I see many recommendations for callgrind, which I did start using, but I don't see much I can do more than callgrind_control -b…

kloop
- 4,537
- 13
- 42
- 66
0
votes
2 answers
Using `callgrind` to count function calls in Linux
I am trying to track function call counts on a program I'm interested in. If I run the program on its own, it will run fine. If I try to run it with valgrind using the command seen below I seem to be getting a different result.
Command…

dearn44
- 3,198
- 4
- 30
- 63