Valgrind
Example commands:
- valgrind –tool=callgrind a.out
- callgrind_annotate -auto=yes callgrind.out.1485
- kcachegrind output-file [?]
gprof
gprof is on wikipedia: https://en.wikipedia.org/wiki/Gprof
Example of profiling hd_root:
git clone git@github.com:jeffersonlab/halld_recon
cd halld_recon
cd src
gxenv
git checkout pasteurize_rebased_mmi
scons -u install PROFILE=1 -j16
cp $HALLD_VERSIONS/version_fedora33.xml .
e version_fedora33.xml # edit to use this version of halld_recon
gxenv version_fedora33.xml
hd_root -PPLUGINS=danarest -PEVENTS_TO_KEEP=1000 /data/gluex/rawdata/hd_rawdata_030300_001.evio
gprof `which hd_root` >& gprof.txt
lw gprof.txt
- jana, halld_recon, and halld_sim all accept the PROFILE=1 option to scons
- throwing the -pg switch can have an effect on execution speed according to this.
- This example gives the “no time accumulated” error.