summaryrefslogtreecommitdiff
path: root/src/ToolBox/superpmi/mcs/verbinteg.cpp
blob: 9b1057769a498320af6a6655cfcf93580a89015a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
}