summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile
Commit message (Collapse)AuthorAgeFilesLines
...
* [PGO] Fix the build failures due to 253483 and 253489.Betul Buyukkurt2015-11-181-4/+2
| | | | llvm-svn: 253492
* [PGO] Removed an extra ')' in the LLVM_ALIGNAS(x) macro.Betul Buyukkurt2015-11-181-1/+1
| | | | llvm-svn: 253489
* [PGO] Runtime support for value profiling.Betul Buyukkurt2015-11-184-7/+215
| | | | | | | | This change adds extends the data structures and adds in the routines for handling runtime calls for value profiling. The profile data format is modified and the version number is incremented. llvm-svn: 253483
* [PGO] Ensure profile section symbols are created (linux)Xinliang David Li2015-11-134-1/+25
| | | | | | | | | | | | | - This is to handle a corner case where profile lib is linked in but non of the modules are instrumented (On linux, since we avoided the overhead to emit runtime hook use functions so this is the side effect of that size optimization). - Added a profile runtime test case to cover all scenarios of shared library builds. Differential Revision: http://reviews.llvm.org/D14468 llvm-svn: 253098
* Rollback 252570 for further investigationXinliang David Li2015-11-101-2/+0
| | | | llvm-svn: 252575
* [PGO] Add LLVM main include dir to profile runtime buildXinliang David Li2015-11-101-0/+2
| | | | | | | | | | | | Runtime code implicitly depends on the defintions and const values defined in LLVM proper, but currently such dependency is made implicitly by duplicating code across two dirs. As part of the PGO cleanup effort, there will be changes to share common sources. This is a preparation patch to enable it (NFC). Differential Revision: http://reviews.llvm.org/D14487 llvm-svn: 252570
* [PGO] Cleanup: fix function-data field namesXinliang David Li2015-11-082-10/+10
| | | | | | | | To make them the same as the common def in InstrProfData.inc. This is a preparation to make the runtime code to use the template as well. NFC llvm-svn: 252421
* [PGO] Eliminate prof data register calls on FreeBSD platformXinliang David Li2015-10-192-2/+2
| | | | | | | This is a follow up patch of r250199 after verifying the start/stop section symbols work as spected on FreeBSD. llvm-svn: 250680
* Use struct type instead of raw array for raw profile header (NFC)Xinliang David Li2015-10-163-20/+30
| | | | | | | | | | This patch introduces a well defined header struct to represent raw profile header instead of using raw array. Previously the raw array is used in two different files and is very error prone when header structure is re-organized. This is a small cleanup with NFC. llvm-svn: 250561
* [PGO]: Eliminate calls to __llvm_profile_register_function for Linux.Xinliang David Li2015-10-133-1/+50
| | | | | | | | | On Linux, the profile runtime can use __start_SECTNAME and __stop_SECTNAME symbols defined by the linker to locate the start and end location of a named section (with C name). This eliminates the need for instrumented binary to call __llvm_profile_register_function during start-up time. llvm-svn: 250200
* [CMake] [Darwin] Add and populate PROFILE_SUPPORTED_OS to enable building ↵Chris Bieneman2015-09-301-1/+1
| | | | | | libclang_rt.profile for iOS. llvm-svn: 248948
* [CMake] merge add_compiler_rt_runtime and add_compiler_rt_darwin_runtime ↵Chris Bieneman2015-08-251-13/+12
| | | | | | | | | | | | | | | | into a single function Summary: This refactoring moves much of the Apple-specific behavior into a function in AddCompilerRT. The next cleanup patch will remove more of the if(APPLE) checks in the outlying CMakeLists. This patch adds a bunch of new functionality to add_compiler_rt_runtime so that the target names don't need to be reconstructed outside the call. It also updates some of the call sites to exercise the new functionality, but does not update all uses fully. Subsequent patches will further update call sites and move to using the new features. Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov Subscribers: beanz, rengolin, llvm-commits Differential Revision: http://reviews.llvm.org/D12292 llvm-svn: 245970
* [CMake] Backing out part of r245317. Turns out safestack and profile don't ↵Chris Bieneman2015-08-181-1/+1
| | | | | | work correctly on the iOS simulator and enabling it breaks tests. llvm-svn: 245326
* [CMake] Refactoring add_compiler_rt functions for darwin runtimes.Chris Bieneman2015-08-181-4/+7
| | | | | | | | | | | | Summary: This patch consolidates add_compiler_rt_osx_static_runtime and add_compiler_rt_darwin_dynamic_runtime into a single new function add_compiler_rt_darwin_runtime. Reviewers: filcab, samsonov, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12106 llvm-svn: 245317
* [probile] Fix memory leak introduced in r241824.Alexey Samsonov2015-07-151-0/+1
| | | | llvm-svn: 242350
* Add support for generating profiles in a given directory.Diego Novillo2015-07-096-27/+65
| | | | | | | | | | When the file is initialized, this patch checks whether the path specifies a directory. If so, it creates the directory tree before truncating the file. Use default.profdata instead of pgo-data for default indexed profile name. llvm-svn: 241824
* CMake: Stop using LLVM's custom parse_arguments. NFCFilipe Cabecinhas2015-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Since I was already changing these calls, I changed ARCH and LIB into ARCHS and LIBS to make it more clear that they're lists of arguments. Reviewers: eugenis, samsonov, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10529 llvm-svn: 240120
* This change is the first of 3 patches to add support for specifyingEric Christopher2015-04-282-18/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the profile output from the command line via -fprofile-instr-generate=<path>, where the specified output path/file will be overridden by the LLVM_PROFILE_FILE environment variable. Several changes are made to the runtime to support this: Add a new interface __llvm_profile_override_default_filename that will set the profile output filename, but allows LLVM_PROFILE_FILE to override. This is the interface used by the new option. Refactor the pid-expansion done for LLVM_PROFILE_FILE into a separate routine that can be shared by the various filename setting routines (so that the filename from the option can also use the "%p" syntax). Move the truncation into setFilename, and only truncate if there is a new filename specified (to maintain support for appending to the same profile file in the case of multiple shared objects built with profiling). Move the handling for a NULL filename passed to __llvm_profile_set_filename and __llvm_profile_override_default_filename into the new setFilenamePossiblyWithPid routine. This now correctly resets the output file to default.profraw instead of NULL. The handling for a null LLVM_PROFILE_FILE (which should not reset) is done by caller setFilenameFromEnvironment. Patch by Teresa Johnson. llvm-svn: 236055
* Add missing includeJustin Bogner2015-04-031-0/+1
| | | | llvm-svn: 234037
* profile: Protect .gcda output with flockJustin Bogner2015-04-031-0/+6
| | | | | | | | | | | This avoids crashing or corrupting data if multiple concurrent processes write to the same .gcda file. This is hard to test, since the previous behaviour was a data race that often worked out, and it ignores errors in flock to fall back to the old racy behaviour so that it won't degrade the behaviour on filesystems that don't support flock. llvm-svn: 234036
* At least on NetBSD, sys/errno.h and errno.h are different, so use theJoerg Sonnenberger2015-03-091-1/+1
| | | | | | correct header to get errno. llvm-svn: 231647
* InstrProf: Fix warnings for mixed declarations and code. NFC.Vasileios Kalintiris2015-02-251-10/+15
| | | | llvm-svn: 230494
* InstrProf: Optionally print an error when emitting profile data failsJustin Bogner2015-01-161-1/+6
| | | | | | | | Debugging a missing profile is a bit painful right now. We can make people's lives a bit easier by adding a knob to enable printing a helpful error message for such failures. llvm-svn: 226312
* profile: Add low level versions of profile buffer functionsJustin Bogner2014-12-093-7/+79
| | | | | | | | | | | | On Darwin, compiler_rt uses magic linker symbols to find the profile counters in the __DATA segment. This is a reasonable method for normal, hosted, userspace programs. However programs with custom memory layouts, such as the kernel, will need to tell compiler_rt explicitly where to find these sections. Patch by Lawrence D'Anna. Thanks! llvm-svn: 223840
* [Profile] Always build profile runtime library with -fPIC.Alexey Samsonov2014-11-141-5/+1
| | | | | | | | | This change removes libclang_rt.profile-pic-<arch>.a version of profile runtime. Instead, it's sufficient to always build libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into both executables and shared objects. llvm-svn: 221952
* profile: Avoid name collisions between instrumentation and runtimeJustin Bogner2014-09-046-33/+33
| | | | | | | | | | | | The naming scheme we're using for counters in profile data shares a prefix with some fixed names we use for the runtime, notably __llvm_profile_data_begin and _end. Embarrassingly, this means a function called begin() can't be instrumented. This modifies the runtime names so as not to collide with the instrumentation. llvm-svn: 217166
* profile: Improve error messages on bad GCDA filesJustin Bogner2014-08-181-4/+12
| | | | llvm-svn: 215933
* Fix building InstrProfilingFile.c on FreeBSDViktor Kutuzov2014-06-151-1/+0
| | | | llvm-svn: 210989
* Go via uintptr_t when casting away constness, otherwise GCC will warnJoerg Sonnenberger2014-05-201-1/+4
| | | | | | when using -Wcast-qual. llvm-svn: 209214
* InstrProf: Support profiling dlopen'd shared librariesDuncan P. N. Exon Smith2014-05-173-78/+94
| | | | | | | | | | | | | | | | | | Shared objects are hard. After this commit, we do the right thing when profiling two separate shared objects that have been dlopen'd with `RTLD_LOCAL`, when the main executable is *not* being profiled. This mainly simplifies the writer logic. - At initialization, determine the output filename and truncate the file. Depending on whether shared objects can see each other, this may happen multiple times. - At exit, each executable writes its own profile in append mode. <rdar://problem/16918688> llvm-svn: 209053
* InstrProf: Create a PIC version of the profile runtimeDuncan P. N. Exon Smith2014-05-161-0/+5
| | | | | | | | | | | | These tests were XPASS-ing on Linux bots creating Mach-O, which makes sense, since the real difference is the object format. I'm hoping a short-term fix to get these tests passing on ELF is to create two copies of the runtime -- one built with -fPIC, and one without. A follow-up patch will change clang's driver to pick between them depending on whether `-shared` is specified. llvm-svn: 208947
* InstrProf: Fix shared object profilingDuncan P. N. Exon Smith2014-05-167-13/+84
| | | | | | | | | | | | | | | | | | Change the API of the instrumented profiling library to work with shared objects. - Most things are now declared hidden, so that each executable gets its own copy. - Initialization hooks up a linked list of writers. - The raw format with shared objects that are profiled consists of a concatenated series of profiles. llvm-profdata knows how to deal with that since r208938. <rdar://problem/16918688> llvm-svn: 208940
* Fix typosAlp Toker2014-05-151-1/+1
| | | | llvm-svn: 208841
* InstrProf: Remove redundant declarationDuncan P. N. Exon Smith2014-05-101-1/+0
| | | | llvm-svn: 208464
* profile: Fix the build with gcc 4.9Reid Kleckner2014-05-012-18/+16
| | | | | | | | | | GCC -pedantic warns that the initialization of Header is not constant: InstrProfilingFile.c:31:5: error: initializer element is not computable at load time [-Werror] LLVM defaults to enabling -pedantic. If this warning is unhelpful, we can consider revisiting that decision. llvm-svn: 207784
* [profile] Flatten profile runtime - define platform-specific code in ↵Alexey Samsonov2014-04-223-16/+14
| | | | | | sources, not in the build system llvm-svn: 206915
* InstrProf: Add simple compiler-rt testDuncan P. N. Exon Smith2014-03-311-2/+0
| | | | | | | | | | Add the test infrastructure for testing lib/profile and a single test. This initial commit only enables the tests on Darwin, but they'll be enabled on Linux soon after. <rdar://problem/16458307> llvm-svn: 205256
* [CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.Alexey Samsonov2014-03-311-2/+1
| | | | | | | | Soon there will be an option to build compiler-rt parts as shared libraries on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov. llvm-svn: 205183
* Define uintptr_t in the profiling sources on x86_64 FreeBSD in 32-bit modeViktor Kutuzov2014-03-261-0/+1
| | | | llvm-svn: 204799
* InstrProf: Change the extension of the default profileDuncan P. N. Exon Smith2014-03-241-1/+1
| | | | | | | | | Change the name of the default profile dumped by compiler-rt to default.profraw. This distinguishes it more clearly from the (incompatible) format output by llvm-profdata that is read by clang -fprofile-instr-use. llvm-svn: 204676
* InstrProf: Indicate pointer size in raw profileDuncan P. N. Exon Smith2014-03-231-4/+6
| | | | | | | | | Since the profile can come from 32-bit machines, the reader needs to check the pointer size. Change the magic number to facilitate this. <rdar://problem/16400648> llvm-svn: 204556
* Avoid GCC's "cast from pointer to integer of different size" warning.David Blaikie2014-03-212-4/+4
| | | | | | | | This is a bit of a stab in the dark as I'm not sure I've got these source files compiling correctly locally. (and the warning only reproduces on a 32bit build anyway) llvm-svn: 204521
* InstrProf: Remove MSVC-specific logicDuncan P. N. Exon Smith2014-03-211-14/+8
| | | | | | | | Apparently, MSVC has stdint.h now? Let's see if the buildbots complain. I'm not convinced that the build system is even set up for MSVC to build this file, but... llvm-svn: 204515
* InstrProf: Change magic number to have non-text charactersDuncan P. N. Exon Smith2014-03-211-9/+16
| | | | | | | | | Include non-text characters in the magic number so that text files can't match. <rdar://problem/15950346> llvm-svn: 204514
* InstrProf: __ => _ in header guardsDuncan P. N. Exon Smith2014-03-211-3/+3
| | | | llvm-svn: 204502
* InstrProf: Unify logic in two profile writersDuncan P. N. Exon Smith2014-03-213-25/+27
| | | | | | <rdar://problem/15943240> llvm-svn: 204500
* InstrProf: Write the __llvm_profile_write_buffer()Duncan P. N. Exon Smith2014-03-211-2/+45
| | | | | | | | | | Write __llvm_profile_write_buffer(), which uses the same logic as __llvm_profile_write_file(), but writes directly to a provided `char*` buffer instead. <rdar://problem/15943240> llvm-svn: 204499
* InstrProf: If libc is available, use it; no functionality changeDuncan P. N. Exon Smith2014-03-213-49/+50
| | | | | | | | | | | | | It was misguided to plan to rely on __llvm_profile_write_buffer() in __llvm_profile_write_file(). It's less complex to duplicate the writing logic than to mmap the file. Since it's here to stay, move `FILE*`-based writing logic into InstrProfilingFile.c. <rdar://problem/15943240> llvm-svn: 204498
* InstrProf: Reorganize files; no functionality changeDuncan P. N. Exon Smith2014-03-219-106/+126
| | | | | | | | | | | | | | | | | | Move functions around to prepare for some other changes. - Merge InstrProfilingExtras.h with InstrProfiling.h. There's no benefit to having these split. - Rename InstrProfilingExtras.c to InstrProfilingFile.c. - Split actual buffer writing code out of InstrProfiling.c into InstrProfilingBuffer.c. - Drive-by corrections of a couple of header comments. <rdar://problem/15943240> llvm-svn: 204497
* InstrProf: Write raw binary profile from runtimeDuncan P. N. Exon Smith2014-03-211-22/+47
| | | | | | | | Write a raw binary profile from the runtime. <rdar://problem/15950346> llvm-svn: 204495
OpenPOWER on IntegriCloud