Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
profiler changes for tiered compilation (#14612)
Browse files Browse the repository at this point in the history
Add new apis for profiler to use with tiered jitting.
  • Loading branch information
davmason committed Oct 24, 2017
1 parent f8d6405 commit 5d66791
Show file tree
Hide file tree
Showing 8 changed files with 1,275 additions and 45 deletions.
4 changes: 2 additions & 2 deletions src/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3029,7 +3029,7 @@ DebuggerMethodInfo *Debugger::GetOrCreateMethodInfo(Module *pModule, mdMethodDef
* structs will be returned, and some of the ilOffsets in this array
* may be the values specified in CorDebugIlToNativeMappingTypes.
******************************************************************************/
HRESULT Debugger::GetILToNativeMapping(MethodDesc *pMD, ULONG32 cMap,
HRESULT Debugger::GetILToNativeMapping(UINT_PTR pNativeCodeStartAddress, ULONG32 cMap,
ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[])
{
CONTRACTL
Expand Down Expand Up @@ -3058,7 +3058,7 @@ HRESULT Debugger::GetILToNativeMapping(MethodDesc *pMD, ULONG32 cMap,
_ASSERTE(CORProfilerPresent());
#endif // PROFILING_SUPPORTED

DebuggerJitInfo *pDJI = GetLatestJitInfoFromMethodDesc(pMD);
DebuggerJitInfo *pDJI = GetJitInfoFromAddr(pNativeCodeStartAddress);

// Dunno what went wrong
if (pDJI == NULL)
Expand Down
2 changes: 1 addition & 1 deletion src/debug/ee/debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ class Debugger : public DebugInterface
DebuggerJitInfo *GetLatestJitInfoFromMethodDesc(MethodDesc * pMethodDesc);


HRESULT GetILToNativeMapping(MethodDesc *pMD, ULONG32 cMap, ULONG32 *pcMap,
HRESULT GetILToNativeMapping(UINT_PTR pNativeCodeStartAddress, ULONG32 cMap, ULONG32 *pcMap,
COR_DEBUG_IL_TO_NATIVE_MAP map[]);

HRESULT GetILToNativeMappingIntoArrays(
Expand Down
18 changes: 18 additions & 0 deletions src/inc/corprof.idl
Original file line number Diff line number Diff line change
Expand Up @@ -3891,6 +3891,24 @@ interface ICorProfilerInfo8 : ICorProfilerInfo7
[out] WCHAR wszName[]);
};

[
object,
uuid(008170DB-F8CC-4796-9A51-DC8AA0B47012),
pointer_default(unique),
local
]
interface ICorProfilerInfo9 : ICorProfilerInfo8
{
//Given functionId + rejitId, enumerate the native code start address of all jitted versions of this code that currently exist
HRESULT GetNativeCodeStartAddresses(FunctionID functionID, ReJITID reJitId, ULONG32 cCodeStartAddresses, ULONG32 *pcCodeStartAddresses, UINT_PTR codeStartAddresses[]);

//Given the native code start address, return the native->IL mapping information for this jitted version of the code
HRESULT GetILToNativeMapping3(UINT_PTR pNativeCodeStartAddress, ULONG32 cMap, ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[]);

//Given the native code start address, return the the blocks of virtual memory that store this code (method code is not necessarily stored in a single contiguous memory region)
HRESULT GetCodeInfo4(UINT_PTR pNativeCodeStartAddress, ULONG32 cCodeInfos, ULONG32* pcCodeInfos, COR_PRF_CODE_INFO codeInfos[]);
}

/*
* This interface lets you iterate over methods in the runtime.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/pal/prebuilt/idl/corprof_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo7,0x9AEECC0D,0x63E0,0x4187,0x8C,0x00,0
MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo8,0xC5AC80A6,0x782E,0x4716,0x80,0x44,0x39,0x59,0x8C,0x60,0xCF,0xBF);


MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo9,0X008170DB,0XF8CC,0X4796,0X9A,0X51,0XDC,0X8A,0XA0,0XB4,0X70,0x12);


MIDL_DEFINE_GUID(IID, IID_ICorProfilerMethodEnum,0xFCCEE788,0x0088,0x454B,0xA8,0x11,0xC9,0x9F,0x29,0x8D,0x19,0x42);


Expand Down
Loading

0 comments on commit 5d66791

Please sign in to comment.