summaryrefslogtreecommitdiff
path: root/src/ToolBox/superpmi/mcs/verbinteg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ToolBox/superpmi/mcs/verbinteg.cpp')
-rw-r--r--src/ToolBox/superpmi/mcs/verbinteg.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ToolBox/superpmi/mcs/verbinteg.cpp b/src/ToolBox/superpmi/mcs/verbinteg.cpp
new file mode 100644
index 0000000000..9b1057769a
--- /dev/null
+++ b/src/ToolBox/superpmi/mcs/verbinteg.cpp
@@ -0,0 +1,37 @@
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+#include "standardpch.h"
+#include "verbinteg.h"
+#include "simpletimer.h"
+#include "methodcontext.h"
+#include "methodcontextiterator.h"
+
+int verbInteg::DoWork(const char *nameOfInput)
+{
+ LogVerbose("Checking the integrity of '%s'", nameOfInput);
+
+ SimpleTimer st2;
+ st2.Start();
+
+ MethodContextIterator mci(true);
+ if (!mci.Initialize(nameOfInput))
+ return -1;
+
+ while (mci.MoveNext())
+ {
+ MethodContext* mc = mci.Current();
+ // Nothing to do except load the current one.
+ }
+
+ st2.Stop();
+ LogInfo("Checked the integrity of %d methodContexts at %d per second",
+ mci.MethodContextNumber(), (int)((double)mci.MethodContextNumber() / st2.GetSeconds()));
+
+ if (!mci.Destroy())
+ return -1;
+
+ return 0;
+}