User forums > Help

Re: How to profile? Me too.

(1/1)

er:
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

MortenMacFly:

--- Quote from: er on February 05, 2009, 03:40:07 am ---I realize this is an old post but my first time attempt to profile is very similar :

--- End quote ---
Please start a new thread next time and link to this one. Hijacking old threads is NO GOOD.


--- Quote from: er on February 05, 2009, 03:40:07 am ---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/

--- End quote ---
You need to run your application in order to have the file generated. We have a profiler plugin for the purpose of profiling btw...

er:
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.

er:
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?

 

Navigation

[0] Message Index

Go to full version