[PATCH] D79291: [llvm-profdata] Support -detailed-summary for Sample Profile

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 22:04:10 PDT 2020


wenlei marked an inline comment as done.
wenlei added inline comments.


================
Comment at: llvm/lib/IR/ProfileSummary.cpp:209-215
+void ProfileSummary::printSummary(raw_ostream &OS) {
+  OS << "Total functions: " << NumFunctions << "\n";
+  OS << "Maximum function count: " << MaxFunctionCount << "\n";
+  OS << "Maximum sample count: " << MaxCount << "\n";
+}
+
+void ProfileSummary::printDetailedSummary(raw_ostream &OS) {
----------------
wmi wrote:
> wenlei wrote:
> > wmi wrote:
> > > Why we need printSummary and printDetailedSummary instead of one print function? printSummary seems only print very limited information in ProfileSummary.
> > That was mostly for sharing printDetailedSummary between InstrProf and SampleProf for llvm-profdata. The printSummary part is always printed for InstrProf, so separated out in order to share printDetailedSummary.
> > 
> > 
> I mean can we have one print function, printSummary for example, and dump everything including the detail inside of it? Is it a problem for InstrProf test?
Yeah, it causes problem for InstrProf tests. Stuff in `printSummary` is always printed for InstrProfile even without detailed-summary flag, and it's interleaved with other outputs. Tests actually leverage the interleaved structure for checking, so if we combine `printSummary` with `printDetailedSummary`, many tests need to be updated, and detail-summary need to be added to many tests too. We could do that, I was trying to avoid that churn though... 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79291/new/

https://reviews.llvm.org/D79291





More information about the llvm-commits mailing list