summaryrefslogtreecommitdiff
path: root/lib/profile
AgeCommit message (Collapse)Author
2016-04-06sync up with master copyXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@265609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28[PGO] More comments how function pointers for indirect calls are mappedAdam Nemet
to function names Summary: Hopefully this will make it easier for the next person to figure all this out... Reviewers: bogner, davidxl Subscribers: davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D18489 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264680 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28[libprofile] Handle '\\' in __llvm_profile_recursive_mkdirSean Silva
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). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28[PGO] Update r264612 to use C-style commentAdam Nemet
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264615 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28[PGO] Comment how function pointers for indirect calls are mapped to ↵Adam Nemet
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09Fix test failure on darwin-i386Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07[Fix r262785] Fix missing declaration when COMPILER_RT_BOOL_CMPXCHG was used ↵Filipe Cabecinhas
but InstrProfilingUtil.h wasn't included. Also fixed declaration which still had the pre-r262788 name. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06cleanup: remove dead preprocessing branch /nfcXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-06[PGO] cleanup: move one support method into InstrProfilingUtil.h /NFCXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262791 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-03-06Minor cleanupXinliang David Li
move a function def to InstrProfilingUtil.c git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-05[GCDA] Unlock arc file before closing itVedant Kumar
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262779 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04[PGO] Add API to check compatibility of profile data in bufferXinliang David Li
This is needed by client which uses in-process merge API. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262736 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-04Fix api visibilityXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262734 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03[PGO] Add API for profile merge from bufferXinliang David Li
Differential Revision: http://reviews.llvm.org/D17831 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262644 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02Add some minimal portability code paths for PS4.Sean Silva
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262527 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
2016-02-26Sync up with masterXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261947 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23[profile] Fix iteration over profile data entriesVedant Kumar
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11Silence MSVC warning about non-void prototypesReid Kleckner
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)' git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260475 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08[PGO] Update InstrProfData.inc to sync with llvmRong Xu
Sync InstrProfData.inc with the one in llvm. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08Fix windows build bot failureXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260120 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08[PGO] Enable compression in pgo instrumentationXinliang David Li
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03Sync up with master fileXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30Fix build with VS2015Ismail Donmez
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29[profile] Support hostname expansion in LLVM_PROFILE_FILEVedant Kumar
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28Minor cleanup /NFCXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27Sync up with master fileXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258890 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26Remove autoconf support for building runtime libraries.Chris Bieneman
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25sync up InstrProfData.h -- typo fixXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19Fix -Wexpansion-to-defined warnings in compiler-rt.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14sync up with master fileXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Fix typo in commentXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[PGO] Add runtime hook so that IR instrumentation can override versionXinliang David Li
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[PGO] Introducing version mask macro/NFC (sync)Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Sync up InstrProfData.incXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[PGO] Use new macro introduced/NFCXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08profile: Do not pass -fPIC on Windows.Peter Collingbourne
Unbreaks clang-cl build (cl warns on this flag, clang-cl errors on it). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[profile] Add comments to portability macros for readability (NFC)Vedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Sync up InstrProfData.incXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-07Sync up InstrProfData.inc fileXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06[compiler-rt] Fix empty translation unit warningNathan Slingerland
Change to not compile in WindowsMMap.c on anything except WIN32. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256947 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05[PGO] Enable building compiler-rt profile support library on WindowsNathan Slingerland
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-04[PGO] Sync up template file with masterXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03[PGO] Sync up template file with masterXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256711 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30[PGO]: Eliminate custom typedefs in the FreeBSD case Xinliang David Li
Patch by: Sean Bruno Use o/s provided sys/types.h to bring in Profiling types. Differential Revision: http://reviews.llvm.org/D15088 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256647 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-20[PGO] testing _WIN64 instead of _WIN32Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256129 91177308-0d34-0410-b5e6-96231b3b80d8