summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingWriter.c
AgeCommit message (Collapse)Author
2017-12-14[profile] Port the runtime to Solaris (retry)Vedant Kumar
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320731 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14Revert "(HEAD -> master, origin/master, origin/HEAD) [profile] Port the ↵Vedant Kumar
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[profile] Port the runtime to SolarisVedant Kumar
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320726 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28[PGO] Reduce IO in profile dumping with mergingXinliang David Li
Differential Revision: http://reviews.llvm.org/D34709 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306561 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27[PGO] Refactor file/buffer writer callback interfaces /NFCXinliang David Li
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-16Avoid leak. Free before resetting.Sean Silva
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269724 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-15Use __builtin_alloca with __GNUC__Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-15Fix FreeBSD build failureXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269587 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14[profile] Eliminate dynamic memory allocation for vp writingXinliang David Li
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269576 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-14minor cleanup -- reset buffer pointerXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269533 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-13[profile] Eliminate dynamic memory allocation for buffered writerXinliang David Li
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-12Minor code refactoring /NFCXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@269351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10Reapply r268840: [profile] Simplify value profile writingXinliang David Li
Revert r268864 that reverted 268840 after underlying problem is fixed for arm bot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268992 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-09Fix variable visibilityXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268952 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07Revert "[profile] Simplify value profile writing"Renato Golin
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268864 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-07[profile] Simplify value profile writingXinliang David Li
With this patch, value data are longer pre-collected before writing. The code is simplified and requires less heap space for dumping. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06[PGO] internal API name cleanups (for better consistency)Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262788 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26[profile] Compute number of data entries correctlyVedant Kumar
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261957 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29[PGO]: Refactor VP data writerXinliang David Li
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256604 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-29[PGO]: Do not update Data->Value field during profile write.Xinliang David Li
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256543 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22[PGO] Move buffer write callback to a common fileXinliang David Li
This is a NFC refactoring enabling code sharing by file writer. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256264 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-16[PGO] cleanup: unify prefix for portability macrosXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255748 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04Don't shadow a variable in the outer scope. Use canonical form of theJoerg Sonnenberger
array size idiom. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254673 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23[PGO] Unify raw profile header definitionXinliang David Li
Replace duplicate definition raw header with common definition in InstrProfData.inc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253896 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23[PGO] Compiler-rt cleanup -- introduces macros for various macrosXinliang David Li
This makes code more readable and be made more portable in the future. There is no functional change. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253845 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21Fix -Wpointer-sign warningXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253770 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21[PGO] Implement a more robust/readable Writer callback interfaceXinliang David Li
(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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253764 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20[PGO] Profile runtime name cleanupsXinliang David Li
Value profile enumerator change to match LLVM code ProfData new member field name change to match LLVM code ProfData member type change to match LLVM code Do not use lower case for types that are internal to implementation (not exposed to APIs) There is no functional change. This is a preparation patch to enable more code sharing in follow up patches Differential Revision: http://reviews.llvm.org/D14841 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253700 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-19[PGO] Minor cleanups (from review feedback)Xinliang David Li
1. fix naming problem of file/buffer writer 2. change BufferOrFile to WriterCtx 3. move writer and writerctx together git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253545 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18Fix format of previous patch (NFC)Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253503 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18[PGO] Refactor File and Buffer API profile writing codeXinliang David Li
With this change, Buffer API and File API implementations are unified. Differential Revision: http://reviews.llvm.org/D14692 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253500 91177308-0d34-0410-b5e6-96231b3b80d8