Getting Source Annotation in KCachegrind

2.1k Views Asked by At

I'm trying to view source code associated with the executable lab13. When I click the Source tab in KCachegrind, all I see is the following:

There is no source available for the following function:
    'main'
This is because no debug information is present.
Recompile source and redo profile run.
The function is located in this ELF object:
    'lab13'

However, I am using the -g debugging flag in my makefile:

lab13:main.o
    g++ -g main.o -o lab13
    ./lab13

main.o:main.cpp EdgeArray.h Edge.h DisjointSets.h Matrix.h experiment.h
    g++ -c -g main.cpp

I created the callgrind.out file using the following call to valgrind:

valgrind --tool=callgrind --dsymutil=yes ./lab13 

I looked at the KCachgrind documentation, but there is no information on how to activate the Source tab feature.

I compiled the program on OSX and am running KCachgrind via X11. I am reading the callgrind.out file from the same directory as the code. All other KCachgrind features appear to work.

How do I get the Source tab working?

1

There are 1 best solutions below

0
On

You should look for the "fl=" lines in the profile (cf) and make sure the source files are available under the paths given in the "fl=" lines.