summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfilingBuffer.c
Commit message (Collapse)AuthorAgeFilesLines
* [PGO] internal API name cleanups (for better consistency)Xinliang David Li2016-03-061-4/+4
| | | | llvm-svn: 262788
* [profile] Compute number of data entries correctlyVedant Kumar2016-02-261-4/+11
| | | | | | | | | | | | | | | | Compiler-rt miscalculates the number of entries in the __llvm_prf_data section on i386 Darwin. This results in a number of test failures (which we started catching after r261344). The fix we attempted earlier is insufficient (r261683). It caused some tests to start passing again, but that hid the fact that we drop some data entries. This patch should fix the real problem. It fixes the way we compute DataSize by taking into account the way the Darwin linker lays out __llvm_prf_data. Differential Revision: http://reviews.llvm.org/D17623 llvm-svn: 261957
* [PGO] Move buffer write callback to a common fileXinliang David Li2015-12-221-19/+2
| | | | | | This is a NFC refactoring enabling code sharing by file writer. llvm-svn: 256264
* [PGO] cleanup: unify prefix for portability macrosXinliang David Li2015-12-161-5/+4
| | | | llvm-svn: 255748
* Fix a bug introduced in cleanupXinliang David Li2015-11-231-1/+1
| | | | llvm-svn: 253847
* [PGO] Compiler-rt cleanup -- introduces macros for various macrosXinliang David Li2015-11-231-8/+7
| | | | | | | This makes code more readable and be made more portable in the future. There is no functional change. llvm-svn: 253845
* [PGO] Implement a more robust/readable Writer callback interfaceXinliang David Li2015-11-211-8/+15
| | | | | | | | | | | | (patch suggested by silvas) With this patch, the IO information is wrapped in struct ProfDataIOVec, and interface of writerCallback takes a vector of IOVec and a pointer to writer context pointer. Differential Revision: http://reviews.llvm.org/D14859 llvm-svn: 253764
* [PGO] Minor cleanups (from review feedback)Xinliang David Li2015-11-191-3/+3
| | | | | | | | 1. fix naming problem of file/buffer writer 2. change BufferOrFile to WriterCtx 3. move writer and writerctx together llvm-svn: 253545
* [PGO] Refactor File and Buffer API profile writing codeXinliang David Li2015-11-181-63/+16
| | | | | | | | | With this change, Buffer API and File API implementations are unified. Differential Revision: http://reviews.llvm.org/D14692 llvm-svn: 253500
* [PGO] Runtime support for value profiling.Betul Buyukkurt2015-11-181-2/+5
| | | | | | | | This change adds extends the data structures and adds in the routines for handling runtime calls for value profiling. The profile data format is modified and the version number is incremented. llvm-svn: 253483
* [PGO] Ensure profile section symbols are created (linux)Xinliang David Li2015-11-131-0/+4
| | | | | | | | | | | | | - This is to handle a corner case where profile lib is linked in but non of the modules are instrumented (On linux, since we avoided the overhead to emit runtime hook use functions so this is the side effect of that size optimization). - Added a profile runtime test case to cover all scenarios of shared library builds. Differential Revision: http://reviews.llvm.org/D14468 llvm-svn: 253098
* Use struct type instead of raw array for raw profile header (NFC)Xinliang David Li2015-10-161-10/+10
| | | | | | | | | | This patch introduces a well defined header struct to represent raw profile header instead of using raw array. Previously the raw array is used in two different files and is very error prone when header structure is re-organized. This is a small cleanup with NFC. llvm-svn: 250561
* profile: Add low level versions of profile buffer functionsJustin Bogner2014-12-091-4/+39
| | | | | | | | | | | | On Darwin, compiler_rt uses magic linker symbols to find the profile counters in the __DATA segment. This is a reasonable method for normal, hosted, userspace programs. However programs with custom memory layouts, such as the kernel, will need to tell compiler_rt explicitly where to find these sections. Patch by Lawrence D'Anna. Thanks! llvm-svn: 223840
* profile: Avoid name collisions between instrumentation and runtimeJustin Bogner2014-09-041-6/+6
| | | | | | | | | | | | The naming scheme we're using for counters in profile data shares a prefix with some fixed names we use for the runtime, notably __llvm_profile_data_begin and _end. Embarrassingly, this means a function called begin() can't be instrumented. This modifies the runtime names so as not to collide with the instrumentation. llvm-svn: 217166
* InstrProf: Fix shared object profilingDuncan P. N. Exon Smith2014-05-161-1/+10
| | | | | | | | | | | | | | | | | | Change the API of the instrumented profiling library to work with shared objects. - Most things are now declared hidden, so that each executable gets its own copy. - Initialization hooks up a linked list of writers. - The raw format with shared objects that are profiled consists of a concatenated series of profiles. llvm-profdata knows how to deal with that since r208938. <rdar://problem/16918688> llvm-svn: 208940
* profile: Fix the build with gcc 4.9Reid Kleckner2014-05-011-9/+8
| | | | | | | | | | GCC -pedantic warns that the initialization of Header is not constant: InstrProfilingFile.c:31:5: error: initializer element is not computable at load time [-Werror] LLVM defaults to enabling -pedantic. If this warning is unhelpful, we can consider revisiting that decision. llvm-svn: 207784
* Avoid GCC's "cast from pointer to integer of different size" warning.David Blaikie2014-03-211-2/+2
| | | | | | | | This is a bit of a stab in the dark as I'm not sure I've got these source files compiling correctly locally. (and the warning only reproduces on a 32bit build anyway) llvm-svn: 204521
* InstrProf: Unify logic in two profile writersDuncan P. N. Exon Smith2014-03-211-6/+10
| | | | | | <rdar://problem/15943240> llvm-svn: 204500
* InstrProf: Write the __llvm_profile_write_buffer()Duncan P. N. Exon Smith2014-03-211-2/+45
| | | | | | | | | | Write __llvm_profile_write_buffer(), which uses the same logic as __llvm_profile_write_file(), but writes directly to a provided `char*` buffer instead. <rdar://problem/15943240> llvm-svn: 204499
* InstrProf: If libc is available, use it; no functionality changeDuncan P. N. Exon Smith2014-03-211-41/+1
| | | | | | | | | | | | | It was misguided to plan to rely on __llvm_profile_write_buffer() in __llvm_profile_write_file(). It's less complex to duplicate the writing logic than to mmap the file. Since it's here to stay, move `FILE*`-based writing logic into InstrProfilingFile.c. <rdar://problem/15943240> llvm-svn: 204498
* InstrProf: Reorganize files; no functionality changeDuncan P. N. Exon Smith2014-03-211-0/+54
Move functions around to prepare for some other changes. - Merge InstrProfilingExtras.h with InstrProfiling.h. There's no benefit to having these split. - Rename InstrProfilingExtras.c to InstrProfilingFile.c. - Split actual buffer writing code out of InstrProfiling.c into InstrProfilingBuffer.c. - Drive-by corrections of a couple of header comments. <rdar://problem/15943240> llvm-svn: 204497
OpenPOWER on IntegriCloud