Rediģēt

Kopīgot, izmantojot


FunctionEnter3WithInfo Function

Notifies the profiler that control is being passed to a function, and provides a handle that can be passed to the ICorProfilerInfo3::GetFunctionEnter3Info method to retrieve the stack frame and function arguments.

Syntax

void __stdcall FunctionEnter3WithInfo(  
               [in] FunctionIDOrClientID functionIDOrClientID,  
               [in] COR_PRF_ELT_INFO eltInfo);  

Parameters

functionIDOrClientID [in] The identifier of the function to which control is passed.

eltInfo [in] An opaque handle that represents information about a given stack frame. This handle is valid only during the callback to which it is passed.

Remarks

The FunctionEnter3WithInfo callback method notifies the profiler as functions are called, and enables the profiler to use the ICorProfilerInfo3::GetFunctionEnter3Info method to inspect argument values. To access argument information, the COR_PRF_ENABLE_FUNCTION_ARGS flag has to be set. The profiler can use the ICorProfilerInfo::SetEventMask method to set the event flags, and then use the ICorProfilerInfo3::SetEnterLeaveFunctionHooks3WithInfo method to register your implementation of this function.

The FunctionEnter3WithInfo function is a callback; you must implement it. The implementation must use the __declspec(naked) storage-class attribute.

The execution engine does not save any registers before calling this function.

  • On entry, you must save all registers that you use, including those in the floating-point unit (FPU).

  • On exit, you must restore the stack by popping off all the parameters that were pushed by its caller.

The implementation of FunctionEnter3WithInfo should not block, because it will delay garbage collection. The implementation should not attempt a garbage collection, because the stack may not be in a garbage collection-friendly state. If a garbage collection is attempted, the runtime will block until FunctionEnter3WithInfo returns.

The FunctionEnter3WithInfo function must not call into managed code or cause a managed memory allocation in any way.

Requirements

Platforms: See System Requirements.

Header: CorProf.idl

Library: CorGuids.lib

.NET Framework Versions: Available since 2.0

See also