FunctionTailcall2 Function

Notifies the profiler that the currently executing function is about to perform a tail call to another function and provides information about the stack frame.

void FunctionTailcall2 (
    FunctionID         funcId, 
    UINT_PTR           clientData, 
    COR_PRF_FRAME_INFO func
);

Parameters

Parameter Description

funcId

[in] The identifier of the currently executing function that is about to make a tail call.

clientData

[in] The remapped function identifier, which the profiler previously specified via FunctionIDMapper Function, of the currently executing function that is about to make a tail call.

func

[in] A COR_PRF_FRAME_INFO value that points to information about the stack frame.

The profiler should treat this as an opaque handle that can be passed back to the execution engine in the ICorProfilerInfo2::GetFunctionInfo2 Method method.

Remarks

The target function of the tail call will use the current stack frame, and will return directly to the caller of the function that made the tail call. This means that a FunctionLeave2 Function callback will not be issued for a function that is the target of a tail call.

The value of the func parameter is not valid after the FunctionTailcall2 function returns because the value may change or be destroyed.

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

You must save all registers that you use, including those in the floating-point processing unit (FPU), because the execution engine does not save any registers prior to calling FunctionTailcall2 .

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

Also, the FunctionTailcall2 function must not call into managed code or in any way cause a managed memory allocation.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: CorProf.idl

Library: CorGuids.lib

.NET Framework Version: 2.0

See Also

Reference

FunctionEnter2 Function
FunctionLeave2 Function
ICorProfilerInfo2::SetEnterLeaveFunctionHooks2 Method

Other Resources

Profiling Global Static Functions