From owner-freebsd-current Wed Oct 23 13:42:28 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA09972 for current-outgoing; Wed, 23 Oct 1996 13:42:28 -0700 (PDT) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.54]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA09967 for ; Wed, 23 Oct 1996 13:42:25 -0700 (PDT) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.7.6/8.7.3) id NAA05182 for freebsd-current@freebsd.org; Wed, 23 Oct 1996 13:42:55 -0700 (PDT) From: "Steven G. Kargl" Message-Id: <199610232042.NAA05182@troutmask.apl.washington.edu> Subject: Is profiling code broken? To: freebsd-current@freebsd.org Date: Wed, 23 Oct 1996 13:42:54 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In my battle to increase the speed of some of my computations, I will compile the code with profiling enabled. Today, to my surprise my code seems to be executing infinitely fast. This is on a -current machine that was last build on 9 Oct 96. I'm in the process of doing a make world on freshly supped sources. For those who are programming language impaired, this is Fortran :-). program t implicit none double precision x, f integer i, j external f do 1 i =1, 1000 do 2 j = 1, 1000 x = f(dble(i)) 2 continue 1 continue end double precision function f(x) double precision x integer i do 3 i = 1, 100 f = x / 2.d0 3 continue return end kargl[264] f77 -o t -pg t.f kargl[265] time t 59.80 real 0.00 user 48.34 sys kargl[266] gprof -l -b t gmon.out | more granularity: each sample hit covers 4 byte(s) no time accumulated % cumulative self self total time seconds seconds calls ms/call ms/call name 0.0 0.00 0.00 1000000 0.00 0.00 _f_ [11] 0.0 0.00 0.00 6 0.00 0.00 _sigaction [12] 0.0 0.00 0.00 6 0.00 0.00 _signal [13] 0.0 0.00 0.00 5 0.00 0.00 ___syscall [14] 0.0 0.00 0.00 4 0.00 0.00 ___sseek [15] 0.0 0.00 0.00 4 0.00 0.00 _ftell [16] 0.0 0.00 0.00 4 0.00 0.00 _imalloc [17] 0.0 0.00 0.00 4 0.00 0.00 _ioctl [18] 0.0 0.00 0.00 4 0.00 0.00 _isatty [19] 0.0 0.00 0.00 4 0.00 0.00 _lseek [20] 0.0 0.00 0.00 4 0.00 0.00 _sbrk [21] 0.0 0.00 0.00 4 0.00 0.00 _tcgetattr [22] 0.0 0.00 0.00 3 0.00 0.00 ___sflush [23] There appears to be about 11 seconds missing from the time command that should be accounted for by gprof. Additionally, I noticed that the profiled libraries built during a make world use a -p flag instead of -pg. Why? We do not currently have prof(1) in the source tree. -- Steve