1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

SamplePGO - Tweak debugging output for function samples. NFC.

llvm-svn: 253612
This commit is contained in:
Diego Novillo 2015-11-19 22:18:30 +00:00
parent 764ff90848
commit c343b4ba30

View File

@ -108,18 +108,33 @@ void FunctionSamples::print(raw_ostream &OS, unsigned Indent) const {
OS << TotalSamples << ", " << TotalHeadSamples << ", " << BodySamples.size()
<< " sampled lines\n";
OS.indent(Indent);
if (BodySamples.size() > 0) {
OS << "Samples collected in the function's body {\n";
SampleSorter<LineLocation, SampleRecord> SortedBodySamples(BodySamples);
for (const auto &SI : SortedBodySamples.get()) {
OS.indent(Indent);
OS.indent(Indent + 2);
OS << SI->first << ": " << SI->second;
}
OS.indent(Indent);
OS << "}\n";
} else {
OS << "No samples collected in the function's body\n";
}
OS.indent(Indent);
if (CallsiteSamples.size() > 0) {
OS << "Samples collected in inlined callsites {\n";
SampleSorter<CallsiteLocation, FunctionSamples> SortedCallsiteSamples(
CallsiteSamples);
for (const auto &CS : SortedCallsiteSamples.get()) {
OS.indent(Indent);
OS.indent(Indent + 2);
OS << CS->first << ": ";
CS->second.print(OS, Indent + 2);
CS->second.print(OS, Indent + 4);
}
OS << "}\n";
} else {
OS << "No inlined callsites in this function\n";
}
}