X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FProfileData%2FSampleProf.cpp;h=1b76367f4de25a2da2de6fd0f47a3d102b9e2d9e;hb=3bf2abe88cac804262355d2070803d6334863c6b;hp=c376a8bbd98d06ae68ef3a6f47e2299753245045;hpb=5d8ee1bd0d8944ad9fcfe522e85394dc056255b6;p=oota-llvm.git diff --git a/lib/ProfileData/SampleProf.cpp b/lib/ProfileData/SampleProf.cpp index c376a8bbd98..1b76367f4de 100644 --- a/lib/ProfileData/SampleProf.cpp +++ b/lib/ProfileData/SampleProf.cpp @@ -108,18 +108,33 @@ void FunctionSamples::print(raw_ostream &OS, unsigned Indent) const { OS << TotalSamples << ", " << TotalHeadSamples << ", " << BodySamples.size() << " sampled lines\n"; - SampleSorter SortedBodySamples(BodySamples); - for (const auto &SI : SortedBodySamples.get()) { + OS.indent(Indent); + if (BodySamples.size() > 0) { + OS << "Samples collected in the function's body {\n"; + SampleSorter SortedBodySamples(BodySamples); + for (const auto &SI : SortedBodySamples.get()) { + OS.indent(Indent + 2); + OS << SI->first << ": " << SI->second; + } OS.indent(Indent); - OS << SI->first << ": " << SI->second; + OS << "}\n"; + } else { + OS << "No samples collected in the function's body\n"; } - SampleSorter SortedCallsiteSamples( - CallsiteSamples); - for (const auto &CS : SortedCallsiteSamples.get()) { - OS.indent(Indent); - OS << CS->first << ": "; - CS->second.print(OS, Indent + 2); + OS.indent(Indent); + if (CallsiteSamples.size() > 0) { + OS << "Samples collected in inlined callsites {\n"; + SampleSorter SortedCallsiteSamples( + CallsiteSamples); + for (const auto &CS : SortedCallsiteSamples.get()) { + OS.indent(Indent + 2); + OS << CS->first << ": "; + CS->second.print(OS, Indent + 4); + } + OS << "}\n"; + } else { + OS << "No inlined callsites in this function\n"; } }