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.
interface ICorProfilerCallback : IUnknown { HRESULT Initialize( [in] IUnknown *pICorProfilerInfoUnk); HRESULT Shutdown(); HRESULT AppDomainCreationStarted( [in] AppDomainID appDomainId); HRESULT AppDomainCreationFinished( [in] AppDomainID appDomainId, [in] HRESULT hrStatus); HRESULT AppDomainShutdownStarted( [in] AppDomainID appDomainId); HRESULT AppDomainShutdownFinished( [in] AppDomainID appDomainId, [in] HRESULT hrStatus); HRESULT AssemblyLoadStarted( [in] AssemblyID assemblyId); HRESULT AssemblyLoadFinished( [in] AssemblyID assemblyId, [in] HRESULT hrStatus); HRESULT AssemblyUnloadStarted( [in] AssemblyID assemblyId); HRESULT AssemblyUnloadFinished( [in] AssemblyID assemblyId, [in] HRESULT hrStatus); HRESULT ModuleLoadStarted( [in] ModuleID moduleId); HRESULT ModuleLoadFinished( [in] ModuleID moduleId, [in] HRESULT hrStatus); HRESULT ModuleUnloadStarted( [in] ModuleID moduleId); HRESULT ModuleUnloadFinished( [in] ModuleID moduleId, [in] HRESULT hrStatus); HRESULT ModuleAttachedToAssembly( [in] ModuleID moduleId, [in] AssemblyID AssemblyId); HRESULT ClassLoadStarted( [in] ClassID classId); HRESULT ClassLoadFinished( [in] ClassID classId, [in] HRESULT hrStatus); HRESULT ClassUnloadStarted( [in] ClassID classId); HRESULT ClassUnloadFinished( [in] ClassID classId, [in] HRESULT hrStatus); HRESULT FunctionUnloadStarted( [in] FunctionID functionId); HRESULT JITCompilationStarted( [in] FunctionID functionId, [in] BOOL fIsSafeToBlock); HRESULT JITCompilationFinished( [in] FunctionID functionId, [in] HRESULT hrStatus, [in] BOOL fIsSafeToBlock); HRESULT JITCachedFunctionSearchStarted( [in] FunctionID functionId, [out] BOOL *pbUseCachedFunction); HRESULT JITCachedFunctionSearchFinished( [in] FunctionID functionId, [in] COR_PRF_JIT_CACHE result); HRESULT JITFunctionPitched( [in] FunctionID functionId); HRESULT JITInlining( [in] FunctionID callerId, [in] FunctionID calleeId, [out] BOOL *pfShouldInline); HRESULT ThreadDestroyed( [in] ThreadID threadId); HRESULT ThreadAssignedToOSThread( [in] ThreadID managedThreadId, [in] DWORD osThreadId); HRESULT RemotingClientInvocationStarted(); HRESULT RemotingClientSendingMessage( [in] GUID *pCookie, [in] BOOL fIsAsync); HRESULT RemotingClientReceivingReply( [in] GUID *pCookie, [in] BOOL fIsAsync); HRESULT RemotingClientInvocationFinished(); HRESULT RemotingServerReceivingMessage( [in] GUID *pCookie, [in] BOOL fIsAsync); HRESULT RemotingServerInvocationStarted(); HRESULT RemotingServerInvocationReturned(); HRESULT RemotingServerSendingReply( [in] GUID *pCookie, [in] BOOL fIsAsync); HRESULT UnmanagedToManagedTransition( [in] FunctionID functionId, [in] COR_PRF_TRANSITION_REASON reason); HRESULT ManagedToUnmanagedTransition( [in] FunctionID functionId, [in] COR_PRF_TRANSITION_REASON reason); HRESULT RuntimeSuspendStarted( [in] COR_PRF_SUSPEND_REASON suspendReason); HRESULT RuntimeSuspendFinished(); HRESULT RuntimeSuspendAborted(); HRESULT RuntimeResumeStarted(); HRESULT RuntimeResumeFinished(); HRESULT RuntimeThreadSuspended( [in] ThreadID threadId); HRESULT RuntimeThreadResumed( [in] ThreadID threadId); HRESULT MovedReferences( [in] ULONG cMovedObjectIDRanges, [in, size_is(cMovedObjectIDRanges)] ObjectID oldObjectIDRangeStart[] , [in, size_is(cMovedObjectIDRanges)] ObjectID newObjectIDRangeStart[] , [in, size_is(cMovedObjectIDRanges)] ULONG cObjectIDRangeLength[] ); HRESULT ObjectAllocated( [in] ObjectID objectId, [in] ClassID classId); HRESULT ObjectsAllocatedByClass( [in] ULONG cClassCount, [in, size_is(cClassCount)] ClassID classIds[] , [in, size_is(cClassCount)] ULONG cObjects[] ); HRESULT ObjectReferences( [in] ObjectID objectId, [in] ClassID classId, [in] ULONG cObjectRefs, [in, size_is(cObjectRefs)] ObjectID objectRefIds[] ); HRESULT RootReferences( [in] ULONG cRootRefs, [in, size_is(cRootRefs)] ObjectID rootRefIds[] ); HRESULT ExceptionThrown( [in] ObjectID thrownObjectId); HRESULT ExceptionSearchFunctionEnter( [in] FunctionID functionId); HRESULT ExceptionSearchFunctionLeave(); HRESULT ExceptionSearchFilterEnter( [in] FunctionID functionId); HRESULT ExceptionSearchFilterLeave(); HRESULT ExceptionSearchCatcherFound( [in] FunctionID functionId); HRESULT ExceptionOSHandlerEnter( [in] UINT_PTR __unused); HRESULT ExceptionOSHandlerLeave( [in] UINT_PTR __unused); HRESULT ExceptionUnwindFunctionEnter( [in] FunctionID functionId); HRESULT ExceptionUnwindFunctionLeave(); HRESULT ExceptionUnwindFinallyEnter( [in] FunctionID functionId); HRESULT ExceptionUnwindFinallyLeave(); HRESULT ExceptionCatcherEnter( [in] FunctionID functionId, [in] ObjectID objectId); HRESULT ExceptionCatcherLeave(); HRESULT COMClassicVTableCreated( [in] ClassID wrappedClassId, [in] REFGUID implementedIID, [in] void *pVTable, [in] ULONG cSlots); HRESULT COMClassicVTableDestroyed( [in] ClassID wrappedClassId, [in] REFGUID implementedIID, [in] void *pVTable); HRESULT ExceptionCLRCatcherFound(); HRESULT ExceptionCLRCatcherExecute(); }
Method
Description
ICorProfilerCallback::AppDomainCreationFinished Method
Notifies the profiler that an application domain has been created.
ICorProfilerCallback::AppDomainCreationStarted Method
Notifies the profiler that an application domain is being created.
ICorProfilerCallback::AppDomainShutdownFinished Method
Notifies the profiler that an application domain has been unloaded from a process.
ICorProfilerCallback::AppDomainShutdownStarted Method
Notifies the profiler that an application domain is being unloaded from a process.
ICorProfilerCallback::AssemblyLoadFinished Method
Notifies the profiler that an assembly has finished loading.
ICorProfilerCallback::AssemblyLoadStarted Method
Notifies the profiler that an assembly is being loaded.
ICorProfilerCallback::AssemblyUnloadFinished Method
Notifies the profiler that an assembly has been unloaded.
ICorProfilerCallback::AssemblyUnloadStarted Method
Notifies the profiler that an assembly is being unloaded.
ICorProfilerCallback::ClassLoadFinished Method
Notifies the profiler that a class has finished loading.
ICorProfilerCallback::ClassLoadStarted Method
Notifies the profiler that a class is being loaded.
ICorProfilerCallback::ClassUnloadFinished Method
Notifies the profiler that a class has finished unloading.
ICorProfilerCallback::ClassUnloadStarted Method
Notifies the profiler that a class is being unloaded.
ICorProfilerCallback::COMClassicVTableCreated Method
Notifies the profiler that a runtime callable wrapper (RCW) for the specified IID and class has been created.
ICorProfilerCallback::COMClassicVTableDestroyed Method
Notifies the profiler that an RCW is being destroyed.
ICorProfilerCallback::ExceptionCatcherEnter Method
Notifies the profiler that control is being passed to the appropriate catch block.
ICorProfilerCallback::ExceptionCatcherLeave Method
Notifies the profiler that control is being passed out of the appropriate catch block.
ICorProfilerCallback::ExceptionCLRCatcherExecute Method
Obsolete in the .NET Framework version 2.0.
ICorProfilerCallback::ExceptionCLRCatcherFound Method
Obsolete in the .NET Framework 2.0.
ICorProfilerCallback::ExceptionOSHandlerEnter Method
Not implemented. A profiler that needs unmanaged exception information must obtain this information through other means.
ICorProfilerCallback::ExceptionOSHandlerLeave Method
ICorProfilerCallback::ExceptionSearchCatcherFound Method
Notifies the profiler that the search phase of exception handling has located a handler for the exception that was thrown.
ICorProfilerCallback::ExceptionSearchFilterEnter Method
Notifies the profiler that a user filter is being executed.
ICorProfilerCallback::ExceptionSearchFilterLeave Method
Notifies the profiler that a user filter has just finished executing.
ICorProfilerCallback::ExceptionSearchFunctionEnter Method
Notifies the profiler that the search phase of exception handling has entered a function.
ICorProfilerCallback::ExceptionSearchFunctionLeave Method
Notifies the profiler that the search phase of exception handling has finished searching a function.
ICorProfilerCallback::ExceptionThrown Method
Notifies the profiler that an exception has been thrown.
ICorProfilerCallback::ExceptionUnwindFinallyEnter Method
Notifies the profiler that the unwind phase of exception handling is entering a finally clause contained in the specified function.
ICorProfilerCallback::ExceptionUnwindFinallyLeave Method
Notifies the profiler that the unwind phase of exception handling has left a finally clause.
ICorProfilerCallback::ExceptionUnwindFunctionEnter Method
Notifies the profiler that the unwind phase of exception handling has entered a function.
ICorProfilerCallback::ExceptionUnwindFunctionLeave Method
Notifies the profiler that the unwind phase of exception handling has finished unwinding a function.
ICorProfilerCallback::FunctionUnloadStarted Method
Notifies the profiler that the runtime has started to unload a function.
ICorProfilerCallback::Initialize Method
Called to initialize the profiler whenever a new CLR application is started.
ICorProfilerCallback::JITCachedFunctionSearchFinished Method
Notifies the profiler that a search has finished for a function that was compiled previously using NGen.exe.
ICorProfilerCallback::JITCachedFunctionSearchStarted Method
Notifies the profiler that a search has started for a function that was compiled previously using NGen.exe.
ICorProfilerCallback::JITCompilationFinished Method
Notifies the profiler that the JIT compiler has finished compiling a function.
ICorProfilerCallback::JITCompilationStarted Method
Notifies the profiler that the just-in-time (JIT) compiler has started to compile a function.
ICorProfilerCallback::JITFunctionPitched Method
Notifies the profiler that a function that has been JIT-compiled has been removed from memory.
ICorProfilerCallback::JITInlining Method
Notifies the profiler that the JIT compiler is about to insert a function in line with another function.
ICorProfilerCallback::ManagedToUnmanagedTransition Method
Notifies the profiler that a transition from managed code to unmanaged code has occurred.
ICorProfilerCallback::ModuleAttachedToAssembly Method
Notifies the profiler that a module is being attached to its parent assembly.
ICorProfilerCallback::ModuleLoadFinished Method
Notifies the profiler that a module has finished loading.
ICorProfilerCallback::ModuleLoadStarted Method
Notifies the profiler that a module is being loaded.
ICorProfilerCallback::ModuleUnloadFinished Method
Notifies the profiler that a module has finished unloading.
ICorProfilerCallback::ModuleUnloadStarted Method
Notifies the profiler that a module is being unloaded.
ICorProfilerCallback::MovedReferences Method
Notifies the profiler about object references that were moved during garbage collection.
ICorProfilerCallback::ObjectAllocated Method
Notifies the profiler that memory within the heap has been allocated for an object.
ICorProfilerCallback::ObjectReferences Method
Notifies the profiler about objects in memory referenced by the specified object.
ICorProfilerCallback::ObjectsAllocatedByClass Method
Notifies the profiler about the number of instances of each specified class that have been created since the previous garbage collection.
ICorProfilerCallback::RemotingClientInvocationFinished Method
Notifies the profiler that a remoting call has run to completion on the client.
ICorProfilerCallback::RemotingClientInvocationStarted Method
Notifies the profiler that a remoting call has started.
ICorProfilerCallback::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.
ICorProfilerCallback::RemotingClientSendingMessage Method
Notifies the profiler that the client is sending a request to the server.
ICorProfilerCallback::RemotingServerInvocationReturned Method
Notifies the profiler that the process has finished invoking a method in response to a remote method invocation request.
ICorProfilerCallback::RemotingServerInvocationStarted Method
Notifies the profiler that the process is invoking a method in response to a remote method invocation request.
ICorProfilerCallback::RemotingServerReceivingMessage Method
Notifies the profiler that the process is receiving a remote method invocation or activation request.
ICorProfilerCallback::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.
ICorProfilerCallback::RootReferences Method
Notifies the profiler with information about root references after garbage collection.
ICorProfilerCallback::RuntimeResumeFinished Method
Notifies the profiler that the runtime has resumed all runtime threads and has returned to normal operation.
ICorProfilerCallback::RuntimeResumeStarted Method
Notifies the profiler that the runtime is resuming all run-time threads.
ICorProfilerCallback::RuntimeSuspendAborted Method
Notifies the profiler that the runtime has aborted the run-time suspension that was occurring.
ICorProfilerCallback::RuntimeSuspendFinished Method
Notifies the profiler that the runtime has completed suspension of all run-time threads.
ICorProfilerCallback::RuntimeSuspendStarted Method
Notifies the profiler that the runtime is about to suspend all run-time threads.
ICorProfilerCallback::RuntimeThreadResumed Method
Notifies the profiler that the specified thread has resumed after being suspended.
ICorProfilerCallback::RuntimeThreadSuspended Method
Notifies the profiler that the specified thread has been, or is about to be, suspended.
ICorProfilerCallback::Shutdown Method
Notifies the profiler that the application is shutting down.
ICorProfilerCallback::ThreadAssignedToOSThread Method
Notifies the profiler that a managed thread is being implemented using a particular operating system (OS) thread.
ICorProfilerCallback::ThreadCreated Method
Notifies the profiler that a thread has been created.
ICorProfilerCallback::ThreadDestroyed Method
Notifies the profiler that a thread has been destroyed.
ICorProfilerCallback::UnmanagedToManagedTransition Method
Notifies 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.
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 .NET Framework System Requirements.
Header: CorProf.idl
Library: CorGuids.lib
.NET Framework Versions: 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0