summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfilingFile.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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: Avoid name collisions between instrumentation and runtimeJustin Bogner2014-09-041-6/+6
| | | | | | | | | | | | 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
* 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-171-75/+91
| | | | | | | | | | | | | | | | | | 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-8/+42
| | | | | | | | | | | | | | | | | | 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
* profile: Fix the build with gcc 4.9Reid Kleckner2014-05-011-9/+8
| | | | | | | | | | 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
* 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
* Avoid GCC's "cast from pointer to integer of different size" warning.David Blaikie2014-03-211-2/+2
| | | | | | | | 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: Unify logic in two profile writersDuncan P. N. Exon Smith2014-03-211-19/+15
| | | | | | <rdar://problem/15943240> llvm-svn: 204500
* InstrProf: If libc is available, use it; no functionality changeDuncan P. N. Exon Smith2014-03-211-1/+42
| | | | | | | | | | | | | 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-0/+106
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
OpenPOWER on IntegriCloud