www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How do you profile your apps under windows?

reply Alexandr Druzhinin <drug2004 bk.ru> writes:
-profile switch doesn't work for me (nothing happens), so I'm curious 
how to profile?
Aug 09 2013
next sibling parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
09-Aug-2013 20:39, Alexandr Druzhinin пишет:
 -profile switch doesn't work for me (nothing happens), so I'm curious
 how to profile?
My take is to compile with -g and use say AMD CodeAnalyst (or Intel's analog). Works quite well even though all symbols are mangled. With -profile the app usually outputs trace.log somewhere in the folder launched. -- Dmitry Olshansky
Aug 09 2013
prev sibling next sibling parent reply "Gary Willoughby" <dev nomad.so> writes:
On Friday, 9 August 2013 at 16:39:41 UTC, Alexandr Druzhinin 
wrote:
 -profile switch doesn't work for me (nothing happens), so I'm 
 curious how to profile?
I had the same problem on Linux where -profile didn't seem to produce anything. I had a program which ran an infinite loop running as a daemon. When compiled and run using -profile i'd let it run for a bit then kill it and nothing was produced. After much head scratching i implemented a timer in the program that only ran in debug mode and after the timer expired i raised an assert fail: assert(false); This exited the program and produced the trace file which i could then examine. I guess killing the process also killed the profiler and so never gave me the report.
Aug 09 2013
parent Alexandr Druzhinin <drug2004 bk.ru> writes:
10.08.2013 01:30, Gary Willoughby пишет:
 On Friday, 9 August 2013 at 16:39:41 UTC, Alexandr Druzhinin wrote:
 -profile switch doesn't work for me (nothing happens), so I'm curious
 how to profile?
I had the same problem on Linux where -profile didn't seem to produce anything. I had a program which ran an infinite loop running as a daemon. When compiled and run using -profile i'd let it run for a bit then kill it and nothing was produced. After much head scratching i implemented a timer in the program that only ran in debug mode and after the timer expired i raised an assert fail: assert(false); This exited the program and produced the trace file which i could then examine. I guess killing the process also killed the profiler and so never gave me the report.
Tried this approach but the app hangs up somewhere in druntime code after my code execution finished.
Aug 11 2013
prev sibling next sibling parent "Richard Webb" <webby beardmouse.org.uk> writes:
The Very Sleepy profiler works ok (if you run the apps through 
cv2pdb to get the debug symbols in the right format at least)
Aug 09 2013
prev sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, Aug 09, 2013 at 11:39:41PM +0700, Alexandr Druzhinin wrote:
 -profile switch doesn't work for me (nothing happens), so I'm
 curious how to profile?
You've to run your program first. It will create a bunch of extra files in your current working directory that contains the profile results. T -- A bend in the road is not the end of the road unless you fail to make the turn. -- Brian White
Aug 09 2013
parent Alexandr Druzhinin <drug2004 bk.ru> writes:
10.08.2013 00:59, H. S. Teoh пишет:
 On Fri, Aug 09, 2013 at 11:39:41PM +0700, Alexandr Druzhinin wrote:
 -profile switch doesn't work for me (nothing happens), so I'm
 curious how to profile?
You've to run your program first. It will create a bunch of extra files in your current working directory that contains the profile results. T
Of course I run the program first. When the program was simpler it worked fine. But at the some moment I tried to profile it again but there were no profile results generated. More over now my app just hangs up after finishing (my code) execution somewhere in druntime kingdom. To try gprof I installed ubuntu 12.04 (newer versions didn't install from flushdisk) and also installed gdc-4.8 ("native" gdc-4.6 doesn't compile my code) from a package (compiling gdc from source fails, playing with configure options just wasted several hours of my spare time) and even build my app and became exciting that now I would get opportunity to profile using gprof but my app just crashed with dumping without any informative message. I tried to use gdb (I'm a noob with it) and found that it crashed somewhere about exit from static ctors - I'm not sure I interpreted gdb output correctly. So now I have a choice - to wait when good and smart guys solve these problems either with dmd -profile or gdc code generating and try to work around myself - probably gdc codegen isn't the real reason. Here I'm sitting and making decision what to do further... But nevertheless thanks to all who made the universe more beautiful and handy by means of D language and its infrastructure! Thank you guys!
Aug 11 2013