summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfilingFile.c
Commit message (Collapse)AuthorAgeFilesLines
...
* [Profile] introduce reusable internal interfaces to find dir separator \NFCXinliang David Li2016-07-191-5/+1
| | | | llvm-svn: 276027
* 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-151-1/+5
| | | | llvm-svn: 275597
* [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-101-20/+68
| | | | | | Differential Revision: http://reviews.llvm.org/D21219 llvm-svn: 272428
* [profile] in-process merging support part-3Xinliang David Li2016-06-081-11/+157
| | | | | | Differential Revision: http://reviews.llvm.org/D21056 llvm-svn: 272227
* [profile] Un-hide two symbolsVedant Kumar2016-06-081-1/+1
| | | | | | | | | | | - 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-081-1/+1
| | | | | | | | 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] Further cleanup/refactor file handling codeXinliang David Li2016-05-251-34/+26
| | | | | | Also get rid of the redundant strncpy calls. llvm-svn: 270730
* Fix braced initializer list (NFC)Teresa Johnson2016-05-251-1/+1
| | | | | | | | | | | | | | After r270617 I am getting an error when building: projects/compiler-rt/lib/profile/InstrProfilingFile.c:33:36: error: missing field 'PidChars' initializer [-Werror,-Wmissing-field-initializers] lprofFilename lprofCurFilename = {0}; ^ Fix the aggregate initializer. llvm-svn: 270697
* [profile] clean up profile file handling codeXinliang David Li2016-05-241-87/+138
| | | | | | Differentianl Revision: http://reviews.llvm.org/D20572 llvm-svn: 270617
* Fix typo in commentXinliang David Li2016-05-241-1/+1
| | | | llvm-svn: 270524
* [profile] clean up file initialization codeXinliang David Li2016-05-241-15/+23
| | | | | | Also added more documentation. llvm-svn: 270519
* Fix bot failureXinliang David Li2016-05-201-1/+1
| | | | llvm-svn: 270186
* [profile] PROF_ERR, PROF_WARNXinliang David Li2016-05-201-3/+3
| | | | | | | | 1) Move common prefix to the macro def 2) Introduced PROF_WARN 3) Make error message unconditionally printed out. llvm-svn: 270185
* [profile] Remove anther malloc useXinliang David Li2016-05-201-2/+6
| | | | llvm-svn: 270181
* [profile] Allow max vals per site to be controllable at runtimeXinliang David Li2016-05-181-0/+2
| | | | llvm-svn: 269993
* [profile] Eliminate dynamic memory allocation for vp writingXinliang David Li2016-05-141-1/+1
| | | | | | | | | | This is part-3 of the effort to eliminate dependency on libc allocator in instr profiler runtime. With this change, the profile dumper is completely free of malloc/calloc. Value profile instr API implementation is the only remaining piece with calloc dependency. llvm-svn: 269576
* [profile] Eliminate dynamic memory allocation for buffered writerXinliang David Li2016-05-131-7/+13
| | | | | | | | With this change, dynamic memory allocation is only used for testing purpose. This change is one of the many steps to make instrument profiler dynamic allocation free. llvm-svn: 269453
* Reapply r268840: [profile] Simplify value profile writingXinliang David Li2016-05-101-4/+1
| | | | | | | Revert r268864 that reverted 268840 after underlying problem is fixed for arm bot. llvm-svn: 268992
* Revert "[profile] Simplify value profile writing"Renato Golin2016-05-071-1/+4
| | | | | | | | This reverts commit r268840, as it breaks Thumb2 self-hosting. There is something unstable in the profiling for Thumb2 that needs to be sorted out before we continue implementing these changes to the profiler. See PR27667. llvm-svn: 268864
* [profile] Simplify value profile writingXinliang David Li2016-05-071-4/+1
| | | | | | | | With this patch, value data are longer pre-collected before writing. The code is simplified and requires less heap space for dumping. llvm-svn: 268840
* [libprofile] Handle '\\' in __llvm_profile_recursive_mkdirSean Silva2016-03-281-1/+1
| | | | | | | | | | | | | | This is implicitly needed at least by gcc-flag-compatibility.test The thing that needs it is the `\` preceding the "default.profraw" appended internally by clang when doing `-fprofile-use=`. Clang uses `\` because is uses sys::path::append which will use `\` on a Windows host. This is wrong, but I don't think there's an easy way to solve it (maybe just always using `/` since places that accept `\` also tend to accept `/`, but not the other way around). llvm-svn: 264665
* [PGO] cleanup: move one support method into InstrProfilingUtil.h /NFCXinliang David Li2016-03-061-13/+0
| | | | llvm-svn: 262791
* [PGO] internal API name cleanups (for better consistency)Xinliang David Li2016-03-061-9/+9
| | | | llvm-svn: 262788
* [profile] Support hostname expansion in LLVM_PROFILE_FILEVedant Kumar2016-01-291-8/+36
| | | | | | | | | | | This patch adds support for expanding "%h" out to the machine hostname in the LLVM_PROFILE_FILE environment variable. Patch by Daniel Waters! Differential Revision: http://reviews.llvm.org/D16371 llvm-svn: 259272
* Minor cleanup /NFCXinliang David Li2016-01-281-4/+0
| | | | llvm-svn: 259068
* Fix typo in commentXinliang David Li2016-01-081-1/+1
| | | | llvm-svn: 257232
* [PGO] Add runtime hook so that IR instrumentation can override versionXinliang David Li2016-01-081-0/+9
| | | | | | | | IR level instrumentation needs to override version with variant bits. No change for FE instrumentation is needed. Test case is added to detect version mismatch. llvm-svn: 257230
* [PGO] Enable building compiler-rt profile support library on WindowsNathan Slingerland2016-01-051-0/+4
| | | | | | | | | | | | Summary: This change configures Windows builds to build the complier-rt profile support library (clang_rt.profile-i386.lib). Windows API incompatibilities in the compiler-rt profile lib are also fixed. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15830 llvm-svn: 256848
* [PGO]: Refactor VP data writerXinliang David Li2015-12-291-0/+7
| | | | | | | | | Extract the buffered filer writer code used by value profile writer and turn it into common/sharable buffered fileIO interfaces. Added a test case for the buffered file writer and rewrite the VP dumping using the new APIs. llvm-svn: 256604
* [PGO]: Do not update Data->Value field during profile write.Xinliang David Li2015-12-291-6/+10
| | | | | | | | | | The profile reader no longer depends on this field to be updated and point to owning func's vp data. The VP data also no longer needs to be allocated in a contiguous memory space. Differential Revision: http://reviews.llvm.org/D15258 llvm-svn: 256543
* [PGO] cleanup: unify prefix for portability macrosXinliang David Li2015-12-161-7/+7
| | | | llvm-svn: 255748
* [PGO] Improve prof library portabilityXinliang David Li2015-12-151-2/+2
| | | | | | | | | Patch by: Johan Engelen Introduce LLVM_LIBRARY_WEAK macro. Define LLVM_LIBRARY_WEAK and LLVM_LIBRARY_VISIBIITY for MSVC llvm-svn: 255688
* [PGO] Open file with explict binary modeXinliang David Li2015-12-151-1/+1
| | | | | | | | | | Patch by: Johan Engelen On windows, opening in text mode will result in line ending chars to be appended leading to profile corruption. llvm-svn: 255684
* [PGO] Stop leaking libc function to buffer API implXinliang David Li2015-12-071-0/+1
| | | | llvm-svn: 254943
* [PGO] Introduce error report macro in profile-rtXinliang David Li2015-12-031-3/+5
| | | | | | Also added a test case for runtime error reporting. llvm-svn: 254625
* [PGO] Compiler-rt cleanup -- introduces macros for various macrosXinliang David Li2015-11-231-8/+6
| | | | | | | This makes code more readable and be made more portable in the future. There is no functional change. llvm-svn: 253845
* [PGO] Implement a more robust/readable Writer callback interfaceXinliang David Li2015-11-211-5/+12
| | | | | | | | | | | | (patch suggested by silvas) With this patch, the IO information is wrapped in struct ProfDataIOVec, and interface of writerCallback takes a vector of IOVec and a pointer to writer context pointer. Differential Revision: http://reviews.llvm.org/D14859 llvm-svn: 253764
* [PGO] Minor cleanups (from review feedback)Xinliang David Li2015-11-191-2/+2
| | | | | | | | 1. fix naming problem of file/buffer writer 2. change BufferOrFile to WriterCtx 3. move writer and writerctx together llvm-svn: 253545
* Fix format of previous patch (NFC)Xinliang David Li2015-11-181-4/+5
| | | | llvm-svn: 253503
* [PGO] Refactor File and Buffer API profile writing codeXinliang David Li2015-11-181-49/+11
| | | | | | | | | With this change, Buffer API and File API implementations are unified. Differential Revision: http://reviews.llvm.org/D14692 llvm-svn: 253500
* [PGO] Runtime support for value profiling.Betul Buyukkurt2015-11-181-3/+11
| | | | | | | | 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-131-0/+4
| | | | | | | | | | | | | - 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
* Use struct type instead of raw array for raw profile header (NFC)Xinliang David Li2015-10-161-9/+9
| | | | | | | | | | 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
* [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-091-0/+8
| | | | | | | | | | 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-17/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
OpenPOWER on IntegriCloud