f



gcc compiling for profiler question

Hi

I'm trying to create a gmon.out file with gcc so I can run my program
through gmon. However the -pg option doesn't seem to work. Is there a
trick to generating this file?

Thanks for any help

B2003
0
boltar2003 (257)
1/30/2008 9:30:10 AM
comp.lang.c 30657 articles. 4 followers. spinoza1111 (3246) is leader. Post Follow

4 Replies
343 Views

Similar Articles

[PageSpeed] 30

On 30 Jan, 09:30, Boltar <boltar2...@yahoo.co.uk> wrote:
> Hi
>
> I'm trying to create a gmon.out file with gcc so I can run my program
> through gmon. However the -pg option doesn't seem to work. Is there a
> trick to generating this file?

I meant gprof , not gmon.

B2003

0
boltar2003 (257)
1/30/2008 9:40:10 AM
You must run the program once before the output is generated.
Same as gcov.
0
1/30/2008 10:21:25 AM
On 30 Jan, 10:21, fnegroni <f.e.negr...@googlemail.com> wrote:
> You must run the program once before the output is generated.
> Same as gcov.

Works now. I assumed it ran the prog in situ like gdb.

Thanks

B2003
0
boltar2003 (257)
1/30/2008 11:32:03 AM
Boltar wrote:
> 
> I'm trying to create a gmon.out file with gcc so I can run my
> program through gmon. However the -pg option doesn't seem to work.
> Is there a trick to generating this file?

Look up gprof (either "man gprof" or "info gprof" or both).  This
is off-topic on c.l.c.

-- 
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: <http://cbfalconer.home.att.net>
            Try the download section.



-- 
Posted via a free Usenet account from http://www.teranews.com

0
cbfalconer (19194)
1/31/2008 2:11:45 AM
Reply: