www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Does -profile need the D runtime?

reply =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench saphirion.com> writes:
I want to profile my windows app which has a WinMain(). One of the 
first statements in WinMain() within a try{} is:

Runtime.initialize();

But when I compile my app with -profile, it crashes on entry of 
WinMain(). Looks like this function is instrumented with code, that 
might need the D runtime. Is this the case?

Is there a way to flag specific functions as "don't profile"?

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster
May 18 2019
parent reply Stefan Koch <uplink.coder googlemail.com> writes:
On Saturday, 18 May 2019 at 16:35:44 UTC, Robert M. Münch wrote:
 I want to profile my windows app which has a WinMain(). One of 
 the first statements in WinMain() within a try{} is:

 Runtime.initialize();

 But when I compile my app with -profile, it crashes on entry of 
 WinMain(). Looks like this function is instrumented with code, 
 that might need the D runtime. Is this the case?

 Is there a way to flag specific functions as "don't profile"?
yes profiling does relay on druntime being present. There is currently no such thing as "don't profile"
May 18 2019
parent =?iso-8859-1?Q?Robert_M._M=FCnch?= <robert.muench saphirion.com> writes:
On 2019-05-18 17:46:52 +0000, Stefan Koch said:

 On Saturday, 18 May 2019 at 16:35:44 UTC, Robert M. Münch wrote:
 I want to profile my windows app which has a WinMain(). One of the 
 first statements in WinMain() within a try{} is:
 
 Runtime.initialize();
 
 But when I compile my app with -profile, it crashes on entry of 
 WinMain(). Looks like this function is instrumented with code, that 
 might need the D runtime. Is this the case?
 
 Is there a way to flag specific functions as "don't profile"?
yes profiling does relay on druntime being present. There is currently no such thing as "don't profile"
Ok, thanks. So, how to best do it when compiling a windows program? I read that with WinMain() it's necessary to start the druntime manually. Which is to late when using the profiler. Or am I missing something? -- Robert M. Münch http://www.saphirion.com smarter | better | faster
May 19 2019