summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfilingExtras.c
Commit message (Collapse)AuthorAgeFilesLines
* InstrProf: Reorganize files; no functionality changeDuncan P. N. Exon Smith2014-03-211-105/+0
| | | | | | | | | | | | | | | | | | 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-9/+18
| | | | | | 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-201-2/+2
| | | | | | | | 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-8/+8
| | | | | | | | | | | 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: Update interface for writing instrumentation data to fileDuncan P. N. Exon Smith2014-03-201-11/+18
| | | | | | | | | | | | | | | | | __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-201-5/+0
| | | | | | | | | | | | | | | | | | | 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: Splitting implementation files; no functionality changeDuncan P. N. Exon Smith2014-03-191-0/+49
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