Author Topic: Re: How to profile? Me too.  (Read 3109 times)

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: How to profile? Me too.
« on: February 05, 2009, 03:40:07 am »
Hello,

I realize this is an old post but my first time attempt to profile is very similar :

main.cpp:
#include <iostream>
using namespace std;
int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

-------------- Build: Debug in test_profiler ---------------

g++ -Wall -fexceptions  -pg -g    -I/usr/local/boost_1_37_0  -c /Users/erwann/dev/cpp/libs/test_profiler/main.cpp -o obj/Debug/main.o
g++  -o bin/Debug/test_profiler obj/Debug/main.o   -pg 
Output size is 13.97 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
I run the above fine, but it does not generate a gmon.out file anywhere in the tree rooted at  /Users/erwann/dev/cpp/libs/test_profiler/

Please help.

i686-apple-darwin9-gcc-4.0.1
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How to profile? Me too.
« Reply #1 on: February 05, 2009, 09:12:47 am »
I realize this is an old post but my first time attempt to profile is very similar :
Please start a new thread next time and link to this one. Hijacking old threads is NO GOOD.

I run the above fine, but it does not generate a gmon.out file anywhere in the tree rooted at  /Users/erwann/dev/cpp/libs/test_profiler/
You need to run your application in order to have the file generated. We have a profiler plugin for the purpose of profiling btw...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: How to profile? Me too.
« Reply #2 on: February 05, 2009, 08:23:50 pm »
Thanks for taking care of the new thread. Will do next time.

Run the application to have the file generated: A search for *.out on my mac returned nothing.

I'm aware of the pluging: the plugin asks for a gmon.out file, which is not generated.
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

Offline er

  • Multiple posting newcomer
  • *
  • Posts: 34
Re: How to profile? Me too.
« Reply #3 on: February 06, 2009, 09:04:14 pm »
I'm told that there are problems with -pg under Mac OS, but that shark, another profiler, works fine?

Any similar experiences?

Can I set up CodeBlocks to interface with shark?

 
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC