summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfiling.h
Commit message (Collapse)AuthorAgeFilesLines
...
* [PGO] Profile runtime name cleanupsXinliang David Li2015-11-201-18/+14
| | | | | | | | | | | | | Value profile enumerator change to match LLVM code ProfData new member field name change to match LLVM code ProfData member type change to match LLVM code Do not use lower case for types that are internal to implementation (not exposed to APIs) There is no functional change. This is a preparation patch to enable more code sharing in follow up patches Differential Revision: http://reviews.llvm.org/D14841 llvm-svn: 253700
* Speculativley try to fix FreeBSD buildbots, which apparently cannot use stdint.hReid Kleckner2015-11-201-0/+2
| | | | llvm-svn: 253681
* [PGO] Minor cleanups (formating, comments etc) (NFC)Xinliang David Li2015-11-181-0/+6
| | | | | | | | | 1. Added missing public API decl in InstrProfiling.h 2. Clang formatting fix 3. Added more comments for new VP code 4. refactor the VP allocation code to make it more readable. llvm-svn: 253508
* [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-181-1/+52
| | | | | | | | 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] Cleanup: fix function-data field namesXinliang David Li2015-11-081-2/+2
| | | | | | | | 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
* Use struct type instead of raw array for raw profile header (NFC)Xinliang David Li2015-10-161-1/+11
| | | | | | | | | | 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
* Add support for generating profiles in a given directory.Diego Novillo2015-07-091-1/+1
| | | | | | | | | | 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
* This change is the first of 3 patches to add support for specifyingEric Christopher2015-04-281-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* profile: Add low level versions of profile buffer functionsJustin Bogner2014-12-091-3/+0
| | | | | | | | | | | | 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: Avoid name collisions between instrumentation and runtimeJustin Bogner2014-09-041-7/+7
| | | | | | | | | | | | 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
* InstrProf: Support profiling dlopen'd shared librariesDuncan P. N. Exon Smith2014-05-171-2/+2
| | | | | | | | | | | | | | | | | | 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: Fix shared object profilingDuncan P. N. Exon Smith2014-05-161-0/+3
| | | | | | | | | | | | | | | | | | 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
* Define uintptr_t in the profiling sources on x86_64 FreeBSD in 32-bit modeViktor Kutuzov2014-03-261-0/+1
| | | | llvm-svn: 204799
* 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: __ => _ 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-211-0/+2
| | | | | | <rdar://problem/15943240> llvm-svn: 204500
* InstrProf: If libc is available, use it; no functionality changeDuncan P. N. Exon Smith2014-03-211-7/+7
| | | | | | | | | | | | | 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-211-2/+38
| | | | | | | | | | | | | | | | | | 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
* PGO: Indicate errors in profile runtime APIDuncan P. N. Exon Smith2014-03-211-1/+1
| | | | | | Return 0 for success, non-0 for failure. llvm-svn: 204415
* PGO: Declare zero-argument C functions as foo(void)Duncan P. N. Exon Smith2014-03-201-6/+6
| | | | | | | | 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-201-11/+11
| | | | | | | | | | | 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-201-3/+3
| | | | | | | | Adding __llvm_pgo_reset_counters(), which sets all the counters to 0. <rdar://problem/15943240> llvm-svn: 204386
* PGO: Split out initialization of section boundsDuncan P. N. Exon Smith2014-03-201-0/+7
| | | | | | | | | | | | | | | 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: Splitting implementation files; no functionality changeDuncan P. N. Exon Smith2014-03-191-0/+52
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
OpenPOWER on IntegriCloud