Red Gate forums :: View topic - Having difficulty profiling threads
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 6
ANTS Performance Profiler 6 forum

Having difficulty profiling threads

Search in ANTS Performance Profiler 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
talbot



Joined: 13 Jul 2010
Posts: 1

PostPosted: Tue Jul 13, 2010 4:47 am    Post subject: Having difficulty profiling threads Reply with quote

We are trying to profile a multi-threaded .NET application that has dependencies on unmanaged code, Microsoft.XNA, etc.

We have created a managed project that generates a dll. We are able to see some of our methods getting profiled - but not the ones of interest. Specifically, the ones responsible for scene rendering.

We're not certain what is stopping RedGate ANTs profiler from being able to profile certain methods - but at the top of the call-stack (for one of the methods in question) is:
System.Threading.ThreadHelper.ThreadStart().

Then lower in the call-stack is a call to native code and subsequently back to managed code - i.e. this is in the call-stack:
[Native to Managed Transition]
[Managed to Native Transition]


Immediately above the managed to native transition (in the call-stack) is this call:
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame = {System.Windows.Threading.DispatcherFrame})


In general - what would preven redgate ANT's performance profiler from being able to profile managed code? Is there a work-around we could use to be able to profile managed code that just happens to be invoked by unmanaged code? For example, in Visual Studio, you can just click the check-box "enable unmanaged code debugging". Although we don't want to debug/profile unmanaged code - I'm wondering if that concept is prohibiting us from profiling the managed code (that just so happens to be invoked by unmanaged code).

Thanks,
Talbot
Back to top
View user's profile Send private message
AndrewH



Joined: 17 Aug 2006
Posts: 137

PostPosted: Tue Jul 13, 2010 10:34 am    Post subject: Reply with quote

Hi,

ANTS shouldn't miss any methods when using any of the 'all methods' profiling modes. However, there are a few options that can change how this is presented to you:

If 'Enable Inlining' is on (it is by default), then .NET may inline certain methods, which the profiler will report as taking no time as a result. These will only show up in the results (in orange) if you have 'hide insignificant methods' turned off.

'Simplify complex stack traces' can sometimes results in method disappearing. Turning this option off might result in the profiler using up too much memory and crashing the target application.

If 'avoid profiling extremely trivial functions' is on, then the profiler will save disk space and memory by ignoring methods with an infinitesimal effect on the result (this generally means property accessors that are only called once).

If you're using sampling mode, be aware that the profiler won't be able to see function calls that take place in an interval less than the sampling period - generally anything that takes less than about 2ms to complete; about 99% of .NET function calls actually fall into this category.

It might also be the display options: to see everything make sure that you've selected an 'any methods' display mode and turned 'hide insignificant methods' off.
_________________
Andrew Hunter
Software Developer
Red Gate Software Ltd.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group