[PATCH] D35155: [ProfileData] Add new option to dump top N hottest functions
Vedant Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 11 11:25:07 PDT 2017
vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.
Lgtm with two nitpicks.
================
Comment at: test/tools/llvm-profdata/c-general.test:14
+RUN: llvm-profdata show %p/Inputs/c-general.profraw --topn=3 -o - | FileCheck %s
RUN: llvm-profdata show %p/Inputs/c-general.profraw -o - --function=switches | FileCheck %s -check-prefix=SWITCHES -check-prefix=CHECK
----------------
davidxl wrote:
> vsk wrote:
> > I think --topn and --all-functions should be mutually incompatible.
> They are compatible. One use case is to dump them together into one file. User can first look at the top functions and examine the counter details for the function of interest.
Ah ok.
================
Comment at: tools/llvm-profdata/llvm-profdata.cpp:508
raw_fd_ostream &OS) {
+ using namespace std;
auto ReaderOrErr = InstrProfReader::create(Filename);
----------------
The coding standards have an explicit rule against 'using namespace std', which is more stylistic than practical when applied to implementation files, but still important for consistency.
================
Comment at: tools/llvm-profdata/llvm-profdata.cpp:629
+ << " functions with the largest internal block counts: \n";
+ for (auto hotfunc : llvm::reverse(SortedHottestFuncs))
+ OS << " " << hotfunc.first << ", max count = " << hotfunc.second << "\n";
----------------
const auto &
https://reviews.llvm.org/D35155
More information about the llvm-commits
mailing list