summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-profdata
Commit message (Collapse)AuthorAgeFilesLines
...
* [PGO] Add --text option for llvm-profdata show|merge commandsXinliang David Li2015-11-231-37/+70
| | | | | | | | | | | | | | The new option is similar to the SampleProfile dump option. - dump raw/indexed format into text profile format - merge the profile and output into text profile format. Note that Value Profiling data text format is not yet designed. That functionality will be added later. Differential Revision: http://reviews.llvm.org/D14894 llvm-svn: 253913
* [llvm-profdata] Use SmallSet rather that std::set for keeping track of ↵Nathan Slingerland2015-11-181-3/+2
| | | | | | | | | | profdata merge errors Missed bit of feedback from D14720. Use SmallSet<std::error_code> rather than std::set<...> in order to be more efficient. llvm-svn: 253474
* [llvm-profdata] Fix unhandled enumeration values warningNathan Slingerland2015-11-181-0/+2
| | | | | | | | | | Fix this: llvm/tools/llvm-profdata/llvm-profdata.cpp:78:15: warning: 12 enumeration values not handled in switch: 'success', 'eof', 'unrecognized_format'... [-Wswitch] switch (instrError) { ^ llvm-svn: 253413
* [llvm-profdata] Show hint for other mismatch errors when merging instr profdataNathan Slingerland2015-11-171-1/+5
| | | | | | | | | | | Missed bit of feedback from D14720. Show the same "Make sure that all profile data to be merged is generated from the same binary." hint for hash mismatch and value site count mismatch as we now do for counter mismatch when merging incompatible instrumentation profile data. llvm-svn: 253400
* [llvm-profdata] Improve error messaging when merging mismatched profile dataNathan Slingerland2015-11-171-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change tries to make the root cause of instrumented profile data merge failures clearer. Previous: $ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata test_1.profraw: foo: Function count mismatch test_1.profraw: bar: Function count mismatch test_1.profraw: baz: Function count mismatch ... Changed: $ llvm-profdata merge test_0.profraw test_1.profraw -o test_merged.profdata test_1.profraw: foo: Function basic block count change detected (counter mismatch) Make sure that all profile data to be merged is generated from the same binary. test_1.profraw: bar: Function basic block count change detected (counter mismatch) test_1.profraw: baz: Function basic block count change detected (counter mismatch) ... Reviewers: dnovillo, davidxl, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14739 llvm-svn: 253384
* [llvm-profdata] Add check for text profile formats and improve error ↵Nathan Slingerland2015-11-131-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reporting (2nd try) Summary: This change addresses two possible instances of user error / confusion when merging sampled profile data. Previously any input that didn't match the raw or processed instrumented format would automatically be interpreted as instrumented profile text format data. No error would be reported during the merge. Example: If foo-sampled.profdata and bar-sampled.profdata are binary sampled profiles: Old behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -output foobar-sampled.profdata $ llvm-profdata show -sample foobar-sampled.profdata error: foobar-sampled.profdata:1: Expected 'mangled_name:NUM:NUM', found lprofi This change adds basic checks for valid input data when assuming text input. It also makes error messages related to file format validity more specific about the assumbed profile data type. New behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -o foobar-sampled.profdata error: foo.profdata: Unrecognized instrumentation profile encoding format Perhaps you forgot to use the -sample option? Reviewers: bogner, davidxl, dnovillo Subscribers: davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D14558 llvm-svn: 253009
* reverting r252916 to investigate test failureNathan Slingerland2015-11-121-29/+13
| | | | llvm-svn: 252921
* [llvm-profdata] Add check for text profile formats and improve error reportingNathan Slingerland2015-11-121-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change addresses two possible instances of user error / confusion when merging sampled profile data. Previously any input that didn't match the raw or processed instrumented format would automatically be interpreted as instrumented profile text format data. No error would be reported during the merge. Example: If foo-sampled.profdata and bar-sampled.profdata are binary sampled profiles: Old behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -output foobar-sampled.profdata $ llvm-profdata show -sample foobar-sampled.profdata error: foobar-sampled.profdata:1: Expected 'mangled_name:NUM:NUM', found lprofi This change adds basic checks for valid input data when assuming text input. It also makes error messages related to file format validity more specific about the assumbed profile data type. New behavior: $ llvm-profdata merge foo-sampled.profdata bar-sampled.profdata -o foobar-sampled.profdata error: foo.profdata: Unrecognized instrumentation profile encoding format Perhaps you forgot to use the -sample option? Reviewers: bogner, davidxl, dnovillo Subscribers: davidxl, llvm-commits Differential Revision: http://reviews.llvm.org/D14558 llvm-svn: 252916
* [PGO] Value profiling (index format) code cleanup and testingXinliang David Li2015-11-021-5/+9
| | | | | | | | | | | | | | | | | 1. Added a set of public interfaces in InstrProfRecord class to access (read/write) value profile data. 2. Changed IndexedProfile reader and writer code to use the newly defined interfaces and hide implementation details. 3. Added a couple of unittests for value profiling: - Test new interfaces to get and set value profile data - Test value profile data merging with various scenarios. No functional change is expected. The new interfaces will also make it possible to change on-disk format of value prof data to be more compact (to be submitted). llvm-svn: 251771
* 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
* [CMake] llvm-profdata requires Core.NAKAMURA Takumi2014-11-011-1/+5
| | | | llvm-svn: 221046
* 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 doesn't require LLVMCore.NAKAMURA Takumi2014-03-232-2/+2
| | | | llvm-svn: 204552
* 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-214-71/+37
| | | | | | | | | | 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-124-266/+120
| | | | | | | | | 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-124-120/+266
| | | | | | | | 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-174-0/+222
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