This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gprof inaccuracy



pardon the intrusion if this is not the appropriate forum, but i couldn't find one that seemed more appropriate.


i'm attempting to optimize a program that i didn't write and with which i'm not too familiar. i recompiled with the -pg flag and have been analyzing the output of gprof. i'm growing frustrated by it's apparent inaccuracy. can someone shed light on what i might be doing wrong? for example: total runtime for a test run of the program is 4 minutes. gprof tells me that nearly 48% of my time is spent in the function getAltCostTypeId():

Flat profile:

Each sample counts as 0.01 seconds.
 %   cumulative   self              self     total
time   seconds   seconds    calls  us/call  us/call  name
47.72      2.93     2.93    17021   172.14   172.14  getAltCostTypeId

----------------------------------------------------------------------
               2.93    0.00   17021/17021       main [1]
[2]     47.7    2.93    0.00   17021             getAltCostTypeId [2]
               0.00    0.00   17021/127895      toHead [63]
----------------------------------------------------------------------

i comment out the call to getAltCostTypeId(), recompile, rerun, and it still takes 3 minutes, 50 seconds to complete and not the ~2 minutes anticipated. how can i "accurately" identify my most costly blocks of code using the gnu tools?

thanks.

--

Regards,

Scott Dudley

SPAMMERSNEEDNTBOTHER



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]