Profiling compiled macro in ROOT

Hello everybody,
I try to obtain profile information for functions compiled within ROOT by using ACLIC. I use the ROOT version 5.18/00. Under MacOs 10.3, all is ok. But things are becoming tricky when I do the same thing on Scientific Linux 4. Here is the procedure I follow.

  1. I build a standalone exec with the following command:

g++ -pg -o AnalyseProfile AnalyseProfile.C -Iroot-config --incdir root-config --glibs

  1. I run it


  1. I get the profile infos using “gprof”:

gprof AnalyseProfile > AnalyseProfile_macosx.profile (under MacOs 10.3)
gprof AnalyseProfile > AnalyseProfile_sl4.profile (under SL4)

I have joined the files used in this example. The functions in the MonTestProf.C are compiled using ACLIC and with the “-pg” option.
The result on the gprof command on MacOs 10.3 is in the AnalyseProfile_macosx.profile. All functions, including those present in MonTestProf.C are profiled. But on SL4 (AnalyseProfile_sl4.profile file), only the function calls from the main program are profiled. Could somebody explain me why I get a different behaviour and how I can get the correct profiling information under SL4?
Thanks for your help.


LPC Caen IN2P3/ENSICAEN/Universite de Caen
Boulevard du Marechal Juin

e-mail :
Tel : +33-(0)2-31-45-29-73
FAX : +33-(0)2-31-45-25-49
AnalyseProfile_sl4.txt (7.55 KB)
AnalyseProfile_macosx.txt (19.6 KB)
MonTestProf.C (403 Bytes)
AnalyseProfile.C (415 Bytes)


With -pg you cannot use a shared library, only an archive library.
I suggest using valgrind/cachegrind instead.


many thanks for your suggestion René