hy9be / micro-profiler

Automatically exported from code.google.com/p/micro-profiler
0 stars 0 forks source link

Function is hit but reported as called zero times #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I cannot see a pattern that would let me describe how to reproduce the issue.  
All I know is that certain functions in my program are listed in the viewer 
with zeros in all the columns.  This does not make sense because the function 
was called.  I attached the debugger to the program and verified that _penter 
is called.

I am using version 1.0.500 on Windows 7.

Original issue reported on code.google.com by philther...@gmail.com on 6 Jun 2013 at 3:10

GoogleCodeExporter commented 9 years ago
I might have found a pattern to the function having zeros: they all take a 
relatively long time in a single call.

I am able to get profiling data for my function simply by changing the dataset 
so that it will complete in a shorter amount of time.  No recompiles or changes 
to the environment.

Original comment by philther...@gmail.com on 6 Jun 2013 at 4:30

GoogleCodeExporter commented 9 years ago
Another thing might be causing this issue: a dialog such as a regular message 
box being called by the function.

Original comment by philther...@gmail.com on 11 Jun 2013 at 7:26

GoogleCodeExporter commented 9 years ago
Hello!

In order to always provide children calls statistics, a dummy record for a 
function that haven't returned yet is always created (with zero durations). 
That's why you observe it.
Message box (like any other modal dialog) spins its own message loop, so you'll 
have only those functions appearing in statistics that are called as a result 
of processing of messages posted to handlers from your project codebase, if any.

Can we close the issue?

thanks

Original comment by artem.ge...@gmail.com on 12 Jun 2013 at 10:35

GoogleCodeExporter commented 9 years ago
Thanks.  Let me double-check that I am getting numbers now.

Original comment by philther...@gmail.com on 12 Jun 2013 at 12:44

GoogleCodeExporter commented 9 years ago
Just double checked and indeed, message pumping causes zeros on the function.

I am satisfied with this but I feel something is still not clearly understood.  
My functions looks like this:

  evaluate()¨
  {
     dialog_box();

     init();
     work();
     cleanup();
  }

Message pumping or not, evaluate does return at some point.  The calls are 
properly nested and there is no recursivity involved.  There should be numbers 
for evaluate.  Watchout, there may be a bug lurking, or a better explanation 
why pumping messages causes zeros.

Thanks.

Original comment by philther...@gmail.com on 14 Jun 2013 at 1:59

GoogleCodeExporter commented 9 years ago
Can you specify, whether your app is exiting immediately after the evaluate() 
was called?

thanks

Original comment by artem.ge...@gmail.com on 4 Oct 2013 at 2:08

GoogleCodeExporter commented 9 years ago
No, the app is not exiting after a call to evaluate().

Original comment by philther...@gmail.com on 4 Oct 2013 at 4:30