summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-profdata/llvm-profdata.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Re-apply r249644: Handle inline stacks in gcov-encoded sample profiles.Diego Novillo2015-10-081-1/+7
| | | | | | | | | | | | | This fixes memory allocation problems by making the merge operation keep the profile readers around until the merged profile has been emitted. This is needed to prevent the inlined function names to disappear from the function profiles. Since all the names are kept as references, once the reader disappears, the names are also deallocated. Additionally, XFAIL on big-endian architectures. The test case uses a gcov file generated on a little-endian system. llvm-svn: 249724
* InstrProf: Support for value profiling in the indexed profile formatJustin Bogner2015-09-291-7/+22
| | | | | | | | | Add support to the indexed instrprof reader and writer for the format that will be used for value profiling. Patch by Betul Buyukkurt, with minor modifications. llvm-svn: 248833
* Check for errors after reading a sample profile in llvm-profdata.Diego Novillo2015-09-171-1/+3
| | | | | | | After reading the profile, check if the reader returned any errors before showing the profile. llvm-svn: 247873
* modules: Move ProfileKinds to an anonymous namespaceDuncan P. N. Exon Smith2015-06-161-0/+2
| | | | | | | | Fix a build failure with `LLVM_ENABLE_MODULES` due to `ProfileData::instr` conflicting with a function `instr()` in `<curses.h>`. llvm-svn: 239793
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-0/+1
| | | | | | NFC. llvm-svn: 232976
* Make helper functions static.Benjamin Kramer2015-03-091-13/+13
| | | | | | Found by -Wmissing-prototypes. NFC. llvm-svn: 231664
* Assigning and copying command line option objects shouldn't be allowed.Chris Bieneman2015-01-221-2/+4
| | | | | | | | | | | | | | | Summary: The default copy and assignment operators for these objects probably don't actually do what the clients intend, so they should be deleted. Places using the assignment operator to set the value of an option should cast to the option's data type first to call into the override for operator=. Places using the copy constructor just need to be changed to not copy (i.e. passing by const reference instead of value). Reviewers: dexonsmith, chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7114 llvm-svn: 226762
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-141-1/+1
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* Use ErrorOr for the ::create factory on instrumented and sample profilers.Diego Novillo2014-11-031-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
* Add show and merge tools for sample PGO profiles.Diego Novillo2014-11-011-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
* Modernize raw_fd_ostream's constructor a bit.Rafael Espindola2014-08-251-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
* Support: Fix option handling when using cl::Required with aliasoptJustin Bogner2014-07-141-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
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-131-4/+4
| | | | llvm-svn: 210876
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-0/+1
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-291-0/+1
| | | | | | necessary. llvm-svn: 207593
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-251-1/+1
| | | | llvm-svn: 207176
* ProfileData: Treat missing function counts as malformedJustin Bogner2014-04-251-0/+1
| | | | llvm-svn: 207172
* ProfileData: Add support for the indexed instrprof formatJustin Bogner2014-04-181-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
* llvm-profdata: Check for bad data in the show commandJustin Bogner2014-03-231-0/+2
| | | | llvm-svn: 204573
* llvm-profdata: Use Format.h instead of handrolling a formatterJustin Bogner2014-03-231-19/+2
| | | | llvm-svn: 204571
* llvm-profdata: Avoid F_Text in "merge" for now, since "llvm-profdata show" ↵NAKAMURA Takumi2014-03-221-1/+2
| | | | | | | is confused with CRLF. FIXME: line_iterator should be tolerant of CR. llvm-svn: 204540
* ProfileData: Introduce InstrProfWriter using the naive text formatJustin Bogner2014-03-211-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
* llvm-profdata: Implement show commandJustin Bogner2014-03-211-2/+98
| | | | | | | The `llvm-profdata show` command summarizes a profdata file's contents in a human readable format. llvm-svn: 204485
* ProfileData: Introduce the InstrProfReader interface and a text readerJustin Bogner2014-03-211-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
* llvm-profdata: Remove an empty commentJustin Bogner2014-03-201-1/+0
| | | | llvm-svn: 204370
* llvm-profdata: Make "merge" into a subcommand.Justin Bogner2014-03-191-16/+51
| | | | | | We'll be adding a few more subcommands in the near future. llvm-svn: 204211
* llvm-profdata: Update to use the naive text format with function hashJustin Bogner2014-03-191-101/+53
| | | | | | This also uses line_iterator to simplify the parsing logic. llvm-svn: 204210
* Back out Profile library and dependent commitsJustin Bogner2014-03-121-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
* Profile: Remove an inefficient and unnecessary API functionJustin Bogner2014-03-121-7/+7
| | | | | | | This was leftover from an approach I abandoned, but I forgot to update it before committing. llvm-svn: 203708
* llvm-profdata: Use the Profile library, implement show and generateJustin Bogner2014-03-121-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
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-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
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-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
* Don't make F_None the default.Rafael Espindola2014-02-241-1/+1
| | | | | | This will make it easier to switch the default to being binary files. llvm-svn: 202042
* PGO: llvm-profdata: tool for merging profilesDuncan P. N. Exon Smith2014-02-171-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
OpenPOWER on IntegriCloud