Time (sec.) 0.0 for all methods
cgruenzner
Posts: 10
Hi,
we are trying to profile a WinForm (.NET 2.0) application. Very often the Time(sec.) column does not show a proper result. The profiler shows 0.0 for all methods. But I noticed that the Time (Ticks) column contains reasonable values. What may be going wrong?
Best regards
Carsten
we are trying to profile a WinForm (.NET 2.0) application. Very often the Time(sec.) column does not show a proper result. The profiler shows 0.0 for all methods. But I noticed that the Time (Ticks) column contains reasonable values. What may be going wrong?
Best regards
Carsten
Best regards,
Carsten Grünzner
Carsten Grünzner
Comments
I'm not sure what would cause this, but I suspect the compensation code that Profiler uses to deduct its' own overhead. It uses the ticks metric to subtract any time that it has added to your own methods. Possibly this calculation is retruning a negative or null result.
I suppose some relevant questions to ask would be if the application is running on a virtual machine or maybe a portable or laptop? Also, is the behavior consistent, or can you isolate a specific path through your code that causes this? Finally, are there sensible results if you change from fast-mode to detailed-mode performance profiling or vice-versa?
Thanks!
We are running Windows XP in the idle task of a VxWorks real-time system. We have checked with a monitor program of the VxWorks kernel that the Windows task has >90% of the CPU time. But I think this configuration is like a running Windows in a virtual machine.
Up to know we cannot recognize a pattern what may cause the problem. Our test run is always the same. Yesterday we had a single profiling run with three snapshots. On the first snapshot everything looks fine. On the 2nd and 3rd snapshot we got no proper results.
At first we thought that rebooting the system solves the problem, but this is not true. At the moment we are using the detailed-mode only. Next time we get the failure we try to switch to fast-mode.
Carsten Grünzner
sorry for my delayed answer. Now we tried your suggestion:
When we are switshing to fast mode we get proper results in fast mode. When we are switching back to detailed mode, we still get 0 results.
Carsten Grünzner
I think all bets are off when it comes to profiling on a virtual machine because the CPU hardware needs to be constantly available to get the ticks in order to do the overhead compensation. You really need to be on real machine hardware.