Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 66 additions & 17 deletions src/coreclr/tools/superpmi/superpmi-shim-collector/jithost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,75 @@ JitHost* g_ourJitHost;
// in the method context.
bool RecordVariable(const WCHAR* key)
{
// Special-case: we don't want to store some DOTNET variables during
// collections that we don't want to see on replay:
// DOTNET_JitName -- used to get the VM to load the SuperPMI collection shim
// without requiring the shim to overwrite the original JIT.
// This JIT doesn't care about this on SuperPMI replay, but
// we don't need to waste the space in the MC file storing it.
// DOTNET_AltJitName -- if collecting with an altjit, this is set. The JIT doesn't
// use this on replay, but it doesn't need to be stored.
// DOTNET_EnableExtraSuperPmiQueries -- used to force the JIT to ask additional
// questions during SuperPMI collection. We don't want to store
// this variable because we don't want to replay using it.

if ((_wcsicmp(key, W("JitName")) == 0) ||
(_wcsicmp(key, W("AltJitName")) == 0) ||
(_wcsicmp(key, W("EnableExtraSuperPmiQueries")) == 0))
// Special cases: we don't want to store some DOTNET variables during
// collections, typically when they refer to file paths or simply because
// it does not make sense to replay with it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that DOTNET_JitName and DOTNET_AltJitName do not come through this path since the JIT doesn't query them. So they don't need to be here.

static const WCHAR* s_ignoredVars[] = {
W("EnableExtraSuperPmiQueries"),
W("JitDisasm"),
W("JitDump"),
W("JitDasmWithAlignmentBoundaries"),
W("JitDumpASCII"),
W("JitHashBreak"),
W("JitHashDump"),
W("JitHashHalt"),
W("JitOrder"),
W("JitPrintInlinedMethods"),
W("JitPrintDevirtualizedMethods"),
W("JitBreak"),
W("JitDebugBreak"),
W("JitDisasmAssemblies"),
W("JitDisasmWithGC"),
W("JitDisasmWithDebugInfo"),
W("JitDisasmSpilled"),
W("JitDumpTier0"),
W("JitDumpAtOSROffset"),
W("JitDumpInlinePhases"),
W("JitEHDump"),
W("JitExclude"),
W("JitGCDump"),
W("JitDebugDump"),
W("JitHalt"),
W("JitImportBreak"),
W("JitInclude"),
W("JitLateDisasm"),
W("JitUnwindDump"),
W("JitDumpFg"),
W("JitDumpFgDir"),
W("JitDumpFgPhase"),
W("JitDumpFgPrePhase"),
W("JitDumpFgDot"),
W("JitDumpFgEH"),
W("JitDumpFgLoops"),
W("JitDumpFgConstrained"),
W("JitDumpFgBlockID"),
W("JitDumpFgBlockFlags"),
W("JitDumpFgLoopFlags"),
W("JitDumpFgBlockOrder"),
W("JITLateDisasmTo"),
W("JitDisasmSummary"),
W("JitStdOutFile"),
W("WriteRichDebugInfoFile"),
W("JitFuncInfoLogFile"),
W("JitTimeLogCsv"),
W("JitMeasureNowayAssertFile"),
W("JitInlineDumpData"),
W("JitInlineDumpXml"),
W("JitInlineDumpXmlFile"),
W("JitInlinePolicyDumpXml"),
W("JitInlineReplayFile"),
W("JitFunctionFile")
};

for (const WCHAR* ignoredVar : s_ignoredVars)
{
return false;
if (_wcsicmp(key, ignoredVar) == 0)
{
return false;
}
}

// By default, we record everything.
return true;
}

Expand Down