delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/11/19:02:43

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: code coverage tool
Date: Wed, 10 Dec 1997 20:33:46 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 31
Message-ID: <348EFCAA.2281@cs.com>
References: <66n156$g0b AT news DOT microsoft DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp225.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

john bartkiw wrote:
> 
>     Anyone know of a tool with DKGPP which will give me code coverage
> information about a program.  IE which functions get called how many times
> for how much proccessor time.
> 
>     I basically want to optimize my code and want to see where I'm using my
> clock cycles.

The tool you are looking for is called a profiler, and DJGPP (note
correct spelling) does indeed come with one.  It's called "gprof" (for
GNU Profiler), and comes with the GNU Binutils, which are part of a
standard DJGPP installation.  Basic usage of gprof:

 - Compile _and_ link your program using the "-pg" option.
 - Run your program for long enough to generate a sample.
 - Run "gprof" on your program and capture the output.

The DJGPP FAQ (v2/faq210b.zip from SimTel or online at
http://www.delorie.com/djgpp/v2faq/) has a complete chapter devoted to
profiling.  I suggest you read it.

hth

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | A singer in a smoky room / Smell of  |
|       aka Fighteer I       | wine and cheap perfume / For a smile |
|   mailto:fighteer AT cs DOT com   | they can share the night / It goes   |
| http://www.cs.com/fighteer | on and on and on...                  |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019