Recent

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

hakelm

  • Full Member
  • ***
  • Posts: 130
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:
'FPREADPNC$_$TFPREADERPNG_$
$$_DODECOMPRESS'
This is because no debug information is present.
Recompile source and redo the profile run.
The function is located in this ELF object:
'matrixtest'

The KCachegrind Configuration however says:

General
Annotations
Context lines in annotations:
Source Folders
Object / Related Source Base
(always)
/dok/ny/p/hep/test/matrix/matrixtest
/lib/x86_64-linux-gnu/ld-2.23.so
/lib/x86_64-linux-gnu/libc-2.23.so
/lib/x86_64-linux-gnu/libdbus-1.so.3.14.6
/lib/x86_64-linux-gnu/libdl-2.23.so
......

My Lazarus project options are:

l
-vewnhibq
-Filib/x86_64-linux
-Fu/E/ny/p/hep/helib
-Fu/E/ny/p/hep/lib
-Fu/usr/local/share/lazarus/lcl/units/x86_64-linux/gtk2
-Fu/usr/local/share/lazarus/lcl/units/x86_64-linux
-Fu/usr/local/share/lazarus/components/lazutils/lib/x86_64-linux
-Fu/usr/local/share/lazarus/packager/units/x86_64-linux
-Fu.
-FUlib/x86_64-linux
-FE.
-omaxwelltest
-dLCL
-dLCLgtk2

What can I do?
H

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 7508
  • 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)

hakelm

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

 

TinyPortal © 2005-2018