summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfilingInternal.h
Commit message (Collapse)AuthorAgeFilesLines
* [profile] Avoid allocating a page on the stack, NFCVedant Kumar2019-12-111-0/+7
| | | | | | | | | | | | | | | | | | | | | When writing out a profile, avoid allocating a page on the stack for the purpose of writing out zeroes, as some embedded environments do not have enough stack space to accomodate this. Instead, use a small, fixed-size zero buffer that can be written repeatedly. For a synthetic file with >100,000 functions, I did not measure a significant difference in profile write times. We are removing a page-length zero-fill `memset()` in favor of several smaller buffered `fwrite()` calls: in practice, I am not sure there is much of a difference. The performance impact is only expected to affect the continuous sync mode (%c) -- zero padding is less than 8 bytes in all other cases. rdar://57810014 Differential Revision: https://reviews.llvm.org/D71323
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [profile] Port the runtime to Solaris (retry)Vedant Kumar2017-12-141-1/+2
| | | | | | | | | | | | | This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Hopefully the Windows support is fixed now. Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 llvm-svn: 320731
* Revert "(HEAD -> master, origin/master, origin/HEAD) [profile] Port the ↵Vedant Kumar2017-12-141-2/+1
| | | | | | | | | | | runtime to Solaris" This reverts commit r320726. It looks like flock isn't available on Windows: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21317/steps/build%20compiler-rt/logs/stdio llvm-svn: 320728
* [profile] Port the runtime to SolarisVedant Kumar2017-12-141-1/+2
| | | | | | | | | | | This includes a few nice bits of refactoring (e.g splitting out the exclusive locking code into a common utility). Patch by Rainer Orth! Differential Revision: https://reviews.llvm.org/D40944 llvm-svn: 320726
* Revert r312240Alex Lorenz2017-08-311-5/+5
| | | | | | | The buildbots have shown that -Wstrict-prototypes behaves differently in GCC and Clang so we should keep it disabled until Clang follows GCC's behaviour llvm-svn: 312246
* Build LLVM with -Wstrict-prototypes enabledAlex Lorenz2017-08-311-5/+5
| | | | | | | | | | | Clang 5 supports -Wstrict-prototypes. We should use it to catch any C declarations that declare a non-prototype function. rdar://33705313 Differential Revision: https://reviews.llvm.org/D36669 llvm-svn: 312240
* [PGO] Reduce IO in profile dumping with mergingXinliang David Li2017-06-281-3/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D34709 llvm-svn: 306561
* [PGO] Refactor file/buffer writer callback interfaces /NFCXinliang David Li2017-06-271-12/+17
| | | | | | | | | | Introduces a 'owner' struct to include the overridable write method and the write context in C. This allows easy introdution of new member API to help reduce profile merge time in the follow up patch. llvm-svn: 306432
* [Profile] Remove unused variableXinliang David Li2016-09-221-1/+0
| | | | llvm-svn: 282198
* [Profile] Implement new API __llvm_profile_dumpXinliang David Li2016-08-091-0/+7
| | | | | | | | | The API is intended to be used by user to do fine grained (per-region) control of profile dumping. Differential Revision: http://reviews.llvm.org/D23106 llvm-svn: 278092
* [Profile] move utility interfaces to the right header /NFCXinliang David Li2016-07-191-14/+0
| | | | llvm-svn: 276021
* Code refactoring: extract path prefix handling codeXinliang David Li2016-07-181-0/+14
| | | | | | .. into reusable interfaces. No functional change is expected. llvm-svn: 275807
* [profile] in-process merging support part-3Xinliang David Li2016-06-081-0/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D21056 llvm-svn: 272227
* [profile] Static counter allocation for value profiling (part-2)Xinliang David Li2016-05-211-0/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D20460 llvm-svn: 270337
* [profile] entry eviction support in value profilerXinliang David Li2016-05-191-0/+4
| | | | | | Differential revision: http://reviews.llvm.org/D20408 llvm-svn: 270141
* [profile] Allow max vals per site to be controllable at runtimeXinliang David Li2016-05-181-0/+3
| | | | llvm-svn: 269993
* [profile] Eliminate dynamic memory allocation for vp writingXinliang David Li2016-05-141-6/+38
| | | | | | | | | | This is part-3 of the effort to eliminate dependency on libc allocator in instr profiler runtime. With this change, the profile dumper is completely free of malloc/calloc. Value profile instr API implementation is the only remaining piece with calloc dependency. llvm-svn: 269576
* [profile] Eliminate dynamic memory allocation for buffered writerXinliang David Li2016-05-131-5/+6
| | | | | | | | With this change, dynamic memory allocation is only used for testing purpose. This change is one of the many steps to make instrument profiler dynamic allocation free. llvm-svn: 269453
* Reapply r268840: [profile] Simplify value profile writingXinliang David Li2016-05-101-4/+7
| | | | | | | Revert r268864 that reverted 268840 after underlying problem is fixed for arm bot. llvm-svn: 268992
* Fix variable visibilityXinliang David Li2016-05-091-3/+3
| | | | llvm-svn: 268952
* Revert "[profile] Simplify value profile writing"Renato Golin2016-05-071-8/+4
| | | | | | | | This reverts commit r268840, as it breaks Thumb2 self-hosting. There is something unstable in the profiling for Thumb2 that needs to be sorted out before we continue implementing these changes to the profiler. See PR27667. llvm-svn: 268864
* [profile] Simplify value profile writingXinliang David Li2016-05-071-4/+8
| | | | | | | | With this patch, value data are longer pre-collected before writing. The code is simplified and requires less heap space for dumping. llvm-svn: 268840
* [PGO] internal API name cleanups (for better consistency)Xinliang David Li2016-03-061-22/+22
| | | | llvm-svn: 262788
* [PGO] Add API for profile merge from bufferXinliang David Li2016-03-031-1/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D17831 llvm-svn: 262644
* [PGO]: Refactor VP data writerXinliang David Li2015-12-291-1/+48
| | | | | | | | | Extract the buffered filer writer code used by value profile writer and turn it into common/sharable buffered fileIO interfaces. Added a test case for the buffered file writer and rewrite the VP dumping using the new APIs. llvm-svn: 256604
* [PGO]: Do not update Data->Value field during profile write.Xinliang David Li2015-12-291-2/+5
| | | | | | | | | | The profile reader no longer depends on this field to be updated and point to owning func's vp data. The VP data also no longer needs to be allocated in a contiguous memory space. Differential Revision: http://reviews.llvm.org/D15258 llvm-svn: 256543
* [PGO] Move buffer write callback to a common fileXinliang David Li2015-12-221-0/+2
| | | | | | This is a NFC refactoring enabling code sharing by file writer. llvm-svn: 256264
* [PGO] Move impl specific decl to InstrProfilingInternal.h (NFC)Xinliang David Li2015-12-101-0/+2
| | | | llvm-svn: 255290
* Fix -Wpointer-sign warningXinliang David Li2015-11-211-1/+1
| | | | llvm-svn: 253770
* [PGO] Implement a more robust/readable Writer callback interfaceXinliang David Li2015-11-211-4/+10
| | | | | | | | | | | | (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/+4
| | | | | | | | 1. fix naming problem of file/buffer writer 2. change BufferOrFile to WriterCtx 3. move writer and writerctx together llvm-svn: 253545
* Fix format of previous patch (NFC)Xinliang David Li2015-11-181-4/+6
| | | | llvm-svn: 253503
* [PGO] Refactor File and Buffer API profile writing codeXinliang David Li2015-11-181-0/+15
| | | | | | | | | With this change, Buffer API and File API implementations are unified. Differential Revision: http://reviews.llvm.org/D14692 llvm-svn: 253500
* profile: Add low level versions of profile buffer functionsJustin Bogner2014-12-091-0/+40
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
OpenPOWER on IntegriCloud