Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2010 profiler : is it possible to profile one specific method?

Tags:

Possibly some methods to turn on and turn off profiling from code?

Or can you select a specific function to profile ?

like image 700
rekna Avatar asked May 03 '10 16:05

rekna


People also ask

How do you use vs performance profiler?

Open the Performance Profiler by choosing Debug > Performance Profiler (or Alt + F2). For more information on using the CPU Usage or Memory usage tool in the Performance Profiler vs. the debugger-integrated tools, see Run profiling tools with or without the debugger.

Which is a profiler and resource Debugger for Windows?

AQtime Pro, a performance profiler and memory allocation debugger that can be integrated into Microsoft Visual Studio, and Embarcadero RAD Studio, or can run as a stand-alone application.

What is profiler C#?

A profiler is a tool that monitors the execution of another application. A common language runtime (CLR) profiler is a dynamic link library (DLL) that consists of functions that receive messages from, and send messages to, the CLR by using the profiling API. The profiler DLL is loaded by the CLR at run time.


1 Answers

You can also use the profiler's data collection API to start and stop profiling around the methods you're interested in. See this MSDN article for a walkthrough.

The best way to use the API in this case would be to call StartProfile just before your methods execute and then call StopProfile just after. You should start profiling via the "Start With Profiling Paused" option so you don't start profiling until you hit the first call to StartProfile.

Using the data collection API will work with sampling or instrumentation.

like image 117
Chris Schmich Avatar answered Oct 15 '22 00:10

Chris Schmich