зеркало из https://github.com/microsoft/BPerf.git
Fix IL Bytes bug
This commit is contained in:
Родитель
748dbde77f
Коммит
e64ebc96e9
|
@ -257,4 +257,4 @@ paket-files/
|
|||
*.db
|
||||
|
||||
# CMake output directory for CoreCLR Profiler
|
||||
CoreCLRProfiler/out/*
|
||||
CoreCLRProfiler/native/out/*
|
|
@ -247,7 +247,7 @@ HRESULT STDMETHODCALLTYPE BPerfProfilerCallback::JITCompilationFinished(Function
|
|||
ULONG32 cCodeInfos;
|
||||
IfFailRet(this->corProfilerInfo->GetCodeInfo2(functionId, 0, &cCodeInfos, nullptr));
|
||||
std::vector<COR_PRF_CODE_INFO> codeInfos(cCodeInfos);
|
||||
IfFailRet(this->corProfilerInfo->GetCodeInfo2(functionId, 0, &cCodeInfos, codeInfos.data()));
|
||||
IfFailRet(this->corProfilerInfo->GetCodeInfo2(functionId, cCodeInfos, &cCodeInfos, codeInfos.data()));
|
||||
|
||||
size_t codeSize = 0;
|
||||
for (auto &s : codeInfos)
|
||||
|
@ -693,7 +693,17 @@ HRESULT STDMETHODCALLTYPE BPerfProfilerCallback::ModuleInMemorySymbolsUpdated(Mo
|
|||
|
||||
HRESULT STDMETHODCALLTYPE BPerfProfilerCallback::DynamicMethodJITCompilationStarted(FunctionID functionId, BOOL fIsSafeToBlock, LPCBYTE ilHeader, ULONG cbILHeader)
|
||||
{
|
||||
this->totalILBytesJittedForDynamicMethods = 0; // TODO: FIXME
|
||||
const auto methodHeader = reinterpret_cast<const IMAGE_COR_ILMETHOD*>(ilHeader);
|
||||
|
||||
if ((methodHeader->Tiny.Flags_CodeSize & CorILMethod_FormatMask >> 1) == CorILMethod_TinyFormat)
|
||||
{
|
||||
this->totalILBytesJittedForDynamicMethods += methodHeader->Tiny.Flags_CodeSize >> 2;
|
||||
}
|
||||
else if ((methodHeader->Fat.Flags & CorILMethod_FormatMask) == CorILMethod_FatFormat)
|
||||
{
|
||||
this->totalILBytesJittedForDynamicMethods += reinterpret_cast<const IMAGE_COR_ILMETHOD_FAT*>(methodHeader)->CodeSize;
|
||||
}
|
||||
|
||||
++this->totalNumberOfDynamicMethods;
|
||||
++this->currentNumberOfDynamicMethods;
|
||||
|
||||
|
@ -705,7 +715,7 @@ HRESULT STDMETHODCALLTYPE BPerfProfilerCallback::DynamicMethodJITCompilationFini
|
|||
ULONG32 cCodeInfos;
|
||||
IfFailRet(this->corProfilerInfo->GetCodeInfo2(functionId, 0, &cCodeInfos, nullptr));
|
||||
std::vector<COR_PRF_CODE_INFO> codeInfos(cCodeInfos);
|
||||
IfFailRet(this->corProfilerInfo->GetCodeInfo2(functionId, 0, &cCodeInfos, codeInfos.data()));
|
||||
IfFailRet(this->corProfilerInfo->GetCodeInfo2(functionId, cCodeInfos, &cCodeInfos, codeInfos.data()));
|
||||
|
||||
size_t codeSize = 0;
|
||||
for (auto& s : codeInfos)
|
||||
|
|
|
@ -7,4 +7,7 @@ if(UNIX)
|
|||
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--no-undefined")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-invalid-noreturn -fPIC -fms-extensions -std=c++11")
|
||||
endif(UNIX)
|
||||
if ("${LINK_TYPE}" STREQUAL "Static")
|
||||
add_compile_options(/MT$<$<CONFIG:Debug>:d>)
|
||||
endif()
|
||||
add_library (Microsoft.BPerf.CoreCLRProfiler SHARED "BPerfProfilerCallback.cpp" "BPerfProfilerCallback.h" "Microsoft.BPerf.CoreCLRProfiler.cpp" "ETWHeaders.h" "CQuickBytes.h" "CQuickBytes.cpp" "PrettyPrintSig.cpp" "sha1.cpp" "sha1.h" "profiler_pal.h" "PortableString.h" "exports.def")
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"cmakeCommandArgs": "-DLINK_TYPE=Static",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"variables": []
|
||||
|
@ -18,7 +18,7 @@
|
|||
"configurationType": "RelWithDebInfo",
|
||||
"buildRoot": "${projectDir}\\out\\build\\${name}",
|
||||
"installRoot": "${projectDir}\\out\\install\\${name}",
|
||||
"cmakeCommandArgs": "",
|
||||
"cmakeCommandArgs": "-DLINK_TYPE=Static",
|
||||
"buildCommandArgs": "-v",
|
||||
"ctestCommandArgs": "",
|
||||
"inheritEnvironments": [ "msvc_x64_x64" ],
|
||||
|
|
Загрузка…
Ссылка в новой задаче