[Dev-C++] Bug - Profiling [was: Profiling a proyect, how?]
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Luigi S. <gi...@li...> - 2003-08-06 04:40:59
|
On Sat, Aug 02, 2003 at 05:31:44PM +0200, Ricardo Amores Hern?ndez wrote:
> Hi
> How can i use the profiler in Dev C++ ? I check the correct linker
> options ('generate debug information' and 'generate profiling
> information' too) both in the proyect options and compiler options (just
> to make sure ;)
> But after building successfully my app I get the following messege when
> I choose "Profiler Analysis" from Compile Menu:
> "Please run the proyect at least once so that profiling info is
> generated..."
>
> And yes, I´ve run my proyect not once but n-times and i still get the error.
> [...]
Hello Ricardo,
you have not specified which version of Dev-C++ your are using,
neither you tell about which profiling program you wish to use;
I will assume Dev-C++ 4.9.8.1 and gprof shipped with MinGW Gcc 3.2.
I tried myself to profile an application (using 4.9.8.1) and have
come to the conclusion that there is a bug in the options Dev-C++
adds to the linker when you enable profiling. In fact, while it
does correctly pass the "-pg" option to the compiler, it does not
do so when linking, instead it passes the option "-lmon" (which
should mean: link against "libmon.a"), that seems useless here.
Now, when you run the executable generated by Dev-C++, the call
graph profile file ("gmon.out") is not created. This, I think, is
the reason why Dev-C++ keeps asking you to run your application over
and over again, as you try to profile it.
Until the bug is fixed, a way to achieve profiling could be:
- avoid enabling the linker flags for profiling (so you won't have
the "-lmon" added to the linker flags)
- go to "Project"->"Project Options": "Parameters" tab and manually
add "-pg" to the linker flags
then, as usual, compile your application, run it (just one is enough
to create "gmon.out") and finally use "Execute->profile analysis".
If you need more information about profiling (with gprof), I suggest
reading the material found at the link:
www.delorie.com/gnu/docs/binutils/gprof_toc.html
Regards
--
>> gisan >>
P.S. I don't remember if there is a specif address for bug reports,
I hope the list will let me know it, so that I can forward this
message; in the meanwhile, I hope the authors of Dev-C++ monitor
this list.
|