Questions tagged [callgrind]

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.

121 questions
8
votes
1 answer

Valgrind - callgrind Profiler : How to know which function is taking more time

I am trying to profile for certain executable using valgrind - callgrind tool. I have created annotated output using callgrind_annotate --auto=yes. The created output tells me about the Ir count , which as per my understanding is the number of times…
Ajay
  • 775
  • 5
  • 19
7
votes
1 answer

View gprof output in kcachegrind

How to view output of gprof in kcachegrind? Is here a converter from gcc's gmon.out into callgrind.out?
osgx
  • 90,338
  • 53
  • 357
  • 513
7
votes
1 answer

How can I get meaningful function names in callgrind output on OSX from the command line?

Goal: I would like to be able to analyze the output of callgrind (and later cachegrind too) and would like to see meaningful variable names when using the callgrind_annotate CLI. Prior Research: I am aware of the dsym flag in Valgrind…
user7184894
7
votes
2 answers

callgrind equivalent for java?

Is there a free callgrind equivalent for java? basically, i just need anything that gives me cycle counts or time spent for each method and function of my java code. i suppose i should mention i'm using mac, which means the eclipse thing below…
Tony Stark
  • 24,588
  • 41
  • 96
  • 113
7
votes
1 answer

Running Callgrind on simple R file

I want to use Callgrind to find bottlenecks in some complicated Rcpp code. Since I couldn't get it to work, I decided to write a simple R file instead, to make sure it was doing what it should. However, I still can't get it to work. My simple…
Jack13
  • 71
  • 1
6
votes
1 answer

How to understand the output of callgrind using Kcachegrind

When profiling the log Kcachegrind shows %of inclusive as 13.92%. Should it not be close to 100% as mentioned in the FAQ Q:1?? Here is the screenshot of the profile log
Ashwin
  • 1,942
  • 4
  • 30
  • 59
6
votes
2 answers

Profile shared object without recompiling main program

I currently am developing a shared lilbrary for loading into PostgreSQL (as C-Language functions, see here). Now I would like to profile the function in this library without recompiling PostgreSQL itself. I tried callgrind using valgrind…
Thilo
  • 8,827
  • 2
  • 35
  • 56
6
votes
2 answers

callgrind output in specific file

I want to redirect the output of callgrind to a file name call_grind.txt, but when ever I try to do that, a file is generated but there is no output inside that file. For example: valgrind --tool=callgrind --callgrind-out-file=/tmp/call_grind.txt…
sambit
  • 81
  • 2
  • 4
6
votes
1 answer

kcachegrind: there is no source available for the following function

I am trying to view the annotated source using $ valgrind --tool=callgrind ./myProgram followed by $ kcachegrind using Ubuntu 12.04 (and I'm having the same problem with $ qcachegrind using Mac OSX). The C++ script myProgram.cpp makes calls to…
Tom Stephens
  • 475
  • 4
  • 15
6
votes
3 answers

Callgrind inlined functions

I am profiling my code and I already found the most expensive part of it. However it happens in an inlined function. To measure the impact I had forced the function to be not inlined. Now I would like to report accurate profiling data. Without the…
ypnos
  • 50,202
  • 14
  • 95
  • 141
5
votes
1 answer

Callgrind main() inclusive cost much smaller than 100%

I profiled a few very simple C++ programs running on Linux. The inclusive cost of main() for all of them is far from 100%, something like 3.83%. Am I using callgrind correctly? I have the output of callgrind_annotate with --inclusive=yes pasted…
Shawn
  • 51
  • 4
5
votes
1 answer

kcachegrind unable to open callgrind file

I'm using callgrind to profile a small piece of code. Callgrind output files are well generated, their content looks ok, but I'm unable to open them with kcachegrind: I get the following error message: Could not open file "callgrind.out.4953".…
Greg82
  • 1,000
  • 3
  • 10
  • 24
5
votes
0 answers

Why does Valgrind hang on SDL_Init (SDL2) call?

I am trying to use Callgrind to monitor cache usage in an SDL2 application, but it hangs on the SDL_Init call - EDIT: To clarify, Valgrind hangs, there is no further output from my program, Valgrind appears to be stuck in limbo waiting for the…
g0wen
  • 51
  • 3
5
votes
2 answers

How to use KCachegrind and Callgrind to measure only parts of my code?

I want to use valgrind to analyze my code. The problem is, that I have a huge startup sequence which I'm not interested in. I found defines in the valgrind/callgrind.h that should help…
FrozenTarzan
  • 834
  • 10
  • 30
5
votes
2 answers

How do I get callgrind to dump source line information?

I'm trying to profile a shared library on GNU/Linux which does real-time audio processing, so performance is important. I run another program which hooks it up to the audio input and output of my system, and profile that with callgrind. Looking at…
Jeremy Salwen
  • 8,061
  • 5
  • 50
  • 73
1
2
3
8 9