summaryrefslogtreecommitdiff
path: root/src/ToolBox
diff options
context:
space:
mode:
authorJarret Shook <jashoo@microsoft.com>2019-01-18 12:33:13 -0800
committerGitHub <noreply@github.com>2019-01-18 12:33:13 -0800
commit0684f9241dd9886c2e3d53383fbeb27d31e604f0 (patch)
treefb64e3ce4e36cbd35e4889b058dd5ed306412723 /src/ToolBox
parenteca41b2123b21d887748528b83d4bfcffe1ac68f (diff)
downloadcoreclr-0684f9241dd9886c2e3d53383fbeb27d31e604f0.tar.gz
coreclr-0684f9241dd9886c2e3d53383fbeb27d31e604f0.tar.bz2
coreclr-0684f9241dd9886c2e3d53383fbeb27d31e604f0.zip
SuperPMI Collect/Replay/AsmDiff tool (#21252)
This change adds superpmi.py. The tool feature three modes, collection, replay, and asmdiffs. Collection The collection logic is very similar to the logic in our superpmi-collect test. Mostly it just allows running a script which will run managed code and it will produce a .mch which is clean to be run against. See superpmi.md for more information on specific usage and problems. Replay Replay will take an existing .mch file and run the current jit over the collection. If there is no .mch file on disk, the script will download the latest collection and run against that. AsmDiffs superpmi.md has the latest information on what platforms support asmdiffs. So far, I have an updated OSX and Windows collection that I have run against. If there are binary diffs, the tool will automatically generate base & diff folders with the asm under each one. Future work would include automatically running jit-analyze over those locations. In addition, the tool has the option to automatically run and diff jit dumps, I have found this to be useful to looking into diffs created, as re-running superpmi with different jits to collect this same information is somewhat tedious. Future work This change is in no way the end of the work needed to leverage superpmi effectively. Instead, it is a good first step. Below are some suggestions for future superpmi work: Automated collections Add pmi collection support Leverage some of the new corefx work to use superpmi shim for collections of corefx runs To be added/changed I will unset zapdisable being set by default, it creates too much data, although it is useful it should be opt in Will include example usage in superpmi.md.
Diffstat (limited to 'src/ToolBox')
-rw-r--r--src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp10
-rw-r--r--src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp4
2 files changed, 11 insertions, 3 deletions
diff --git a/src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp b/src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp
index dd72659485..986c6d1f5e 100644
--- a/src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp
+++ b/src/ToolBox/superpmi/superpmi-shared/spmiutil.cpp
@@ -181,7 +181,11 @@ WCHAR* getResultFileName(const WCHAR* folderPath, WCHAR* executableName, const W
const size_t maxAcceptablePathLength =
MAX_PATH - 50; // subtract 50 because excel doesn't like paths longer then 230.
- if (dataFileNameLength > maxAcceptablePathLength)
+#ifdef FEATURE_PAL
+ assert(executableNameLength == 0);
+#endif // FEATURE_PAL
+
+ if (dataFileNameLength > maxAcceptablePathLength || executableNameLength == 0)
{
// The path name is too long; creating the file will fail. This can happen because we use the command line,
// which for ngen includes lots of environment variables, for example.
@@ -189,6 +193,8 @@ WCHAR* getResultFileName(const WCHAR* folderPath, WCHAR* executableName, const W
const size_t randStringLength = 8;
+#ifndef FEATURE_CORECLR
+
size_t lengthToBeDeleted = (dataFileNameLength - maxAcceptablePathLength) + randStringLength;
if (executableNameLength <= lengthToBeDeleted)
@@ -201,6 +207,8 @@ WCHAR* getResultFileName(const WCHAR* folderPath, WCHAR* executableName, const W
executableNameLength -= lengthToBeDeleted;
executableName[executableNameLength] = 0;
+#endif // FEATURE_CORECLR
+
executableNameLength += randStringLength;
WCHAR randNumberString[randStringLength + 1];
generateRandomSuffix(randNumberString, randStringLength + 1);
diff --git a/src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp b/src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp
index f58ec66380..15faaf21c7 100644
--- a/src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp
+++ b/src/ToolBox/superpmi/superpmi/parallelsuperpmi.cpp
@@ -631,11 +631,11 @@ int doParallelSuperPMI(CommandLine::Options& o)
{
if (o.applyDiff)
{
- LogInfo(g_AsmDiffsSummaryFormatString, loaded, jitted, failed, diffs);
+ LogInfo(g_AsmDiffsSummaryFormatString, loaded, jitted, failed, excluded, diffs);
}
else
{
- LogInfo(g_SummaryFormatString, loaded, jitted, failed);
+ LogInfo(g_SummaryFormatString, loaded, jitted, failed, excluded);
}
}