cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/24/08:50:26

From: "Ed Wallace" <WALLACE AT ami1 DOT md DOT essd DOT northgrum DOT com>
Organization: Northrop Grumman ESSD
To: djgpp AT delorie DOT com
Date: Fri, 24 Oct 1997 08:31:38 EDT
Subject: profiler in gcc
Message-ID: <180A294BC6@ami1.md.essd.northgrum.com>

There is a profiler built into the compiler.  Just compile and link 
with the -pg switch and run the program.  This creates a profile 
history in a file called gmon.out.
Then run gprof with your program and gmon.out as parameters to create 
a profile.
    gprof -z -b prog.exe gmon.out > savefile
    
    It is also possible to get a profile that lists every branch in 
your code by using the -a switch which creates a file called bb.out.

    Note however that you need the latest version of the libcc.a for 
the -a switch to work. (Hint: if you don't get a bb.out file its the 
wrong version).

- Raw text -


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