summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[PGO] Suspend SIGKILL for PR_SET_PDEATHSIG in profile-write"Renato Golin2017-02-203-40/+0
| | | | | | | | Revert "[PGO] remove unintended debug trace. NFC" This reverts commit r295469, r295364, as they are unstable on ARM/AArch64. llvm-svn: 295664
* [PGO] remove unintended debug trace. NFCRong Xu2017-02-171-4/+1
| | | | llvm-svn: 295469
* [PGO] Suspend SIGKILL for PR_SET_PDEATHSIG in profile-writeRong Xu2017-02-163-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We found a nondeterministic behavior when doing online profile merging for multi-process applications. The application forks a sub-process and sub-process sets to get SIGKILL when the parent process exits, The first process gets the lock, and dumps the profile. The second one will mmap the file, do the merge and write out the file. Note that before the merged write, we truncate the profile. Depending on the timing, the child process might be terminated abnormally when the parent exits first. If this happens: (1) before the truncation, we will get the profile for the main process (2) after the truncation, and before write-out the profile, we will get 0 size profile. (3) after the merged write, we get merged profile. This patch temporarily suspend the SIGKILL for PR_SET_PDEATHSIG before profile-write and restore it after the write. This patch only applies to Linux system. Reviewers: davidxl Reviewed By: davidxl Subscribers: xur, llvm-commits Differential Revision: https://reviews.llvm.org/D29954 llvm-svn: 295364
* [PGO] Delay profile dir creation until writeXinliang David Li2017-02-141-7/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D29960 llvm-svn: 295108
* [Profile] Fix value profiler eviction bugXinliang David Li2016-11-291-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D27224 llvm-svn: 288204
* [profile] use GetComputerNameExW instead of gethostname on WindowsBob Haarman2016-11-293-10/+22
| | | | | | | | | | | | Summary: In profile data paths, we replace "%h" with the hostname of the machine the program is running on. On Windows, we used gethostname() to obtain the hostname. This requires linking with ws2_32. With this change, we instead get the hostname from GetComputerNameExW(), which does not require ws2_32. Reviewers: rnk, vsk, amccarth Subscribers: zturner, ruiu, hans Differential Revision: https://reviews.llvm.org/D27178 llvm-svn: 288146
* [profile] Mark lprofCurFilename as COMPILER_RT_WEAKVedant Kumar2016-10-181-1/+2
| | | | | | | | | | | | | | | | | | This makes __llvm_profile_set_filename() work across dylib boundaries on Darwin. This functionality was originally meant to work on all platforms, but was moved to a Linux-only directory with r272404. The root cause of the test failure on Darwin was that lprofCurFilename was not marked weak. Each dylib maintained its own copy of the variable due to the two-level namespace. Tested with check-profile (on Darwin). I don't expect this to regress other platforms. Differential Revision: https://reviews.llvm.org/D25707 llvm-svn: 284440
* Revert "[profile] Hide lprofCurFilename"Vedant Kumar2016-09-231-2/+1
| | | | | | | | | | | | | | | This reverts commit r282294. It breaks a Linux bot: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/12180 It looks like the test checks that __llvm_profile_set_filename() alters the raw profile filename in both the dylib and the main program. Now that lprofCurFilename is hidden, this can't work, and we get two profiles (one for the call to "main" and one for "func"). Back this change out so that we don't affect external users. llvm-svn: 282304
* [profile] Hide lprofCurFilenameVedant Kumar2016-09-231-1/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D24885 llvm-svn: 282294
* [Profile] Remove unused variableXinliang David Li2016-09-222-2/+0
| | | | llvm-svn: 282198
* [Profile] suppress verbose rt message by defaultXinliang David Li2016-09-221-5/+7
| | | | llvm-svn: 282193
* Correctly escape %.Nico Weber2016-09-081-1/+1
| | | | | | Found be an MSVC warning; I filed PR30320 for adding a similar warning to clang. llvm-svn: 280900
* profile: add missing include for WindowsSaleem Abdulrasool2016-08-301-0/+3
| | | | | | | Add a missing Windows.h which is needed for the windows type usage in the TU (e.g. HANDLE). llvm-svn: 280145
* [CMake] Connect Compiler-RT targets to LLVM Runtimes directoryChris Bieneman2016-08-261-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch builds on LLVM r279776. In this patch I've done some cleanup and abstracted three common steps runtime components have in their CMakeLists files, and added a fourth. The three steps I abstract are: (1) Add a top-level target (i.e asan, msan, ...) (2) Set the target properties for sorting files in IDE generators (3) Make the compiler-rt target depend on the top-level target The new step is to check if a command named "runtime_register_component" is defined, and to call it with the component name. The runtime_register_component command is defined in llvm/runtimes/CMakeLists.txt, and presently just adds the component to a list of sub-components, which later gets used to generate target mappings. With this patch a new workflow for runtimes builds is supported. The new workflow when building runtimes from the LLVM runtimes directory is: > cmake [...] > ninja runtimes-configure > ninja asan The "runtimes-configure" target builds all the dependencies for configuring the runtimes projects, and runs CMake on the runtimes projects. Running the runtimes CMake generates a list of targets to bind into the top-level CMake so subsequent build invocations will have access to some of Compiler-RT's targets through the top-level build. Note: This patch does exclude some top-level targets from compiler-rt libraries because they either don't install files (sanitizer_common), or don't have a cooresponding `check` target (stats). llvm-svn: 279863
* test commit.Ying Yi2016-08-101-1/+1
| | | | llvm-svn: 278210
* [Profile] Implement new API __llvm_profile_dumpXinliang David Li2016-08-094-0/+58
| | | | | | | | | 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] track ownership of filename pattern stringXinliang David Li2016-08-021-7/+24
| | | | | | | Make sure runtime copy and owns the string when passed in from external users of runtime API. llvm-svn: 277507
* Define compatibility flag if not defined with -std=c++Xinliang David Li2016-07-251-0/+3
| | | | llvm-svn: 276708
* [Profile] cleanup: do not reference name directly of vars shared between rt ↵Xinliang David Li2016-07-224-6/+8
| | | | | | and llvm llvm-svn: 276385
* [Profile] deprecate __llvm_profile_override_default_filename (part2)Xinliang David Li2016-07-214-36/+32
| | | | | | | | This eliminates unncessary calls and init functions. Differential Revision: http://reviews.llvm.org/D22614 llvm-svn: 276355
* [Profile] bug fix: profile dir not recursively createdXinliang David Li2016-07-211-2/+6
| | | | llvm-svn: 276234
* Sync up with llvm copy /NFCXinliang David Li2016-07-201-2/+2
| | | | llvm-svn: 276198
* Minor cleanup -- clear name structure before parsingXinliang David Li2016-07-201-6/+5
| | | | llvm-svn: 276089
* [Profile] implement interface to get profile path prefixXinliang David Li2016-07-202-1/+49
| | | | | | Differential Revision: http://reviews.llvm.org/D22546 llvm-svn: 276083
* [Profile] introduce reusable internal interfaces to find dir separator \NFCXinliang David Li2016-07-193-5/+31
| | | | llvm-svn: 276027
* [Profile] move utility interfaces to the right header /NFCXinliang David Li2016-07-193-15/+14
| | | | llvm-svn: 276021
* [Profile] use portable macro /NFCXinliang David Li2016-07-191-1/+1
| | | | llvm-svn: 276019
* Code refactoring: extract path prefix handling codeXinliang David Li2016-07-183-36/+74
| | | | | | .. into reusable interfaces. No functional change is expected. llvm-svn: 275807
* Fix a typeo.George Burgess IV2016-07-151-1/+1
| | | | | | (obligatory s/typeo/typo) llvm-svn: 275632
* [Profile] instroduce portability macro for dir separator(sXinliang David Li2016-07-153-4/+24
| | | | llvm-svn: 275597
* [compiler-rt] Fix VisualStudio virtual folders layoutEtienne Bergeron2016-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: This patch is a refactoring of the way cmake 'targets' are grouped. It won't affect non-UI cmake-generators. Clang/LLVM are using a structured way to group targets which ease navigation through Visual Studio UI. The Compiler-RT projects differ from the way Clang/LLVM are grouping targets. This patch doesn't contain behavior changes. Reviewers: kubabrecka, rnk Subscribers: wang0109, llvm-commits, kubabrecka, chrisha Differential Revision: http://reviews.llvm.org/D21952 llvm-svn: 275111
* Use CreateFileA and add a FIXME to switch to the wide variantReid Kleckner2016-06-231-2/+3
| | | | | | | No functional change. Required to build with -DUNICODE, as is done in http://reviews.llvm.org/D21643 llvm-svn: 273571
* Fix most MSVC warnings in compiler-rt profiling libraryReid Kleckner2016-06-175-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here's the warnings and how they were fixed: - InstrProfilingUtil.c(110): warning C4013: '_open_osfhandle' undefined; assuming extern returning int Include io.h to get the prototype. - warning C4005: 'FILE_MAP_EXECUTE': macro redefinition Stop trying to support pre-XP versions of Windows, don't attempt to define this macro. - InstrProfilingWriter.c(271): warning C4221: nonstandard extension used: 'Data': cannot be initialized using address of automatic variable 'Header' - InstrProfilingWriter.c(275): warning C4221: nonstandard extension used: 'Data': cannot be initialized using address of automatic variable 'Zeroes' Turn this warning off. This is definitely legal in C++, all compilers accept it, and I only have room for half of one language standard in my brain. - InstrProfilingValue.c(320): warning C4113: 'uint32_t (__cdecl *)()' differs in parameter lists from 'uint32_t (__cdecl *)(void)' Fix this with an explicit (void) in the prototype. - InstrProfilingMerge.c.obj : warning LNK4006: _VPMergeHook already defined in InstrProfilingMergeFile.c.obj; second definition ignored Last remaining warning. This is from linking a selectany definition with a strong definition. We need to sort out weak symbols in compiler-rt in general, though. llvm-svn: 273026
* [profile] Update a warning message (NFC)Vedant Kumar2016-06-141-3/+2
| | | | | | | It's possible for a merge pool specifier to appear anywhere in a filename pattern. Update the warning to reflect this. llvm-svn: 272685
* [profile] cleanup file setting codeXinliang David Li2016-06-102-20/+71
| | | | | | Differential Revision: http://reviews.llvm.org/D21219 llvm-svn: 272428
* [profile] in-process merging support part-3Xinliang David Li2016-06-084-11/+187
| | | | | | Differential Revision: http://reviews.llvm.org/D21056 llvm-svn: 272227
* [profile] Hide some external symbols in InstrProfData.incVedant Kumar2016-06-082-17/+31
| | | | | | Differential Revision: http://reviews.llvm.org/D21116 llvm-svn: 272167
* [profile] Pass extra build flags (feature enabling macros) to Darwin buildXinliang David Li2016-06-082-2/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D21119 llvm-svn: 272162
* [profile] Un-hide two symbolsVedant Kumar2016-06-082-3/+2
| | | | | | | | | | | - lprofCurFilename was intended to have external visibility. This is pending further discussion. - The raw version number doesn't need to be hidden: hiding it may make it easier to accidentally combine FE/IR profiles. See the mailing list discussion on r272081. llvm-svn: 272089
* [profile] Hide a few external symbols (NFCI)Vedant Kumar2016-06-083-4/+5
| | | | | | | | There are still a few external symbols visible from InstrProfData.inc. The plan for dealing with those isn't as straightforward, so I'll try it in a separate commit. llvm-svn: 272081
* [profile] code cleanup /NFCXinliang David Li2016-06-061-9/+17
| | | | | | | Address review feedback for better readability. llvm-svn: 271922
* [profile] in-process mergeing support (part-2)Xinliang David Li2016-06-063-1/+81
| | | | | | | | | | | (Part-1 merging API is in profile runtime) This patch implements a portable file opening API with exclusive access for the process. In-process profile merge requires profile file update to be atomic/fully sychronized. llvm-svn: 271864
* [profile] Fix PR/27917Xinliang David Li2016-05-311-3/+4
| | | | | | Skip the last (possibly) incomplete node from padding bytes. llvm-svn: 271349
* Local var name change /NFCXinliang David Li2016-05-311-19/+19
| | | | llvm-svn: 271304
* [profile] Avoid unused variable warning.Sean Silva2016-05-271-1/+1
| | | | llvm-svn: 270969
* Add portable macro in common headerXinliang David Li2016-05-262-6/+11
| | | | llvm-svn: 270928
* Add segment prefix for darwinXinliang David Li2016-05-261-1/+6
| | | | llvm-svn: 270875
* Fix windows bot failureXinliang David Li2016-05-261-0/+2
| | | | llvm-svn: 270864
* [profile] pre-allocate a small counter set in profile runtimeXinliang David Li2016-05-261-18/+23
| | | | | | | | Tested with relavant benchmarks in SPEC2006 Differential Revision: http://reviews.llvm.org/D20651 llvm-svn: 270862
* [profile] Add early checking to bypass node pointer updateXinliang David Li2016-05-251-3/+8
| | | | llvm-svn: 270766
OpenPOWER on IntegriCloud