[comp.sys.sgi] profiling woes, prof has changed???

dan@omega.chem.yale.edu (Dan Severance) (05/26/91)

   Hi,
     I've been using pixie to profile my files for a long time now.
I recently tried it, and when time came to use prof -pixie file,
I get:  (twnew is the mainline, wpot is the only subroutine)
   prof -pixie bestc 

wpot_ is an alternate entry within twnew_ (bestc.f) 

----------------------------------------------------------------------------
*  -p[rocedures] using basic-block counts;                                 *
*  sorted in descending order by the number of cycles executed in each     *
*  procedure; unexecuted procedures are excluded                           *
----------------------------------------------------------------------------

255733799 cycles

    cycles %cycles  cum %     cycles  bytes procedure (file)
                               /call  /line

 156061559   61.03  61.03  156061559     34 twnew_ (bestc.f)
  91665000   35.84  96.87         35      5 sqrt (sqrt.s)
   7994250    3.13  99.99         19     12 d_sign (d_sign.c)
etc...

      wpot is responsible for ~60% of the CPU time, but everything
is now glommed into the mainline.  Programs with more subroutines
do the same thing, the mainline is assigned the sum of all of the
individual routine times.  I used to get a nice breakdown of
individual routine percentages.
      I can get the procedure numbers from pixstats, but what I
really want is the h[eavy profile, which pixstats wont give.
What has changed?  Is this a bug or a feature? 
    Thanks In Advance
       Dan Severance

   The machine is a 4D-25G , hinv gives:

1 20 MHZ IP6 Processor
FPU: MIPS R2010A/R3010 VLSI Floating Point Chip Revision: 2.0
CPU: MIPS R2000A/R3000 Processor Chip Revision: 2.0
Data cache size: 32 Kbytes
Instruction cache size: 64 Kbytes
Main memory size: 16 Mbytes
Integral Ethernet controller: Version 0
Graphics board: GR1.2 Bit-plane, Z-buffer options installed
Integral SCSI controller 0: Version WD33C93A
Tape drive: unit 2 on SCSI controller 0: QIC 150
Disk drive: unit 1 on SCSI controller 0

-------------------------------------------------------------------
Dan Severance                         dan@omega.chem.yale.edu
Laboratory of Computational Chemistry
Yale university                       (203)432-6288
New Haven, CT 06511
-------------------------------------------------------------------

dhinds@elaine18.Stanford.EDU (David Hinds) (05/26/91)

In article <1991May25.220250.11321@cs.yale.edu> dan@omega.chem.yale.edu (Dan Severance) writes:
>
>   Hi,
>     I've been using pixie to profile my files for a long time now.
>I recently tried it, and when time came to use prof -pixie file,
>I get:  (twnew is the mainline, wpot is the only subroutine)
>   prof -pixie bestc 
>
>wpot_ is an alternate entry within twnew_ (bestc.f) 
>
     I haven't done this with Fortran, but I presume this means that the
subroutine has been inlined and no longer exists as a separate entity.
Because other optimizations may obscure the boundary between the original
code in the main program and the subroutine, it may not be possible to
separate out the time spent in an inlined routine.  In any case, I guess
pixie can't look at the executable and figure out that wpot was once a
separate routine.  I've gotten used to seeing funny things in profiles
of fully optimized code, like single lines of source that generate 600
bytes of code as a result of inlining.  How to avoid this?  Put another
call to this subroutine somewhere else in your program, where it won't
ever be executed (but not so the compiler can figure that out).  Or even
put a recursive call in (also so it will never execute).  These should
force the compiler to not inline the routine.  You'll get a slightly non-
optimal profile, but it should be OK if all you are interested in is the
time spent in the routine itself.

 -David Hinds
  dhinds@cb-iris.stanford.edu