summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile
Commit message (Collapse)AuthorAgeFilesLines
...
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1921-84/+63
| | | | | | | | | | | | | | | | | 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] Sync up InstrProfData.inc with llvm copy /NFCRong Xu2019-01-151-10/+10
| | | | llvm-svn: 351257
* Add support for LLVM profile for NetBSDKamil Rytarowski2018-12-222-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD uses typical UNIX interfaces. All tests pass except instrprof-dlopen-dlclose-gcov.test, as there is not supported semantics of atexit(3) in dlopen(3)ed+dlclose(3)d DSO. NetBSD also ships an older version of LLVM profile (ABI v.2 predating ABI v.4 in upstream version) inside libc. That copy has been manually removed during the porting and testing process of the upstream version to NetBSD. Otherwise there were conflicts between them two. Reviewers: joerg, vitalybuka, vsk Subscribers: srhines, fedor.sergeev, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55997 llvm-svn: 349994
* [GCOV] Close file mapping handle on Windows, so flushed gcda files can be ↵Marco Castelluccio2018-11-073-8/+57
| | | | | | removed while the process is in execution llvm-svn: 346300
* [compiler-rt] Remove unused formal parameters from allocateOneNode. NFC.Matt Davis2018-10-091-3/+2
| | | | | | | | | | | | | | Summary: This is just a minor cleanup to the allocateOneNode interface. The formals are no-longer used, so I just removed them. Reviewers: davidxl, void Reviewed By: davidxl Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D52509 llvm-svn: 344073
* [Windows] Include BaseTsd.h with lowercaseMartin Storsjo2018-09-101-1/+1
| | | | | | | | | | This fixes building on a case sensitive filesystem with mingw-w64 headers, where all headers are lowercase. This header actually also is named with a lowercase name in the Windows SDK as well. Differential Revision: https://reviews.llvm.org/D51877 llvm-svn: 341857
* [compiler-rt] Add a routine to specify the mode used when creating profile dirs.Matt Davis2018-07-312-1/+16
| | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces `llvm_profile_set_dir_mode` and `llvm_profile_get_dir_mode` to the compiler-rt profile API. Originally, profile data was placed into a directory that was created with a hard-coded mode value of 0755 (for non-win32 builds). In certain cases, it can be helpful to create directories with a different mode other than 0755. This patch introduces set/get routines to allow users to specify a desired mode. The default remains at 0755. Reviewers: void, probinson Reviewed By: probinson Subscribers: probinson, dberris, cfe-commits Differential Revision: https://reviews.llvm.org/D49953 llvm-svn: 338456
* [profile] Support profiling runtime on FuchsiaPetr Hosek2018-07-256-1/+197
| | | | | | | | | | | | | This ports the profiling runtime on Fuchsia and enables the instrumentation. Unlike on other platforms, Fuchsia doesn't use files to dump the instrumentation data since on Fuchsia, filesystem may not be accessible to the instrumented process. We instead use the data sink to pass the profiling data to the system the same sanitizer runtimes do. Differential Revision: https://reviews.llvm.org/D47208 llvm-svn: 337881
* [profile] Fix finding the first and last directory separators on Windows.Igor Kudrin2018-07-241-10/+8
| | | | | | | | | Until now, our code preferred backslashes to slashes, whereas Windows allows using both types of directory separators in one path string. Differential Revision: https://reviews.llvm.org/D49664 llvm-svn: 337826
* [profile] Fix a possible memory leak in parseFilenamePattern().Igor Kudrin2018-07-241-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D49666 llvm-svn: 337823
* [profile] Add interface to get profile filenameTeresa Johnson2018-07-192-12/+55
| | | | | | | | | | | | | | | | Summary: Add __llvm_profile_get_filename interface to get the profile filename, which can be used for identifying which profile file belongs to an app when multiple binaries are instrumented and dumping profiles into the same directory. The filename includes the path. Reviewers: davidxl Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D49529 llvm-svn: 337482
* Fix reading 32 bit gcov tag values on little-endian machinesMarco Castelluccio2018-07-111-1/+1
| | | | | | | | | | | | | | | | | Summary: The write buffer contains signed chars, which means the shift operations caused values such as the arc tag value (0x01a10000) to be read incorrectly (0xffa10000). This fixes a regression from https://reviews.llvm.org/D49132. Reviewers: uweigand, davidxl Reviewed By: uweigand Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D49161 llvm-svn: 336775
* [gcov] Fix fallout from r336693Ulrich Weigand2018-07-101-1/+2
| | | | | | | Fix building GCDAProfiling.c with pre-C99 compilers. This caused a build bot failure. llvm-svn: 336706
* [gcov] Fix gcov profiling on big-endian machinesUlrich Weigand2018-07-101-8/+21
| | | | | | | | | | | | | | | | | | | | | | | Two fixes required to handle big-endian systems: - 64-bit counter values are stored in a mixed-endian format in the gcov files: a 32-bit low-part followed by a 32-bit high part. Note that this is already implemented correctly on the LLVM side, see GCOVBuffer::readInt64. - The tag values (e.g. arcs tag, object summary tag, ...) are aways written as the same sequence of bytes independent of byte order. But when *reading* them back in, the code reads them as 32-bit values in host byte order. For the comparisons to work correctly, this should instead always read them as little-endian values. Fixes PR 38121. Reviewed By: marco-c Differential Revision: https://reviews.llvm.org/D49132 llvm-svn: 336693
* Reapply "Make __gcov_flush flush counters for all shared libraries"Marco Castelluccio2018-07-101-69/+80
| | | | | | | This reapplies r336365, after marking tests as failing on various configurations. llvm-svn: 336678
* [CMake] Add compiler-rt header files to the list of sources for targetsDan Liew2018-07-101-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when building with an IDE so that header files show up in the UI. This massively improves the development workflow in IDEs. To implement this a new function `compiler_rt_process_sources(...)` has been added that adds header files to the list of sources when the generator is an IDE. For non-IDE generators (e.g. Ninja/Makefile) no changes are made to the list of source files. The function can be passed a list of headers via the `ADDITIONAL_HEADERS` argument. For each runtime library a list of explicit header files has been added and passed via `ADDITIONAL_HEADERS`. For `tsan` and `sanitizer_common` a list of headers was already present but it was stale and has been updated to reflect the current state of the source tree. The original version of this patch used file globbing (`*.{h,inc,def}`) to find the headers but the approach was changed due to this being a CMake anti-pattern (if the list of headers changes CMake won't automatically re-generate if globbing is used). The LLVM repo contains a similar function named `llvm_process_sources()` but we don't use it here for several reasons: * It depends on the `LLVM_ENABLE_OPTION` cache variable which is not set in standalone compiler-rt builds. * We would have to `include(LLVMProcessSources)` which I'd like to avoid because it would include a bunch of stuff we don't need. Differential Revision: https://reviews.llvm.org/D48422 llvm-svn: 336663
* Revert "Make __gcov_flush flush counters for all shared libraries"Michael Zolotukhin2018-07-071-80/+69
| | | | | | | This reverts r336365: the added tests are failing on various configurations (e.g. on green-dragon). llvm-svn: 336474
* Make __gcov_flush flush counters for all shared librariesMarco Castelluccio2018-07-051-69/+80
| | | | | | | | | | | | | | | | | Summary: This will make the behavior of __gcov_flush match the GCC behavior. I would like to rename __gcov_flush to __llvm_gcov_flush (in case of programs linking to libraries built with different compilers), but I guess we can't for compatibility reasons. Reviewers: davidxl Reviewed By: davidxl Subscribers: samsonov, vitalybuka, pcc, kcc, junbuml, glider, fhahn, eugenis, dvyukov, davidxl, srhines, chh, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48538 llvm-svn: 336365
* [profile] Add llvm_gcov_flush to be called outside a shared libraryChih-Hung Hsieh2018-06-291-0/+10
| | | | | | | | | | __gcov_flush is hidden. For applications to dump profiling data of selected .so files, they can use dlsym to find and call llvm_gcov_flush in each .so file. Differential Revision: https://reviews.llvm.org/D45454 llvm-svn: 336019
* [CMake] Build shared version of runtimes for FuchsiaPetr Hosek2018-05-091-1/+1
| | | | | | | | | Fuchsia is no longer treated as UNIX which means we need to explicitly enable building of shared versions of runtimes. Differential Revision: https://reviews.llvm.org/D46609 llvm-svn: 331922
* Fix clang-cl warnings in compiler-rtReid Kleckner2018-04-231-1/+2
| | | | | | | | | The profile library was missing some includes and was erroneously using ftruncate. WinASan was using `= {0}` to initialize structs, which creates -Wmissing-field-initializers and -Wmissing-braces warnings with clang. Use `= {}` instead, since this is C++. llvm-svn: 330616
* [profile] Fix value profile runtime merging issuesRong Xu2018-04-026-18/+45
| | | | | | | | | | | | | | | | This patch fixes the following issues: (1) The strong definition of the merge hook function was not working which breaks the online value profile merging. This patch removes the weak attribute of VPMergeHook and assigns the value dynamically. (2) Truncate the proifle file so that we don't have garbage data at the end of the file. (3) Add new __llvm_profile_instrument_target_value() interface to do the value profile update in batch. This is needed as the original incremental by 1 in __llvm_profile_instrument_target() is too slow for online merge. Differential Revision: https://reviews.llvm.org/D44847 llvm-svn: 328987
* [NFC] fix trivial typos in commentsHiroshi Inoue2018-01-221-1/+1
| | | | | | "the the" -> "the" llvm-svn: 323080
* Hide some symbols to avoid a crash on shutdown when using code coverageMarco Castelluccio2018-01-031-0/+13
| | | | | | | | | | | | | | | | | | | Summary: gcov / gcda-based profiling crashes when shared libraries are unloaded Patch by Benoit Belley and test by Marco Castelluccio for Firefox See https://bugs.llvm.org/show_bug.cgi?id=27224 & https://bugzilla.mozilla.org/show_bug.cgi?id=1401230 Reviewers: davidxl, rnk, void Subscribers: jessicah, marco-c, belleyb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D38124 llvm-svn: 321703
* Flush gcda files before unlocking themMarco Castelluccio2018-01-031-0/+1
| | | | | | | | | | | | Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=35464. Reviewers: zturner, rnk, void Subscribers: sylvestre.ledru, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D40610 llvm-svn: 321702
* Include process.h for getpid on Windows in instr profilingReid Kleckner2017-12-211-0/+1
| | | | llvm-svn: 321313
* [profile] Port the runtime to Solaris (retry)Vedant Kumar2017-12-1413-48/+115
| | | | | | | | | | | | | 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-1413-114/+47
| | | | | | | | | | | 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-1413-47/+114
| | | | | | | | | | | 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
* [profile] Update InstrProfData.inc to sync with llvmVedant Kumar2017-11-141-1/+1
| | | | llvm-svn: 318230
* Implement flock for Windows in compiler-rtMarco Castelluccio2017-11-081-3/+55
| | | | | | | | | | | | | | | | | Summary: This patch implements flock for Windows, needed to make gcda writing work in a multiprocessing scenario. Fixes https://bugs.llvm.org/show_bug.cgi?id=34923. Reviewers: zturner Reviewed By: zturner Subscribers: rnk, zturner, llvm-commits Differential Revision: https://reviews.llvm.org/D38891 llvm-svn: 317705
* Use O_BINARY when opening GCDA file on WindowsMarco Castelluccio2017-10-181-3/+6
| | | | | | | | | | | | | | | | | | | Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=34922. Apparently, the mode in **fdopen** gets simply ignored and Windows only cares about the mode of the original **open**. I have verified this both with the simple case from bug 34922 and with a full Firefox build. Reviewers: zturner Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38984 llvm-svn: 316048
* [profile] Update InstrProfData.incVedant Kumar2017-09-181-1/+1
| | | | llvm-svn: 313599
* Revert r312240Alex Lorenz2017-08-315-13/+13
| | | | | | | 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-315-13/+13
| | | | | | | | | | | 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
* [Profile] create a copy of profile file name from environmentXinliang David Li2017-08-231-2/+4
| | | | | | | | Original patch by Max Moroz. Differential Revsion: http://reviews.llvm.org/D36903 llvm-svn: 311607
* [profile] Fix warning about C++ style comment in C fileHans Wennborg2017-08-221-8/+8
| | | | llvm-svn: 311496
* Revert r310857 due to internal test failureXinliang David Li2017-08-152-19/+12
| | | | llvm-svn: 310907
* [PGO] Add support for relocate profile dumping directoryXinliang David Li2017-08-142-12/+19
| | | | | | Differential Revsion: http://reviews.llvm.org/D36648 llvm-svn: 310857
* Change INSTR_PROF_DEFAULT_NUM_VAL_PER_SITE from 8 to 16.Dehao Chen2017-07-281-1/+1
| | | | | | | | | | | | | | Summary: In the current implementation, the defaul number of values per site tracked by value profiler is 8, which is too small and could introduce inaccuracies to profile. Changing it to 16 will be able to gain more accurate value profiler. Reviewers: davidxl, tejohnson Reviewed By: tejohnson Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D35964 llvm-svn: 309388
* [profile] Move __llvm_profile_filename into a separate objectVedant Kumar2017-06-293-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users can specify the path a raw profile is written to by passing -fprofile-instr-generate=<path>, but this functionality broke on Darwin after __llvm_profile_filename was made weak [1], resulting in profiles being written to "default.profraw" even when <path> is specified. The situation is that instrumented programs provide a weak definition of __llvm_profile_filename, which conflicts with a weak redefinition provided by the profiling runtime. The linker appears to pick the 'winning' definition arbitrarily: on Darwin, it usually prefers the larger definition, which is probably why the instrprof-override-filename.c test has been passing. The fix is to move the runtime's definition into a separate object file within the archive. This means that the linker won't "see" the runtime's definition unless the user program has not provided one. I couldn't think of a great way to test this other than to mimic the Darwin failure: use -fprofile-instr-generate=<some-small-path>. Testing: check-{clang,profile}, modified instrprof-override-filename.c. [1] [Profile] deprecate __llvm_profile_override_default_filename https://reviews.llvm.org/D22613 https://reviews.llvm.org/D22614 Differential Revision: https://reviews.llvm.org/D34797 llvm-svn: 306710
* [PGO] Reduce IO in profile dumping with mergingXinliang David Li2017-06-284-25/+39
| | | | | | Differential Revision: http://reviews.llvm.org/D34709 llvm-svn: 306561
* [Profile] Remove redundant callXinliang David Li2017-06-271-1/+0
| | | | llvm-svn: 306480
* [PGO] Refactor file/buffer writer callback interfaces /NFCXinliang David Li2017-06-274-46/+74
| | | | | | | | | | 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] Sync up InstrProfData.inc (NFC)Vedant Kumar2017-04-151-6/+6
| | | | llvm-svn: 300383
* [Profile] PE binary coverage bug fixXinliang David Li2017-04-131-6/+61
| | | | | | | | PR/32584 Differential Revision: https://reviews.llvm.org/D32023 llvm-svn: 300278
* Revert 299954 : test failure needs to be fixedXinliang David Li2017-04-111-14/+0
| | | | llvm-svn: 299960
* [Profile] PE binary coverage bug fixXinliang David Li2017-04-111-0/+14
| | | | | | | | PR/32584 Differential Revision: https://reviews.llvm.org/D31939 llvm-svn: 299954
* Resubmit r295469 [PGO] Suspend SIGKILL for PR_SET_PDEATHSIG in profile-writeRong Xu2017-03-173-0/+40
| | | | | | | | And also r295364 [PGO] remove unintended debug trace. NFC I removed the test case: it's hard to write synchronized test b/w processes in this framework. I will revisit the test-case later. llvm-svn: 298113
* [PGO] Value profile support for value rangesRong Xu2017-03-152-1/+45
| | | | | | | | | This patch adds profile run time support to profile a range of values. This interface will be used in profiling the size of memory intrinsic calls. Differential Revision: http://reviews.llvm.org/D28964 llvm-svn: 297895
OpenPOWER on IntegriCloud