ICorProfilerCallback Interface

 

Provides methods that are used by the common language runtime (CLR) to notify a code profiler when the events to which the profiler has subscribed occur.

MethodDescription
AppDomainCreationFinished MethodNotifies the profiler that an application domain has been created.
AppDomainCreationStarted MethodNotifies the profiler that an application domain is being created.
AppDomainShutdownFinished MethodNotifies the profiler that an application domain has been unloaded from a process.
AppDomainShutdownStarted MethodNotifies the profiler that an application domain is being unloaded from a process.
AssemblyLoadFinished MethodNotifies the profiler that an assembly has finished loading.
AssemblyLoadStarted MethodNotifies the profiler that an assembly is being loaded.
AssemblyUnloadFinished MethodNotifies the profiler that an assembly has been unloaded.
AssemblyUnloadStarted MethodNotifies the profiler that an assembly is being unloaded.
ClassLoadFinished MethodNotifies the profiler that a class has finished loading.
ClassLoadStarted MethodNotifies the profiler that a class is being loaded.
ClassUnloadFinished MethodNotifies the profiler that a class has finished unloading.
ClassUnloadStarted MethodNotifies the profiler that a class is being unloaded.
COMClassicVTableCreated MethodNotifies the profiler that a runtime callable wrapper (RCW) for the specified IID and class has been created.
COMClassicVTableDestroyed MethodNotifies the profiler that an RCW is being destroyed.
ExceptionCatcherEnter MethodNotifies the profiler that control is being passed to the appropriate catch block.
ExceptionCatcherLeave MethodNotifies the profiler that control is being passed out of the appropriate catch block.
ExceptionCLRCatcherExecute MethodObsolete in the .NET Framework version 2.0.
ExceptionCLRCatcherFound MethodObsolete in the .NET Framework 2.0.
ExceptionOSHandlerEnter MethodNot implemented. A profiler that needs unmanaged exception information must obtain this information through other means.
ExceptionOSHandlerLeave MethodNot implemented. A profiler that needs unmanaged exception information must obtain this information through other means.
ExceptionSearchCatcherFound MethodNotifies the profiler that the search phase of exception handling has located a handler for the exception that was thrown.
ExceptionSearchFilterEnter MethodNotifies the profiler that a user filter is being executed.
ExceptionSearchFilterLeave MethodNotifies the profiler that a user filter has just finished executing.
ExceptionSearchFunctionEnter MethodNotifies the profiler that the search phase of exception handling has entered a function.
ExceptionSearchFunctionLeave MethodNotifies the profiler that the search phase of exception handling has finished searching a function.
ExceptionThrown MethodNotifies the profiler that an exception has been thrown.
ExceptionUnwindFinallyEnter MethodNotifies the profiler that the unwind phase of exception handling is entering a finally clause contained in the specified function.
ExceptionUnwindFinallyLeave MethodNotifies the profiler that the unwind phase of exception handling has left a finally clause.
ExceptionUnwindFunctionEnter MethodNotifies the profiler that the unwind phase of exception handling has entered a function.
ExceptionUnwindFunctionLeave MethodNotifies the profiler that the unwind phase of exception handling has finished unwinding a function.
FunctionUnloadStarted MethodNotifies the profiler that the runtime has started to unload a function.
Initialize MethodCalled to initialize the profiler whenever a new CLR application is started.
JITCachedFunctionSearchFinished MethodNotifies the profiler that a search has finished for a function that was compiled previously using NGen.exe.
JITCachedFunctionSearchStarted MethodNotifies the profiler that a search has started for a function that was compiled previously using NGen.exe.
JITCompilationFinished MethodNotifies the profiler that the JIT compiler has finished compiling a function.
JITCompilationStarted MethodNotifies the profiler that the just-in-time (JIT) compiler has started to compile a function.
JITFunctionPitched MethodNotifies the profiler that a function that has been JIT-compiled has been removed from memory.
JITInlining MethodNotifies the profiler that the JIT compiler is about to insert a function in line with another function.
ManagedToUnmanagedTransition MethodNotifies the profiler that a transition from managed code to unmanaged code has occurred.
ModuleAttachedToAssembly MethodNotifies the profiler that a module is being attached to its parent assembly.
ModuleLoadFinished MethodNotifies the profiler that a module has finished loading.
ModuleLoadStarted MethodNotifies the profiler that a module is being loaded.
ModuleUnloadFinished MethodNotifies the profiler that a module has finished unloading.
ModuleUnloadStarted MethodNotifies the profiler that a module is being unloaded.
MovedReferences MethodNotifies the profiler about object references that were moved during garbage collection.
ObjectAllocated MethodNotifies the profiler that memory within the heap has been allocated for an object.
ObjectReferences MethodNotifies the profiler about objects in memory referenced by the specified object.
ObjectsAllocatedByClass MethodNotifies the profiler about the number of instances of each specified class that have been created since the previous garbage collection.
RemotingClientInvocationFinished MethodNotifies the profiler that a remoting call has run to completion on the client.
RemotingClientInvocationStarted MethodNotifies the profiler that a remoting call has started.
RemotingClientReceivingReply MethodNotifies the profiler that the server-side portion of a remoting call has completed and the client is now receiving and about to process the reply.
RemotingClientSendingMessage MethodNotifies the profiler that the client is sending a request to the server.
RemotingServerInvocationReturned MethodNotifies the profiler that the process has finished invoking a method in response to a remote method invocation request.
RemotingServerInvocationStarted MethodNotifies the profiler that the process is invoking a method in response to a remote method invocation request.
RemotingServerReceivingMessage MethodNotifies the profiler that the process is receiving a remote method invocation or activation request.
RemotingServerSendingReply MethodNotifies the profiler that the process has finished processing a remote method invocation request and is about to transmit the reply through a channel.
RootReferences MethodNotifies the profiler with information about root references after garbage collection.
RuntimeResumeFinished MethodNotifies the profiler that the runtime has resumed all runtime threads and has returned to normal operation.
RuntimeResumeStarted MethodNotifies the profiler that the runtime is resuming all run-time threads.
RuntimeSuspendAborted MethodNotifies the profiler that the runtime has aborted the run-time suspension that was occurring.
RuntimeSuspendFinished MethodNotifies the profiler that the runtime has completed suspension of all run-time threads.
RuntimeSuspendStarted MethodNotifies the profiler that the runtime is about to suspend all run-time threads.
RuntimeThreadResumed MethodNotifies the profiler that the specified thread has resumed after being suspended.
RuntimeThreadSuspended MethodNotifies the profiler that the specified thread has been, or is about to be, suspended.
Shutdown MethodNotifies the profiler that the application is shutting down.
ThreadAssignedToOSThread MethodNotifies the profiler that a managed thread is being implemented using a particular operating system (OS) thread.
ThreadCreated MethodNotifies the profiler that a thread has been created.
ThreadDestroyed MethodNotifies the profiler that a thread has been destroyed.
UnmanagedToManagedTransition MethodNotifies the profiler that a transition from unmanaged code to managed code has occurred.

The CLR calls a method in the ICorProfilerCallback (or ICorProfilerCallback2) interface to notify the profiler when an event, to which the profiler has subscribed, occurs. This is the primary callback interface through which the CLR communicates with the code profiler.

A code profiler must implement the methods of the ICorProfilerCallback interface. For the .NET Framework version 2.0 or later, the profiler must also implement the ICorProfilerCallback2 methods. Each method implementation must return an HRESULT that has a value of S_OK on success or E_FAIL on failure. Currently, the CLR ignores the HRESULT that is returned by each callback except ICorProfilerCallback::ObjectReferences.

In the Microsoft Windows registry, a code profiler must register its Component Object Model (COM) object that implements the ICorProfilerCallback and ICorProfilerCallback2 interfaces. A code profiler subscribes to the events for which it wants to receive notification by calling ICorProfilerInfo::SetEventMask. This is usually done in the profiler's implementation of ICorProfilerCallback::Initialize. The profiler is then able to receive notification from the runtime when an event is about to occur or has just occurred in an executing runtime process.

System_CAPS_ICON_note.jpg Note

The profiler registers a single COM object. If the profiler is targeting the .NET Framework version 1.0 or 1.1, that COM object needs to implement only the methods of ICorProfilerCallback. If it is targeting .NET Framework version 2.0 or later, the COM object must also implement the methods of ICorProfilerCallback2.

Platforms: See System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 1.0

Profiling Interfaces
ICorProfilerCallback2 Interface
ICorProfilerCallback3 Interface
ICorProfilerCallback4 Interface

Show: