summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile
Commit message (Collapse)AuthorAgeFilesLines
...
* PGO: Indicate errors in profile runtime APIDuncan P. N. Exon Smith2014-03-214-19/+41
| | | | | | Return 0 for success, non-0 for failure. llvm-svn: 204415
* PGO: Substitute pid for %p in filenameDuncan P. N. Exon Smith2014-03-211-1/+46
| | | | | | | | | | | | Add logic to do a printf-style substitution of %p for the process pid in the filename. It's getting increasingly awkward to work on lib/profile without test infrastructure. This needs to be fixed! <rdar://problem/16383358> llvm-svn: 204414
* PGO: Declare zero-argument C functions as foo(void)Duncan P. N. Exon Smith2014-03-205-22/+30
| | | | | | | | It turns out this is C code. Specify foo(void). <rdar://problem/15943240> llvm-svn: 204396
* PGO: Change runtime prefix from pgo to profileDuncan P. N. Exon Smith2014-03-207-57/+57
| | | | | | | | | | | These functions are in the profile runtime. PGO comes later. Unfortunately, there's only room for 16 characters in a Darwin section, so use __llvm_prf_ instead of __llvm_profile_ for section names. <rdar://problem/15943240> llvm-svn: 204391
* PGO: Add function to reset counters at runtimeDuncan P. N. Exon Smith2014-03-204-9/+17
| | | | | | | | Adding __llvm_pgo_reset_counters(), which sets all the counters to 0. <rdar://problem/15943240> llvm-svn: 204386
* PGO: Add missing file...Duncan P. N. Exon Smith2014-03-201-0/+28
| | | | llvm-svn: 204384
* PGO: Update interface for writing instrumentation data to fileDuncan P. N. Exon Smith2014-03-202-12/+19
| | | | | | | | | | | | | | | | | __llvm_pgo_write_default_file() was a bad name, since it checked the environment (it wasn't just a default file). - Change __llvm_pgo_write_file() to __llvm_pgo_write_file_with_name() and make it static. - Rename __llvm_pgo_write_default_file() to __llvm_pgo_write_file(). - Add __llvm_pgo_set_filename(), which sets the filename for subsequent calls to __llvm_pgo_write_file(). <rdar://problem/15943240> llvm-svn: 204381
* PGO: Add explicit static initializationDuncan P. N. Exon Smith2014-03-204-7/+32
| | | | | | | | | | | | | | | | | | | Instead of relying on explicit static initialization from translation units, create a new file, InstrProfilingRuntime.cc, with an __llvm_pgo_runtime variable. After this commit (and its pair in clang), the driver will create a use of this variable. Unless the user defines their own version, the new object file will get pulled in, including that C++ static initialization that calls __llvm_pgo_register_write_atexit. The result is that, at least on Darwin, static initialization typically consists of a single function call, which registers a writeout functino atexit. Furthermore, users can skip even this behaviour by defining their own __llvm_pgo_runtime. <rdar://problem/15943240> llvm-svn: 204380
* PGO: Moving files for clarityDuncan P. N. Exon Smith2014-03-203-2/+2
| | | | | | <rdar://problem/15943240> llvm-svn: 204373
* PGO: Implement Darwin linker magic for instrumentationDuncan P. N. Exon Smith2014-03-202-6/+37
| | | | | | | | | Use Darwin linker magic to find bounds of instrumentation data sections at link time instead of runtime. <rdar://problem/15943240> llvm-svn: 204302
* PGO: Split out initialization of section boundsDuncan P. N. Exon Smith2014-03-204-35/+69
| | | | | | | | | | | | | | | Currently we register instrumentation data at runtime to determine the bounds of the sections where the data lives. Soon we'll implement platform-specific linker magic to determine this at link time. Move this logic to a separate file, so that our build system can choose the correct platform-specific code. No functionality change intended. <rdar://problem/15943240> llvm-svn: 204299
* PGO: Constify references to instrumentation dataDuncan P. N. Exon Smith2014-03-201-6/+6
| | | | | | <rdar://problem/15943240> llvm-svn: 204298
* PGO: Use past-the-end semantics for pointer rangeDuncan P. N. Exon Smith2014-03-191-5/+4
| | | | llvm-svn: 204278
* PGO: Splitting implementation files; no functionality changeDuncan P. N. Exon Smith2014-03-195-132/+173
| | | | | | | | | | | | | | | | | | | | Split implementation files along a uses-libc/shouldn't-use-libc boundary. - InstrProfiling.h is a shared header. - InstrProfiling.c provides an API to extract profiling data from the runtime, but avoids the use of libc. Currently this is a lie: __llvm_pgo_write_buffer() uses `FILE*` and related functions. It will be updated soon to write to a `char*` buffer instead. - InstrProfilingExtras.c provides a more convenient API for interfacing with the profiling runtime, but has logic that does (and will continue to) use libc. <rdar://problem/15943240> llvm-svn: 204268
* PGO: Fix obviously wrong typedefs for MSDuncan P. N. Exon Smith2014-03-192-2/+2
| | | | llvm-svn: 204267
* profile: Include the function hash in PGO profilesJustin Bogner2014-03-181-1/+2
| | | | llvm-svn: 204185
* Reapply "PGO: Statically generate data structures"Duncan P. N. Exon Smith2014-03-171-48/+79
| | | | | | | Reapply r204079 and r204083, this time with stubs for fputc in compiler-rt. llvm-svn: 204091
* Revert r204079, r204083 and r204084 "PGO: Statically generate data structures"Duncan P. N. Exon Smith2014-03-171-80/+48
| | | | | | | Buildbots are having trouble finding fputc(), and I can't figure out why. Reverting to investigate. llvm-svn: 204088
* Switch from fputc to putc to fix r204079?Duncan P. N. Exon Smith2014-03-171-1/+1
| | | | llvm-svn: 204084
* Rename __ProfileData to __llvm_pgo_dataDuncan P. N. Exon Smith2014-03-171-9/+9
| | | | | | <rdar://problem/15943240> llvm-svn: 204083
* PGO: Statically generate data structuresDuncan P. N. Exon Smith2014-03-171-48/+80
| | | | | | | | | | | | | | | | | | | In instrumentation-based profiling, we need a set of data structures to represent the counters. Previously, these were built up during static initialization. Now, they're shoved into a specially-named section so that they show up as an array. As a consequence of the reorganizing symbols, instrumentation data structures for linkonce functions are now correctly coalesced. This is the first step in a larger project to minimize runtime overhead and dependencies in instrumentation-based profilng. The larger picture includes removing all initialization overhead and making the dependency on libc optional. <rdar://problem/15943240> llvm-svn: 204079
* Revert "profile: Use a simple binary format for profiling"Justin Bogner2014-03-121-155/+37
| | | | | | | | | This will break without the corresponding change in clang, which I've reverted until I figure out how to get it to link properly. This reverts commit r203710. llvm-svn: 203713
* profile: Use a simple binary format for profilingJustin Bogner2014-03-121-37/+155
| | | | llvm-svn: 203710
* A fix for platform-dependent types in sanitizers' profiling support lib on ↵Viktor Kutuzov2014-03-102-7/+36
| | | | | | x64 FreeBSD in 32-bit mode llvm-svn: 203470
* Add an environment variable to override the default profile output file.Bob Wilson2014-02-201-1/+4
| | | | | | | | Also rename the default output file from "pgo-data" to "default.profdata". The ".profdata" suffix is consistent with the name of the new llvm-profdata tool. llvm-svn: 201808
* [CMake] Add top-level target for each compiler-rt library, and add ↵Alexey Samsonov2014-02-181-0/+6
| | | | | | 'compiler-rt' target encompassing them all. llvm-svn: 201556
* Enable compilation of RT on ARMRenato Golin2014-01-311-1/+1
| | | | | | | | | | | | Adding the ARM RT sources to the CMake files, and enabling some sanitizers to also build on ARM. This is far from supported or production quality, but enabling it to build will get us errors that we can actually fix. Having said that, the Compiler-RT and the Asan libraries are know to work on some variations of ARM. llvm-svn: 200546
* Fix think-o from r199332 -- write to the new_filename we're building, notNick Lewycky2014-01-191-1/+1
| | | | | | filename the global variable. llvm-svn: 199572
* Avoid shadowing the global filename. Reorg mangle_filename to be moreJoerg Sonnenberger2014-01-151-23/+29
| | | | | | | | | precise in the length accounting and use memcpy instead of strcpy/strcat. Differential Revision: http://llvm-reviews.chandlerc.com/D2547 llvm-svn: 199332
* Revert "Only include inttypes.h on platforms for which PRIu64 isn't in stdint.h"Justin Bogner2014-01-071-4/+1
| | | | | | This reverts commit e7778e08878d0c61903205428eeb131db9d11b3c. llvm-svn: 198657
* Revert "Explicitly enable PRIu64 by defining __STDC_FORMAT_MACROS if it isn't"Justin Bogner2014-01-071-6/+0
| | | | | | This reverts commit d1b5d3b0e885ef057643fcea99bff8b6cce04b93. llvm-svn: 198656
* Explicitly enable PRIu64 by defining __STDC_FORMAT_MACROS if it isn'tKaelyn Uhrain2014-01-071-0/+6
| | | | | | yet defined. llvm-svn: 198650
* Only include inttypes.h on platforms for which PRIu64 isn't in stdint.hKaelyn Uhrain2014-01-061-1/+4
| | | | llvm-svn: 198647
* Use the PRIu64 macro for printing a uint64_t.Kaelyn Uhrain2014-01-061-1/+2
| | | | | | | | | Otherwise on (some) 64-bit systems, -Wformat will trigger a warning because uint64_t is an 'unsigned long' not an 'unsigned long long'. Consequently, PGOProfiling.c would fail to build if -Werror and -Wformat are both enabled. llvm-svn: 198644
* profile: Rudimentary suppport for PGO instrumentationJustin Bogner2014-01-062-1/+83
| | | | | | | | This is fairly minimal support for instrumentation based PGO. The data format is inefficient, and the output file name is hardcoded to pgo-data. llvm-svn: 198638
* Fix minor gcc warnings.Matt Arsenault2013-12-101-11/+11
| | | | | | | C++ style comments not allowed in C90, signed unsigned comparision. llvm-svn: 196948
* compiler-rt: Added support for function checksums.Yuchen Wu2013-12-041-2/+2
| | | | llvm-svn: 196357
* compiler-rt: Support for file checksum in GCDAProfiling.cpp.Yuchen Wu2013-11-201-5/+7
| | | | | | Takes file checksum as an argument to write to .gcda file. llvm-svn: 195190
* Added summary info to GCDAProfiling.Yuchen Wu2013-11-121-1/+50
| | | | | | | This function will be called by GCOVProfiling to write and update object and program summaries to be read in by llvm-cov. llvm-svn: 194499
* Fix typoBill Wendling2013-09-111-1/+1
| | | | llvm-svn: 190543
* Don't allow a NULL-length file. Try to revert to the buffered version.Bill Wendling2013-09-091-0/+5
| | | | llvm-svn: 190359
* Revert hack that omits errno on Darwin platforms. We now have an acceptable ↵Bill Wendling2013-06-271-9/+0
| | | | | | 'errno' header. llvm-svn: 185106
* Fix a use after free I introduced and that Bill caught in code reviewChandler Carruth2013-06-261-14/+13
| | | | | | | | | (thanks!) by deferring the free of the filename until we finish writing the coverage data to that file. Bill, let me know if you'd prefer a different approach! llvm-svn: 184895
* Don't use 'errno.h' on Apple just yet. This breaks for some of our buildbots.Bill Wendling2013-06-251-0/+9
| | | | llvm-svn: 184878
* Address a few of the issues in GCDAProfiling I noted when lookingChandler Carruth2013-06-251-7/+37
| | | | | | | | | | | | | | | | through Bill's patch: 1) Correctly test the file descriptor after the sceond attempt at creating the file. 2) Make the filename a global so that we can issue error messages from other routines. 3) Check errno in several places and print it out so that errors are easier to track down. I don't really expect any of these to fix the current failures I'm seeing, but I'm hopeful they'll at least let me debug them. llvm-svn: 184799
* Remove the sysroot restriction from building GCDAProfiling.c.Chandler Carruth2013-06-251-3/+3
| | | | | | | | | | | | | | We really need the C standard library to be available to implement the profiling runtime library reasonably, and replicating everything in the SDKs tree really isn't addressing any problems we have. Notably, all of the sanitizer runtimes take the same approach, and this isn't a library which could end up in a bootstrapping problem where the system headers aren't even available. This will hopefully prevent subsequent changes which start using various other bits of C standard library to make things more debuggable. llvm-svn: 184798
* Don't override 'mode' and cleanup some variable names.Bill Wendling2013-05-231-22/+21
| | | | llvm-svn: 182599
* Add 'mode' parameter when using 'O_CREAT'. Thanks to Evgeniy for pointing ↵Bill Wendling2013-05-231-2/+3
| | | | | | this out. llvm-svn: 182598
* Performance improvement.Bill Wendling2013-05-231-59/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using fwrite and fread was very *very* slow. The resulting code was multiple times slower than GCC's implementation of gcov. Replace the fwrite/fread system with an mmap() version. If the `.gcda' file doesn't exist, we (re)allocate a buffer that we write into. That gets written to the `.gcda' file in one chunk. If the `.gcda' file already exists, we simply mmap() the file, modify the mapped data, and use msync() to write the contents out to disk. It's much easier than implementing our own buffering scheme, and we don't have to use fwrite's and fread's buffering. For those who are numbers-oriented, here are some timings: GCC Verison ----------- `.gcda' files don't exist: 23s `.gcda' files do exist: 14s LLVM Version (before this change) --------------------------------- `.gcda' files don't exist: 28s `.gcda' files do exist: 28s LLVM Version (with this change) ------------------------------- `.gcda' files don't exist: 18s `.gcda' files do exist: 4s It's a win-win-win-win-lose-win-win scenario! <rdar://problem/13466086> llvm-svn: 182563
* Try to improve performance by using a read/write buffer instead of I/O.Bill Wendling2013-05-151-52/+108
| | | | | | | | | | The calls to fwrite/fread can be very expensive. GCC avoids this by using a buffer to read and write from the file, thus limiting the number of fwrite/fread calls. <rdar://problem/13466086> llvm-svn: 181924
OpenPOWER on IntegriCloud