aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-profdata/llvm-profdata.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-11-03Use ErrorOr for the ::create factory on instrumented and sample profilers.Diego Novillo1-13/+16
Summary: As discussed in http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141027/242445.html, the creation of reader and writer instances is better done using ErrorOr. There are no functional changes, but several callers needed to be adjusted. Reviewers: bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6076 llvm-svn: 221120
2014-11-01Add show and merge tools for sample PGO profiles.Diego Novillo1-38/+125
Summary: This patch extends the 'show' and 'merge' commands in llvm-profdata to handle sample PGO formats. Using the 'merge' command it is now possible to convert one sample PGO format to another. The only format that is currently not working is 'gcc'. I still need to implement support for it in lib/ProfileData. The changes in the sample profile support classes are needed for the merge operation. Reviewers: bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6065 llvm-svn: 221032
2014-08-25Modernize raw_fd_ostream's constructor a bit.Rafael Espindola1-8/+8
Take a StringRef instead of a "const char *". Take a "std::error_code &" instead of a "std::string &" for error. A create static method would be even better, but this patch is already a bit too big. llvm-svn: 216393
2014-07-14Support: Fix option handling when using cl::Required with aliasoptJustin Bogner1-2/+2
Until now, attempting to create an alias of a required option would complain if the user supplied the alias, because the required option didn't have a value. Similarly, if you said the alias was required, then using the base option would complain that the alias wasn't supplied. Lastly, if you put required on both, *neither* option would work. By changning alias to overload addOccurrence and setting cl::Required on the original option, we can get this to behave in a more useful way. I've also added a test and updated a user that was getting this wrong. llvm-svn: 212986
2014-06-13Remove 'using std::error_code' from tools.Rafael Espindola1-4/+4
llvm-svn: 210876
2014-06-12Don't use 'using std::error_code' in include/llvm.Rafael Espindola1-0/+1
This should make sure that most new uses use the std prefix. llvm-svn: 210835
2014-04-29raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer1-0/+1
necessary. llvm-svn: 207593
2014-04-25[C++] Use 'nullptr'. Tools edition.Craig Topper1-1/+1
llvm-svn: 207176
2014-04-25ProfileData: Treat missing function counts as malformedJustin Bogner1-0/+1
llvm-svn: 207172
2014-04-18ProfileData: Add support for the indexed instrprof formatJustin Bogner1-5/+4
This adds support for an indexed instrumentation based profiling format, which is just a small header and an on disk hash table. This format will be used by clang's -fprofile-instr-use= for PGO. llvm-svn: 206656
2014-03-23llvm-profdata: Check for bad data in the show commandJustin Bogner1-0/+2
llvm-svn: 204573
2014-03-23llvm-profdata: Use Format.h instead of handrolling a formatterJustin Bogner1-19/+2
llvm-svn: 204571
2014-03-22llvm-profdata: Avoid F_Text in "merge" for now, since "llvm-profdata show" ↵NAKAMURA Takumi1-1/+2
is confused with CRLF. FIXME: line_iterator should be tolerant of CR. llvm-svn: 204540
2014-03-21ProfileData: Introduce InstrProfWriter using the naive text formatJustin Bogner1-35/+15
This isn't a format we'll want to write out in practice, but moving it to the writer library simplifies llvm-profdata and isolates it from further changes to the format. This also allows us to update the tests to not rely on the text output format. llvm-svn: 204489
2014-03-21llvm-profdata: Implement show commandJustin Bogner1-2/+98
The `llvm-profdata show` command summarizes a profdata file's contents in a human readable format. llvm-svn: 204485
2014-03-21ProfileData: Introduce the InstrProfReader interface and a text readerJustin Bogner1-68/+34
This introduces the ProfileData library and updates llvm-profdata to use this library for reading profiles. InstrProfReader is an abstract base class that will be subclassed for both the raw instrprof data from compiler-rt and the efficient instrprof format that will be used for PGO. llvm-svn: 204482
2014-03-20llvm-profdata: Remove an empty commentJustin Bogner1-1/+0
llvm-svn: 204370
2014-03-19llvm-profdata: Make "merge" into a subcommand.Justin Bogner1-16/+51
We'll be adding a few more subcommands in the near future. llvm-svn: 204211
2014-03-19llvm-profdata: Update to use the naive text format with function hashJustin Bogner1-101/+53
This also uses line_iterator to simplify the parsing logic. llvm-svn: 204210
2014-03-12Back out Profile library and dependent commitsJustin Bogner1-263/+117
Chandler voiced some concern with checking this in without some discussion first. Reverting for now. This reverts r203703, r203704, r203708, and 203709. llvm-svn: 203723
2014-03-12Profile: Remove an inefficient and unnecessary API functionJustin Bogner1-7/+7
This was leftover from an approach I abandoned, but I forgot to update it before committing. llvm-svn: 203708
2014-03-12llvm-profdata: Use the Profile library, implement show and generateJustin Bogner1-117/+263
This replaces the llvm-profdata tool with a version that uses the recently introduced Profile library. The new tool has the ability to generate and summarize profdata files as well as merging them. llvm-svn: 203704
2014-03-06Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles1-3/+2
This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
2014-02-24Replace the F_Binary flag with a F_Text one.Rafael Espindola1-1/+1
After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
2014-02-24Don't make F_None the default.Rafael Espindola1-1/+1
This will make it easier to switch the default to being binary files. llvm-svn: 202042
2014-02-17PGO: llvm-profdata: tool for merging profilesDuncan P. N. Exon Smith1-0/+178
Introducing llvm-profdata, a tool for merging profile data generated by PGO instrumentation in clang. - The name indicates a file extension of <name>.profdata. Eventually profile data output by clang should be changed to that extension. - llvm-profdata merges two profiles. However, the name is more general, since it will likely pick up more tasks (such as summarizing a single profile). - llvm-profdata parses the current text-based format, but will be updated once we settle on a binary format. <rdar://problem/15949645> llvm-svn: 201535