Home » Infrastructure » Linux » GPROF tool information
GPROF tool information [message #153568] Tue, 03 January 2006 03:31 Go to next message
sunanda
Messages: 6
Registered: January 2006
Location: Bangalore
Junior Member

Do anybody is having knowledge about GPROF.. Its a tool to identify in ur program which functrion or block is utilizing more time.
I wanna know about the 2 files created(gmon.out and gmon.sum) while running program using gprof tool..
more description of the 2 files generated.
u can utilize this tool in redhat Linux.

Thanks in advance.
regards
sunanda
Re: GPROF tool information [message #153573 is a reply to message #153568] Tue, 03 January 2006 03:46 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member
An excerpt from manual pages
DESCRIPTION
"gprof"  produces  an  execution profile of C, Pascal, or 
Fortran77 programs.  The effect of called routines is     incorporated in the profile of each caller.The profile data is
taken  from  the  call  graph  profile  file (gmon.out default)
which is created by programs that are compiled with the -pg
option of "cc", "pc", and "f77".The -pg option also links in
versions of the library routines that are compiled for 
profiling.   "Gprof"  reads the  given  object  file (the 
default is "a.out") and establishes the relation between its 
symbol table and the call graph profile from gmon.out.  If more 
than one profile file is specified, the "gprof" output shows the 
sum of the profile information in the given profile files.


@Sunanda

Did you try reading manual pages for the command??
if not, do this
 $ man gprof 


And this is purely Oracle/linux Forum so better to post your doubts on any Linux/Unix(OS) forum. Probably there you will get frequent responses.

[Updated on: Tue, 03 January 2006 03:46]

Report message to a moderator

Re: GPROF tool information [message #153594 is a reply to message #153568] Tue, 03 January 2006 04:57 Go to previous messageGo to next message
vijaya2006
Messages: 3
Registered: January 2006
Junior Member
hi,
GPROF is basically a profiling tool.It tells u how much time u hav spent in each of the larger functions.There are some commands to run this.But b4 that u need to make your executable a profiling one.
eg>>If a.out is ur default exe file
then ->a.out -pg
u will get a gmon.out file.
Then run the command as:
gprof option [.exe file[gmon.out]]>textfile

If u run the above command u will get gmon.sum file.
The results can be seen in the generated file...try it out.U can see flatview of the output
Re: GPROF tool information [message #153595 is a reply to message #153594] Tue, 03 January 2006 05:01 Go to previous message
sunanda
Messages: 6
Registered: January 2006
Location: Bangalore
Junior Member

Thanks a lot trun and vijaya.
I have generated both the files gmon.out and gmon.sum
but i have not understood the columns given in both files..
cud u be very clear with those columns in the file.

thanks n regards
sunanda
Previous Topic: scripts behave differently
Next Topic: Install Oracle9i on SUSE 10
Goto Forum:
  


Current Time: Tue May 28 08:06:01 CDT 2024