The documentation for GNU gprof 2.16.1, eg. the info page "5.4 The Annotated Source Listing", gives an example of annotated C source with line-by-line execution information from basic block counting. From the documentation it is unclear whether this should work with compilers for other languages, eg. g77, g95. If I compile, execute and profile a Fortran program, test.f90 using g95 -g -pg test.f90 ./a.out gprof -l -A ./a.out it reports that only the first line of each function has executed. For example, 29328 -> function ranorm() real rand a=0. do 999 ii=1,16 call random_number(rand) 999 a=rand+a a = a-8.0 a = a*0.866 ranorm=a call random_number(rand) a=rand return end Using gprof -l -A -x ./a.out reports that each line of a function has the executions the same number of times, regardless of loops. For example, 29328 -> function ranorm() real rand 29328 -> a=0. 29328 -> do 999 ii=1,16 29328 -> call random_number(rand) 29328 -> 999 a=rand+a 29328 -> a = a-8.0 29328 -> a = a*0.866 29328 -> ranorm=a 29328 -> call random_number(rand) 29328 -> a=rand return end The version of g95 used in these examples is gcc version 4.0.3 (g95!) May 2 2006 I can post other examples if necessary.
-- Summary: Should gprof -l -A work with languages other than C? Where is this documented? Product: binutils Version: 2.16 Status: NEW Severity: normal Priority: P2 Component: gprof AssignedTo: unassigned at sources dot redhat dot com ReportedBy: paul dot leopardi at usyd dot edu dot au CC: bug-binutils at gnu dot org GCC host triplet: i386-redhat-linux http://sourceware.org/bugzilla/show_bug.cgi?id=2704 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils