gcc compiling for profiler question

Discussion in 'C Programming' started by Boltar, Jan 30, 2008.

  1. Boltar

    Boltar Guest

    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
     
    Boltar, Jan 30, 2008
    #1
    1. Advertising

  2. Boltar

    Boltar Guest

    On 30 Jan, 09:30, Boltar <> 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
     
    Boltar, Jan 30, 2008
    #2
    1. Advertising

  3. Boltar

    fnegroni Guest

    You must run the program once before the output is generated.
    Same as gcov.
     
    fnegroni, Jan 30, 2008
    #3
  4. Boltar

    Boltar Guest

    On 30 Jan, 10:21, fnegroni <> 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
     
    Boltar, Jan 30, 2008
    #4
  5. Boltar

    CBFalconer Guest

    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
     
    CBFalconer, Jan 31, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig
    Replies:
    2
    Views:
    440
    Craig
    Jan 21, 2004
  2. Replies:
    8
    Views:
    443
  3. Kevin P. Fleming

    C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1

    Kevin P. Fleming, Nov 6, 2003, in forum: C Programming
    Replies:
    2
    Views:
    657
    Kevin P. Fleming
    Nov 6, 2003
  4. Replies:
    5
    Views:
    371
    Nathan Addy
    Sep 17, 2005
  5. potatosoftware
    Replies:
    0
    Views:
    668
    potatosoftware
    Nov 4, 2009
Loading...

Share This Page