diff options
author | Diego Novillo <dnovillo@google.com> | 2015-11-19 22:18:30 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2015-11-19 22:18:30 +0000 |
commit | 379cc5e71b2b6deb1e88240994761358741d2c9f (patch) | |
tree | 8284bfc55d2bce93c00d7b619302883ada63bf03 /llvm/lib/ProfileData/SampleProf.cpp | |
parent | a9912617c88be2384e5c2f9aee28ad00e2650c15 (diff) | |
download | bcm5719-llvm-379cc5e71b2b6deb1e88240994761358741d2c9f.tar.gz bcm5719-llvm-379cc5e71b2b6deb1e88240994761358741d2c9f.zip |
SamplePGO - Tweak debugging output for function samples. NFC.
llvm-svn: 253612
Diffstat (limited to 'llvm/lib/ProfileData/SampleProf.cpp')
-rw-r--r-- | llvm/lib/ProfileData/SampleProf.cpp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/llvm/lib/ProfileData/SampleProf.cpp b/llvm/lib/ProfileData/SampleProf.cpp index c376a8bbd98..1b76367f4de 100644 --- a/llvm/lib/ProfileData/SampleProf.cpp +++ b/llvm/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<LineLocation, SampleRecord> 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<LineLocation, SampleRecord> 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<CallsiteLocation, FunctionSamples> 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<CallsiteLocation, FunctionSamples> 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"; } } |