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
2
votes
1 answer
callgrind profile output with backtrace?
Is it possible to get back traces with the profiling output from Callgrind?
If it is, would you be able to explain how that's done?
[update] It could be my terminology. What is the backtrace/callstack called and where does it reside when using…

bitcycle
- 7,632
- 16
- 70
- 121
2
votes
2 answers
Tools to evaluate callgrind's call profiles?
Somehow related to this question, which tool would you recommend to evaluate the profiling data created with callgrind?
It does not have to have a graphical interface, but it should prepare the results in a concise, clear and easy-to-interpret way.…

fuenfundachtzig
- 7,952
- 13
- 62
- 87
2
votes
1 answer
Callgrind does not see source in dynamically loaded SO
I'm attempting to run KCacheGrind on some results of callgrind. Basically the codebase is a plugin container that launches a shared object to run a specific function. Upon using Callgrind to profile this application, I can see the costs at the…

jluzwick
- 2,005
- 1
- 15
- 23
2
votes
1 answer
Debugging: Tracing (and diff-ing) function call tree of two version of the same program
I'm working on the rewriting of some
code in a c++ cmd line program.
I
changed the low level data structure that
it uses and the new version passes all
the tests (quite a lot) without any
problem and I get the correct output
from both the new and…

3mpty
- 506
- 1
- 6
- 14
2
votes
2 answers
How to view the source code in Kcachegrind
I have been able to analyze the callgrind details for my program from the terminal...
However, when I want to view the results in the graphical Tools using "KcacheGrind"... I cannot access the mysource code which should be available by default under…

user1583731
- 21
- 1
- 4
2
votes
1 answer
Profile time spent
I am looking for some tools to profile where the time is spent. Have looked at oprofile, but that doesnt really give me what I need.
I was looking at callgrind, specifically using the CALLGRIND_START_INSTRUMENTATION and…

Mark Lobo
- 331
- 2
- 3
- 9
1
vote
0 answers
How can I find the "missing" time in this kCacheGrind output?
I'm analyzing kCacheGrind (really WinCacheGrind) to analyze cachegrind files and when the "self" times of each process are added up, the total comes nowhere near the cumulative time of the entire page. More specifically, the self time of the entire…

kronikhedaik
- 11
- 2
1
vote
0 answers
How can I visualize GNU remake profile data for multithreaded processes
I'm trying to profile a large multi-threaded Make-based system.
I recently found GNU remake and was able to use it as a drop-in replacement for gmake.
Since my system is multi-threaded and also has many processes, remake generated a large amount of…

Veena
- 29
- 2
1
vote
1 answer
Tracking down unnecessary copies with callgrind
I'm working on C++ project (a ray tracer) and I've been going through and attempting to optimize the codebase. I'm not a C++ expert, and I'm sure I've made lot's of beginner mistakes especially around accidental copies (see below). I've been trying…

Chip Bell
- 65
- 4
1
vote
0 answers
Understanding KCachegrind/callgrind
How should I interpret the percentages attached to the boxes representing function calls in KCachegrind? There are similar questions here but none of them actually answer the question for any non-trivial call graph.
For example, I have three…

foki
- 8,624
- 6
- 33
- 32
1
vote
1 answer
How to make the result of callgrind human readable
I'm trying to use valgrind --tool=callgrind to profile my C++ program on Ubuntu. Here is my code:
#include
int main()
{
std::cout<<"hello world"<

Yves
- 11,597
- 17
- 83
- 180
1
vote
0 answers
Is there a way to time each function like callgrind in python to measure source code execution time?
I would like to measure the amount of time spent for each function in the c source codes but run in python with ctypes. Is there a way to use valgrind and callgrind with the python executions?

Aki
- 11
- 2
1
vote
2 answers
Callgrind - QCachegrind output: Does "self" represents the cost of a function per call?
I am confused as to how to interpret the "Self" slot in QCachegrind. Is it per call cost of a function or is it the total cost of a function when called x times where x is represented by the slot "called"?
(please see the image below)
Is 0.003 the…

Marsha
- 43
- 3
1
vote
0 answers
Valgrind showing odd "if" statement cycle consumption
I'm running valgrind / callgrind on a program and when I view the source code tab in kachegrind to find out where cycles are being spent in a particular file, it shows a huge percentage (63%) of time on a line that doesn't make sense to me - all it…

akevan
- 691
- 1
- 9
- 21
1
vote
2 answers
How to determine why valgrind/callgrind kills process
I have written a multithreaded stress test for a database infrastructure I am working with, and I am trying to profile it using callgrind. The program executes perfectly outside of valgrind and provides expected results.
However, when running it…

Thomas Russell
- 5,870
- 4
- 33
- 68