Add -detailed-summary support for sample profile dump to match that of instrumentation profile.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/tools/llvm-profdata/llvm-profdata.cpp | ||
---|---|---|
839 | Can we make it a member function of ProfileSummary? We may use the dump function in other places. |
llvm/tools/llvm-profdata/llvm-profdata.cpp | ||
---|---|---|
839 | Sure, moved both to be member functions. |
llvm/lib/IR/ProfileSummary.cpp | ||
---|---|---|
209–215 | Why we need printSummary and printDetailedSummary instead of one print function? printSummary seems only print very limited information in ProfileSummary. |
llvm/lib/IR/ProfileSummary.cpp | ||
---|---|---|
209–215 | 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. |
llvm/lib/IR/ProfileSummary.cpp | ||
---|---|---|
209–215 | 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? |
llvm/lib/IR/ProfileSummary.cpp | ||
---|---|---|
209–215 | 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... |
llvm/lib/IR/ProfileSummary.cpp | ||
---|---|---|
209–215 | Ok, then can we let printDetailedSummary just print stuff in DetailedSummary and let printSummary print more information like NumCounts, TotalCounts, ....? It makes what those functions should print a little clearer. InstrProf can print NumCounts and TotalCounts directly since it has already done that in this way. |
llvm/lib/IR/ProfileSummary.cpp | ||
---|---|---|
209–215 | Good point, changed. |
Why we need printSummary and printDetailedSummary instead of one print function? printSummary seems only print very limited information in ProfileSummary.