Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Profiling code
@ 1996-02-18  5:00 Brian Field
  1996-02-20  5:00 ` Greg Lueck Development Environment
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Field @ 1996-02-18  5:00 UTC (permalink / raw)


I've got some code that I'm attempting to profile.  I'd like to get
information on which lines/basic blocks are contributing most towards
run-time.  To get this information, I've been following the instructions
listed in the prof (1) man page:

       cc -c myprog.c
       cc -o myprog myprog.o
       pixie -o myprog.pixie myprog            (generates myprog.Addrs)
       myprog.pixie                            (generates myprog.Counts)
       prof -pixie myprog myprog.Addrs myprog.Counts


This works fine if I want to look at the profiling results at the procedure
level, but when I specify the -heavy or -lines option, I don't get a break
down by basic block / line.  I'm compiling without the -p option (as specified
by prof (1) ).

So, what am I doing wrong?

This is on a 3.2C DU 2100/500 box.  We don't have man pages loaded for 3.2C,
so I've been using the man pages from a 2.1 OSF box... :-/

Thanks
Brian



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Profiling code
  1996-02-18  5:00 Profiling code Brian Field
@ 1996-02-20  5:00 ` Greg Lueck Development Environment
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Lueck Development Environment @ 1996-02-20  5:00 UTC (permalink / raw)



You are correct that the pixie profiler counts basic blocks to determine
an application's profile.  However, the prof command does not provide a
mechanism for viewing the raw basic block data.  You can view the
profile by procedure, source line, or assembly instruction only.

It sounds like you already have a procedure profile of your application.
You can view an assembly level profile by passing the "-asm" switch to the
profiler.  For example:

	% prof -pixie -asm myprog myprog.Addrs myprog.Counts

Since this output is so voluminous, it is often useful to limit it to a
few procedures with the "-only" switch.

You can view a source line level profile by passing either the "-lines"
or the "-heavy" switches.  For example:

	% prof -pixie -lines myprog myprog.Addrs myprog.Counts

In order for this to work, you must make sure the application was
compiled with debug level "-g1", "-g2", or "-g3".  Probably "-g1" is
what you want.  It allows all optimizations, but includes minimal
symbolic information too.  If you do not compile with a -g switch, the
compiler does not include source line information in the object file,
and the profiler is unable to display source line information.  If you
only want source line information for a few procedures, it is valid to
just compile those procedures with "-g1".

Since you do not have the V3.2C manpages loaded, you may be unaware of
the "-truecycles" switch, which may be of interest to you.  This switch
causes the profiler to include the effect of pipeline stalls in its
cycle counts.  Here is the description from the manpage:

  -truecycles [0,1,2]
      Use this flag only with the -pixie flag.  Generates more analysis of a
      program to provide a more accurate reading of cycles. The higher the
      number chosen from the arguments, the more accurate the reading,
      although the profiler will run slower. This flag is valid only in
     -pixie mode.

I hope this information is of use to you and your analysis.

-- 
-------------------------------------------------------------------------------
Greg Lueck                              Opinions expressed herein are my own.
lueck@zk3.dec.com
-------------------------------------------------------------------------------
-- 
-------------------------------------------------------------------------------
Greg Lueck                              Opinions expressed herein are my own.
lueck@zk3.dec.com
-------------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-02-20  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-02-18  5:00 Profiling code Brian Field
1996-02-20  5:00 ` Greg Lueck Development Environment

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox