Author Topic: Profiling with Valgrind-callgrind  (Read 2820 times)


  • Full Member
  • ***
  • Posts: 137
Profiling with Valgrind-callgrind
« on: October 24, 2021, 03:20:07 pm »
I am trying to profile a Lazarus application with valgrind, callgind and kcachegrind using for instance
  valgrind --tool=callgrind --dump-instr=yes --collect-jumps=yes ./matrixtest
and kcachegrind to evaluate the result.
KCachegrind doesnt show me the names of my functions nor their source in the callgraph but of many of the Lazarus unit-files.
KCachegrind also tells me:

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

The KCachegrind Configuration however says:

Context lines in annotations:
Source Folders
Object / Related Source Base

My Lazarus project options are:


What can I do?


  • Administrator
  • Hero Member
  • *
  • Posts: 7892
  • Debugger - SynEdit - and more
    • wiki
Re: Profiling with Valgrind-callgrind
« Reply #1 on: October 24, 2021, 03:31:29 pm »
FPReadPNM is a unit in the RTL.

This is part of fpc (the fpc installation). Lazarus does not recompile this.
You need to rebuild the RTL with debug info. (dwarf)


  • Full Member
  • ***
  • Posts: 137
Re: Profiling with Valgrind-callgrind
« Reply #2 on: October 24, 2021, 08:15:17 pm »
but how do I do that?


TinyPortal © 2005-2018