summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile
Commit message (Collapse)AuthorAgeFilesLines
...
* [libprofile] Handle '\\' in __llvm_profile_recursive_mkdirSean Silva2016-03-282-3/+5
| | | | | | | | | | | | | | This is implicitly needed at least by gcc-flag-compatibility.test The thing that needs it is the `\` preceding the "default.profraw" appended internally by clang when doing `-fprofile-use=`. Clang uses `\` because is uses sys::path::append which will use `\` on a Windows host. This is wrong, but I don't think there's an easy way to solve it (maybe just always using `/` since places that accept `\` also tend to accept `/`, but not the other way around). llvm-svn: 264665
* [PGO] Update r264612 to use C-style commentAdam Nemet2016-03-281-2/+4
| | | | llvm-svn: 264615
* [PGO] Comment how function pointers for indirect calls are mapped to ↵Adam Nemet2016-03-281-0/+2
| | | | | | | | | | | | | | | | function names Summary: Hopefully this will make it easier for the next person to figure all this out... Reviewers: bogner, davidxl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18490 llvm-svn: 264612
* Fix test failure on darwin-i386Xinliang David Li2016-03-091-1/+2
| | | | llvm-svn: 263065
* [Fix r262785] Fix missing declaration when COMPILER_RT_BOOL_CMPXCHG was used ↵Filipe Cabecinhas2016-03-072-1/+2
| | | | | | | | but InstrProfilingUtil.h wasn't included. Also fixed declaration which still had the pre-r262788 name. llvm-svn: 262827
* cleanup: remove dead preprocessing branch /nfcXinliang David Li2016-03-061-2/+0
| | | | llvm-svn: 262792
* [PGO] cleanup: move one support method into InstrProfilingUtil.h /NFCXinliang David Li2016-03-063-13/+19
| | | | llvm-svn: 262791
* [PGO] internal API name cleanups (for better consistency)Xinliang David Li2016-03-067-69/+70
| | | | llvm-svn: 262788
* Minor cleanupXinliang David Li2016-03-063-12/+15
| | | | | | move a function def to InstrProfilingUtil.c llvm-svn: 262785
* [GCDA] Unlock arc file before closing itVedant Kumar2016-03-051-1/+1
| | | | | | | | | The GCDA writer closed the arc file before unlocking it. This causes an EBADF while unlocking the file, and opens us up to racy behavior. Fixes PR26847. llvm-svn: 262779
* [PGO] Add API to check compatibility of profile data in bufferXinliang David Li2016-03-042-1/+55
| | | | | | This is needed by client which uses in-process merge API. llvm-svn: 262736
* Fix api visibilityXinliang David Li2016-03-041-0/+1
| | | | llvm-svn: 262734
* [PGO] Add API for profile merge from bufferXinliang David Li2016-03-035-1/+128
| | | | | | Differential Revision: http://reviews.llvm.org/D17831 llvm-svn: 262644
* Add some minimal portability code paths for PS4.Sean Silva2016-03-022-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Hi David, SCE folks, What is implemented in this patch is enough for the upstream libprofile to work for PGO with the PS4 game codebase I tested ("game7" for you SCE folks; this is with a standalone build of compiler-rt). The first change, which is simple, is to stub out gethostname. PS4 doesn't have a simple analog for this that doesn't bring in extra OS libraries, so for now we do not support `%h` expansion. This is consistent with internal B#136272. The second change implies future work, but is a simple change at present. PS4 does not have `getenv`, so for now we will introduce a shim. This obviously makes it impossible for many of the tests to be run since they require setting `LLVM_PROFILE_FILE=`. I see two paths forward: 1. In the tests we are already wrapping execution with `%run` and so by setting a PS4-specific expansion for `%run` we can pass the information in another way We can adapt the getenv shim as appropriate. We will need to experiment with this internally. Maggie, Phillip, Filipe? Any ideas? Maybe ping me internally since we may need to get into some PS4 vagaries. I'm thinking a fake getenv library that uses some side channel for communication. 2. Another possibility which is more verbose is to use a separate clang invocation with `-profile-generate=<filename>` to set the filename in each test. This might require redundant clang invocations though which may be undesirable for upstream. David, thoughts? Also, this is a fairly libprofile-specific workaround, so it e.g. doesn't help Filipe's ASan work. Overall, this approach sounds like a bit of a hack to me. Small detail: InstrProfilingPort.h seems like the natural place for the getenv shim, but GCDAProfiling.c needs it as well. InstrProfilingUtil.h is currently the only header common between InstrProfilingFile.c and GCDAProfiling.c. I can move the shim to InstrProfilingPort.h and add an include to GCDAProfiling.c as per your preference David. Reviewers: davidxl, MaggieYi, phillip.power, filcab Subscribers: simon.f.whittaker, slingn, probinson, llvm-commits Differential Revision: http://reviews.llvm.org/D17676 llvm-svn: 262527
* [profile] Compute number of data entries correctlyVedant Kumar2016-02-264-7/+18
| | | | | | | | | | | | | | | | 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
* Sync up with masterXinliang David Li2016-02-261-0/+3
| | | | llvm-svn: 261947
* [profile] Fix iteration over profile data entriesVedant Kumar2016-02-232-2/+2
| | | | | | | | | | | | | | Fix a crash when gathering value profile data on i386 Darwin. The Darwin linker shrinks sections containing aligned structures when padding is not explicitly added to the end of the structure. When iterating over these structures, be sure to not walk past the end of the section. No tests added, since running `ninja check-profile` on i386 Darwin is enough to reproduce the original crash. llvm-svn: 261683
* Silence MSVC warning about non-void prototypesReid Kleckner2016-02-111-3/+3
| | | | | | | | | | | It thinks that these functions don't match the function pointer type that they are passed with: GCDAProfiling.c(578) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)' GCDAProfiling.c(579) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)' GCDAProfiling.c(580) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)' llvm-svn: 260475
* [PGO] Update InstrProfData.inc to sync with llvmRong Xu2016-02-081-1/+3
| | | | | | Sync InstrProfData.inc with the one in llvm. llvm-svn: 260148
* Fix windows build bot failureXinliang David Li2016-02-081-1/+2
| | | | llvm-svn: 260120
* [PGO] Enable compression in pgo instrumentationXinliang David Li2016-02-082-28/+46
| | | | | | | | | | | | This reduces sizes of instrumented object files, final binaries, process images, and raw profile data. The format of the indexed profile data remain the same. Differential Revision: http://reviews.llvm.org/D16388 llvm-svn: 260118
* Sync up with master fileXinliang David Li2016-02-031-1/+1
| | | | llvm-svn: 259627
* Fix build with VS2015Ismail Donmez2016-01-301-0/+2
| | | | llvm-svn: 259301
* [profile] Support hostname expansion in LLVM_PROFILE_FILEVedant Kumar2016-01-292-8/+44
| | | | | | | | | | | This patch adds support for expanding "%h" out to the machine hostname in the LLVM_PROFILE_FILE environment variable. Patch by Daniel Waters! Differential Revision: http://reviews.llvm.org/D16371 llvm-svn: 259272
* Minor cleanup /NFCXinliang David Li2016-01-282-4/+1
| | | | llvm-svn: 259068
* Sync up with master fileXinliang David Li2016-01-271-17/+14
| | | | llvm-svn: 258890
* Remove autoconf support for building runtime libraries.Chris Bieneman2016-01-261-18/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I am the punishment of God... If [autoconf] had not committed great sins, God would not have sent a punishment like me upon [it]." -Genghis Khan Reviewers: chandlerc, grosbach, bob.wilson, zaks.anna, kubabrecka, samsonov, echristo Subscribers: iains, llvm-commits Differential Revision: http://reviews.llvm.org/D16473 llvm-svn: 258863
* sync up InstrProfData.h -- typo fixXinliang David Li2016-01-251-1/+1
| | | | llvm-svn: 258717
* Fix -Wexpansion-to-defined warnings in compiler-rt.Nico Weber2016-01-191-1/+5
| | | | llvm-svn: 258200
* sync up with master fileXinliang David Li2016-01-141-1/+1
| | | | llvm-svn: 257746
* Fix typo in commentXinliang David Li2016-01-081-1/+1
| | | | llvm-svn: 257232
* [PGO] Add runtime hook so that IR instrumentation can override versionXinliang David Li2016-01-082-2/+12
| | | | | | | | IR level instrumentation needs to override version with variant bits. No change for FE instrumentation is needed. Test case is added to detect version mismatch. llvm-svn: 257230
* [PGO] Introducing version mask macro/NFC (sync)Xinliang David Li2016-01-081-0/+8
| | | | llvm-svn: 257225
* Sync up InstrProfData.incXinliang David Li2016-01-081-1/+1
| | | | llvm-svn: 257195
* [PGO] Use new macro introduced/NFCXinliang David Li2016-01-081-1/+1
| | | | llvm-svn: 257147
* profile: Do not pass -fPIC on Windows.Peter Collingbourne2016-01-081-3/+0
| | | | | | Unbreaks clang-cl build (cl warns on this flag, clang-cl errors on it). llvm-svn: 257136
* [profile] Add comments to portability macros for readability (NFC)Vedant Kumar2016-01-081-3/+3
| | | | llvm-svn: 257126
* Sync up InstrProfData.incXinliang David Li2016-01-081-20/+20
| | | | llvm-svn: 257124
* Sync up InstrProfData.inc fileXinliang David Li2016-01-071-7/+12
| | | | llvm-svn: 257109
* [compiler-rt] Fix empty translation unit warningNathan Slingerland2016-01-061-2/+5
| | | | | | Change to not compile in WindowsMMap.c on anything except WIN32. llvm-svn: 256947
* [PGO] Enable building compiler-rt profile support library on WindowsNathan Slingerland2016-01-055-1/+205
| | | | | | | | | | | | Summary: This change configures Windows builds to build the complier-rt profile support library (clang_rt.profile-i386.lib). Windows API incompatibilities in the compiler-rt profile lib are also fixed. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15830 llvm-svn: 256848
* [PGO] Sync up template file with masterXinliang David Li2016-01-041-1/+1
| | | | llvm-svn: 256722
* [PGO] Sync up template file with masterXinliang David Li2016-01-031-0/+19
| | | | llvm-svn: 256711
* [PGO]: Eliminate custom typedefs in the FreeBSD case Xinliang David Li2015-12-301-18/+4
| | | | | | | | | | Patch by: Sean Bruno Use o/s provided sys/types.h to bring in Profiling types. Differential Revision: http://reviews.llvm.org/D15088 llvm-svn: 256647
* [PGO]: Refactor VP data writerXinliang David Li2015-12-293-48/+124
| | | | | | | | | 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-295-118/+134
| | | | | | | | | | 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-223-19/+21
| | | | | | This is a NFC refactoring enabling code sharing by file writer. llvm-svn: 256264
* [PGO] testing _WIN64 instead of _WIN32Xinliang David Li2015-12-201-5/+5
| | | | llvm-svn: 256129
* [PGO] Implement BOOL_CMPXCHG for WindowsXinliang David Li2015-12-201-0/+13
| | | | llvm-svn: 256128
* [PGO] Fix build failure with MSVCXinliang David Li2015-12-191-10/+8
| | | | llvm-svn: 256103
OpenPOWER on IntegriCloud