This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: profiling of contained procedures
Hi,
Steve Kargl wrote:
> Something broken in linux
>
Maybe but it also depends on the options.
If I use
gfortran -o z -pg -O0 -fno-inline test.f90
./a.out > /dev/null
gprof a.out
I get only:
time seconds seconds calls ms/call ms/call name
101.66 0.08 0.08 1 81.33 81.33 MAIN__
Using:
gprof -b -l a.out
time seconds seconds calls Ts/call Ts/call name
88.95 0.07 0.07 contained
(test.f90:7 @ 40099c)
12.71 0.08 0.01 contained
(test.f90:6 @ 4009f3)
0.00 0.08 0.00 1 0.00 0.00 MAIN__ (test.f90:1
@ 400958)
Still, your FreeBSD gives more information about the library calls:
> % cumulative self self total
> time seconds seconds calls ms/call ms/call name
> 43.0 4.99 4.99 10000000 0.00 0.00 sigprocmask [2]
> 36.0 9.18 4.19 0 100.00% _mcount [3]
> 8.4 10.16 0.98 0 100.00% .mcount (20)
> 2.7 10.48 0.32 0 100.00% memcpy [4]
> 2.0 10.71 0.23 0 100.00% memset [6]
> 1.6 10.89 0.18 1 181.68 181.68 pthread_mutex_unlock_exp [
> 1.4 11.05 0.16 0 100.00% pthread_mutex_lock [9]
> 1.3 11.20 0.15 1 151.65 151.65 contained.1240 [11]
> 1.3 11.35 0.15 0 2.83% setjmp [1]
>
In addition, the annotation of the lines does not work:
gprof --annotated-source -x -b -l a.out
*** File /dev/shm/test.f90:
1 -> PROGRAM test_prof
1 -> CALL contained()
CONTAINS
SUBROUTINE contained()
INTEGER :: i
1 -> DO i = 1, 10000000
1 -> WRITE(*,*) "contained"
END DO
END SUBROUTINE
END PROGRAM
Top 10 Lines:
Line Count
1 1
(This is openSUSE 10.2b2 on amd64)
Tobias