News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Re: How to profile? Me too.

Started by er, February 05, 2009, 03:40:07 AM

Previous topic - Next topic

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
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

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 :
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/
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

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.
Code::Blocks 10.05/ Mac OS X 10.6.4/GCC

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?

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