From ac0cb2fb119f45bd653d44ba9e4a2abed6a23000 Mon Sep 17 00:00:00 2001 From: Mukul Sabharwal Date: Fri, 21 Oct 2016 19:45:06 -0700 Subject: [PATCH] Add Profiling API callbacks for R2R methods (#7732) --- src/vm/readytoruninfo.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/vm/readytoruninfo.cpp b/src/vm/readytoruninfo.cpp index f867036..0fc618a 100644 --- a/src/vm/readytoruninfo.cpp +++ b/src/vm/readytoruninfo.cpp @@ -636,6 +636,22 @@ PCODE ReadyToRunInfo::GetEntryPoint(MethodDesc * pMD, BOOL fFixups /*=TRUE*/) return NULL; } +#ifndef CROSSGEN_COMPILE +#ifdef PROFILING_SUPPORTED + BOOL fShouldSearchCache = TRUE; + { + BEGIN_PIN_PROFILER(CORProfilerTrackCacheSearches()); + g_profControlBlock.pProfInterface-> + JITCachedFunctionSearchStarted((FunctionID)pMD, &fShouldSearchCache); + END_PIN_PROFILER(); + } + if (!fShouldSearchCache) + { + return NULL; + } +#endif // PROFILING_SUPPORTED +#endif // CROSSGEN_COMPILE + uint id; offset = m_nativeReader.DecodeUnsigned(offset, &id); @@ -671,6 +687,17 @@ PCODE ReadyToRunInfo::GetEntryPoint(MethodDesc * pMD, BOOL fFixups /*=TRUE*/) m_entryPointToMethodDescMap.InsertValue(PCODEToPINSTR(pEntryPoint), pMD); } +#ifndef CROSSGEN_COMPILE +#ifdef PROFILING_SUPPORTED + { + BEGIN_PIN_PROFILER(CORProfilerTrackCacheSearches()); + g_profControlBlock.pProfInterface-> + JITCachedFunctionSearchFinished((FunctionID)pMD, COR_PRF_CACHED_FUNCTION_FOUND); + END_PIN_PROFILER(); + } +#endif // PROFILING_SUPPORTED +#endif // CROSSGEN_COMPILE + if (g_pDebugInterface != NULL) { g_pDebugInterface->JITComplete(pMD, pEntryPoint); -- 2.7.4