共用方式為


ICorProfilerInfo 介面

提供方法讓程式碼剖析工具用來與 Common Language Runtime (CLR) 通訊,以控制事件監視及要求資訊。

注意事項注意事項

ICorProfilerInfo 介面中的每個方法都會傳回 HRESULT,以表示成功或失敗。請參閱 CorError.h,取得可能傳回碼的清單。

方法

方法

描述

ICorProfilerInfo::BeginInprocDebugging 方法

初始化同處理序 (In-Process) 偵錯支援。 這個方法在 .NET Framework 2.0 版中已過時。

ICorProfilerInfo::EndInprocDebugging 方法

關閉同處理序偵錯工作階段。 這個方法在 .NET Framework 2.0 版中已過時。

ICorProfilerInfo::ForceGC 方法

強制在執行階段內發生記憶體回收。

ICorProfilerInfo::GetAppDomainInfo 方法

取得指定之應用程式定義域的資訊。

ICorProfilerInfo::GetAssemblyInfo 方法

取得與指定之組件有關的資訊。

ICorProfilerInfo::GetClassFromObject 方法

取得物件的 ClassID

(根據它的 ObjectID)。

ICorProfilerInfo::GetClassFromToken 方法

根據中繼資料語彙基元,取得類別 ID。 這個方法在 .NET Framework 2.0 版中已過時。 改用 ICorProfilerInfo2::GetClassFromTokenAndTypeArgs 方法。

ICorProfilerInfo::GetClassIDInfo 方法

取得指定之類別的父模組和中繼資料語彙基元。

ICorProfilerInfo::GetCodeInfo 方法

取得與指定之函式 ID 相關聯的機器碼延伸。 這個方法已過時。 請改用 ICorProfilerInfo2::GetCodeInfo2 方法。

ICorProfilerInfo::GetCurrentThreadID 方法

取得目前執行緒的 ID (如果是 Managed 執行緒)。

ICorProfilerInfo::GetEventMask 方法

取得分析工具要從 CLR 接收事件告知的目前事件分類。

ICorProfilerInfo::GetFunctionFromIP 方法

將 Managed 程式碼指令指標對應到 FunctionID

ICorProfilerInfo::GetFunctionFromToken 方法

取得函式 ID。 這個方法在 .NET Framework 2.0 版中已過時。 改用 ICorProfilerInfo2::GetFunctionFromTokenAndTypeArgs 方法。

ICorProfilerInfo::GetFunctionInfo 方法

取得指定之函式的父類別和中繼資料語彙基元。

ICorProfilerInfo::GetHandleFromThread 方法

將執行緒 ID 對應至 Win32 執行緒控制代碼。

ICorProfilerInfo::GetILFunctionBody 方法

取得 Microsoft Intermediate Language (MSIL) 程式碼中方法主體的指標 (從其標頭開始)。

ICorProfilerInfo::GetILFunctionBodyAllocator 方法

取得介面,這個介面會提供方法來配置要用來交換 MSIL 程式碼中之方法主體的記憶體。

ICorProfilerInfo::GetILToNativeMapping 方法

針對指定之函式中所包含的程式碼,取得從 MSIL 位移到原生位移的對應。

ICorProfilerInfo::GetInprocInspectionInterface 方法

取得可以針對 ICorDebugProcess 介面查詢的物件。 這個方法在 .NET Framework 2.0 版中已過時。

ICorProfilerInfo::GetInprocInspectionIThisThread 方法

取得可以針對 ICorDebugThread 介面查詢的物件。 這個方法在 .NET Framework 2.0 版中已過時。

ICorProfilerInfo::GetModuleInfo 方法

擁有指定的模組 ID,並傳回模組的檔案名稱,以及該模組之父組件的 ID。

ICorProfilerInfo::GetModuleMetaData 方法

取得對應到指定模組的中繼資料介面執行個體。

ICorProfilerInfo::GetObjectSize 方法

取得指定之物件的大小。

ICorProfilerInfo::GetThreadContext 方法

取得目前與指定的執行緒有關聯的內容識別。

ICorProfilerInfo::GetThreadInfo 方法

取得指定執行緒的目前 Win32 執行緒識別。

ICorProfilerInfo::GetTokenAndMetadataFromFunction 方法

取得指定之函式的中繼資料語彙基元,以及可用在此語彙基元的中繼資料介面執行個體。

ICorProfilerInfo::IsArrayClass 方法

判斷指定的類別是否為陣列類別。

ICorProfilerInfo::SetEnterLeaveFunctionHooks 方法

指定要在 Managed 函式之 "enter"、"leave" 和 "tailcall" 攔截程序上呼叫的分析工具實作函式。

ICorProfilerInfo::SetEventMask 方法

設定值,指定分析工具要從 CLR 接收告知的事件型別。

ICorProfilerInfo::SetFunctionIDMapper 方法

指定將呼叫的分析工具實作函式,以便將 FunctionID 值對應至替代值,這些值會傳遞至分析工具的 entry/exit 攔截程序。

ICorProfilerInfo::SetFunctionReJIT 方法

尚未實作。 不要使用。

ICorProfilerInfo::SetILFunctionBody 方法

在指定的模組中取代指定的函式主體。

ICorProfilerInfo::SetILInstrumentedCodeMap 方法

指定指定之函式原始 MSIL 的位移如何對應至此函式已由分析工具修改之 MSIL 的新位移。

備註

分析工具會呼叫 ICorProfilerInfo 介面中的方法與 CLR 通訊,以控制事件監視及要求資訊。

ICorProfilerInfo 介面的方法由 CLR 透過無限制執行緒模型實作。 每個方法都會傳回 HRESULT 以表示成功或失敗。 請參閱 CorError.h,取得可能傳回碼的清單。

CLR 會在初始化期間透過分析工具的 ICorProfilerCallback::Initialize 實作,將 ICorProfilerInfo 介面傳遞至每個程式碼剖析工具。 程式碼剖析工具就可以呼叫 ICorProfilerInfo 介面的方法,以取得在 CLR 控制下執行的 Managed 程式碼相關資訊。

需求

**平台:**請參閱 .NET Framework 系統需求

**標頭:**CorProf.idl、CorProf.h

**程式庫:**CorGuids.lib

**.NET Framework 版本:**4、3.5 SP1、3.5、3.0 SP1、3.0、2.0 SP1、2.0

請參閱

參考

ICorProfilerInfo2 介面

其他資源

分析介面