Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

inaccuracy of gprof

0 views
Skip to first unread message

Scott Dudley

unread,
Mar 10, 2003, 7:37:14 PM3/10/03
to

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 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. this has happened repeatedly. how can i "accurately"
identify my most costly blocks of code using the gnu tools?

thanks.

--

Note: Remove nospam. from email address to respond.

0 new messages