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.

Methods

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

Remarks

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.

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.

Requirements

Platforms: See System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 1.0

See Also

Profiling Interfaces
ICorProfilerCallback2 Interface
ICorProfilerCallback3 Interface
ICorProfilerCallback4 Interface