Add a profile summary class specific to instrumentation profiles.

Modify ProfileSummary class to make it not instrumented profile specific.
Add a new InstrumentedProfileSummary class that inherits from ProfileSummary.

Differential Revision: http://reviews.llvm.org/D17310

llvm-svn: 261119
This commit is contained in:
Easwaran Raman
2016-02-17 18:18:47 +00:00
parent 3d3ff650d6
commit 4309570deb
8 changed files with 89 additions and 67 deletions

View File

@@ -268,7 +268,7 @@ static int showInstrProfile(std::string Filename, bool ShowCounts,
if (ShowDetailedSummary && DetailedSummaryCutoffs.empty()) {
Cutoffs = {800000, 900000, 950000, 990000, 999000, 999900, 999990};
}
ProfileSummary PS(Cutoffs);
InstrProfSummary PS(Cutoffs);
if (std::error_code EC = ReaderOrErr.getError())
exitWithErrorCode(EC, Filename);
@@ -352,7 +352,7 @@ static int showInstrProfile(std::string Filename, bool ShowCounts,
OS << "Total number of blocks: " << PS.getNumBlocks() << "\n";
OS << "Total count: " << PS.getTotalCount() << "\n";
for (auto Entry : PS.getDetailedSummary()) {
OS << Entry.NumBlocks << " blocks with count >= " << Entry.MinBlockCount
OS << Entry.NumCounts << " blocks with count >= " << Entry.MinCount
<< " account for "
<< format("%0.6g", (float)Entry.Cutoff / ProfileSummary::Scale * 100)
<< " percentage of the total counts.\n";