| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Return 0 for success, non-0 for failure.
llvm-svn: 204415
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
It turns out this is C code. Specify foo(void).
<rdar://problem/15943240>
llvm-svn: 204396
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Adding __llvm_pgo_reset_counters(), which sets all the counters to 0.
<rdar://problem/15943240>
llvm-svn: 204386
|
|
|
|
| |
llvm-svn: 204384
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
<rdar://problem/15943240>
llvm-svn: 204373
|
|
|
|
|
|
|
|
|
| |
Use Darwin linker magic to find bounds of instrumentation data sections
at link time instead of runtime.
<rdar://problem/15943240>
llvm-svn: 204302
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
<rdar://problem/15943240>
llvm-svn: 204298
|
|
|
|
| |
llvm-svn: 204278
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 204267
|
|
|
|
| |
llvm-svn: 204185
|
|
|
|
|
|
|
| |
Reapply r204079 and r204083, this time with stubs for fputc in
compiler-rt.
llvm-svn: 204091
|
|
|
|
|
|
|
| |
Buildbots are having trouble finding fputc(), and I can't figure out
why. Reverting to investigate.
llvm-svn: 204088
|
|
|
|
| |
llvm-svn: 204084
|
|
|
|
|
|
| |
<rdar://problem/15943240>
llvm-svn: 204083
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In instrumentation-based profiling, we need a set of data structures to
represent the counters. Previously, these were built up during static
initialization. Now, they're shoved into a specially-named section so
that they show up as an array.
As a consequence of the reorganizing symbols, instrumentation data
structures for linkonce functions are now correctly coalesced.
This is the first step in a larger project to minimize runtime overhead
and dependencies in instrumentation-based profilng. The larger picture
includes removing all initialization overhead and making the dependency
on libc optional.
<rdar://problem/15943240>
llvm-svn: 204079
|
|
|
|
|
|
|
|
|
| |
This will break without the corresponding change in clang, which I've
reverted until I figure out how to get it to link properly.
This reverts commit r203710.
llvm-svn: 203713
|
|
|
|
| |
llvm-svn: 203710
|
|
|
|
|
|
| |
x64 FreeBSD in 32-bit mode
llvm-svn: 203470
|
|
|
|
|
|
|
|
| |
Also rename the default output file from "pgo-data" to "default.profdata".
The ".profdata" suffix is consistent with the name of the new llvm-profdata
tool.
llvm-svn: 201808
|
|
|
|
|
|
| |
'compiler-rt' target encompassing them all.
llvm-svn: 201556
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding the ARM RT sources to the CMake files, and enabling some
sanitizers to also build on ARM. This is far from supported or
production quality, but enabling it to build will get us errors
that we can actually fix.
Having said that, the Compiler-RT and the Asan libraries are
know to work on some variations of ARM.
llvm-svn: 200546
|
|
|
|
|
|
| |
filename the global variable.
llvm-svn: 199572
|
|
|
|
|
|
|
|
|
| |
precise in the length accounting and use memcpy instead of
strcpy/strcat.
Differential Revision: http://llvm-reviews.chandlerc.com/D2547
llvm-svn: 199332
|
|
|
|
|
|
| |
This reverts commit e7778e08878d0c61903205428eeb131db9d11b3c.
llvm-svn: 198657
|
|
|
|
|
|
| |
This reverts commit d1b5d3b0e885ef057643fcea99bff8b6cce04b93.
llvm-svn: 198656
|
|
|
|
|
|
| |
yet defined.
llvm-svn: 198650
|
|
|
|
| |
llvm-svn: 198647
|
|
|
|
|
|
|
|
|
| |
Otherwise on (some) 64-bit systems, -Wformat will trigger a warning
because uint64_t is an 'unsigned long' not an 'unsigned long long'.
Consequently, PGOProfiling.c would fail to build if -Werror and
-Wformat are both enabled.
llvm-svn: 198644
|
|
|
|
|
|
|
|
| |
This is fairly minimal support for instrumentation based PGO. The data
format is inefficient, and the output file name is hardcoded to
pgo-data.
llvm-svn: 198638
|
|
|
|
|
|
|
| |
C++ style comments not allowed in C90,
signed unsigned comparision.
llvm-svn: 196948
|
|
|
|
| |
llvm-svn: 196357
|
|
|
|
|
|
| |
Takes file checksum as an argument to write to .gcda file.
llvm-svn: 195190
|
|
|
|
|
|
|
| |
This function will be called by GCOVProfiling to write and update object
and program summaries to be read in by llvm-cov.
llvm-svn: 194499
|
|
|
|
| |
llvm-svn: 190543
|
|
|
|
| |
llvm-svn: 190359
|
|
|
|
|
|
| |
'errno' header.
llvm-svn: 185106
|
|
|
|
|
|
|
|
|
| |
(thanks!) by deferring the free of the filename until we finish writing
the coverage data to that file.
Bill, let me know if you'd prefer a different approach!
llvm-svn: 184895
|
|
|
|
| |
llvm-svn: 184878
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
through Bill's patch:
1) Correctly test the file descriptor after the sceond attempt at
creating the file.
2) Make the filename a global so that we can issue error messages from
other routines.
3) Check errno in several places and print it out so that errors are
easier to track down.
I don't really expect any of these to fix the current failures I'm
seeing, but I'm hopeful they'll at least let me debug them.
llvm-svn: 184799
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We really need the C standard library to be available to implement the
profiling runtime library reasonably, and replicating everything in the
SDKs tree really isn't addressing any problems we have. Notably, all of
the sanitizer runtimes take the same approach, and this isn't a library
which could end up in a bootstrapping problem where the system headers
aren't even available.
This will hopefully prevent subsequent changes which start using various
other bits of C standard library to make things more debuggable.
llvm-svn: 184798
|
|
|
|
| |
llvm-svn: 182599
|
|
|
|
|
|
| |
this out.
llvm-svn: 182598
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using fwrite and fread was very *very* slow. The resulting code was multiple
times slower than GCC's implementation of gcov. Replace the fwrite/fread system
with an mmap() version.
If the `.gcda' file doesn't exist, we (re)allocate a buffer that we write
into. That gets written to the `.gcda' file in one chunk. If the `.gcda' file
already exists, we simply mmap() the file, modify the mapped data, and use
msync() to write the contents out to disk. It's much easier than implementing
our own buffering scheme, and we don't have to use fwrite's and fread's
buffering.
For those who are numbers-oriented, here are some timings:
GCC Verison
-----------
`.gcda' files don't exist: 23s
`.gcda' files do exist: 14s
LLVM Version (before this change)
---------------------------------
`.gcda' files don't exist: 28s
`.gcda' files do exist: 28s
LLVM Version (with this change)
-------------------------------
`.gcda' files don't exist: 18s
`.gcda' files do exist: 4s
It's a win-win-win-win-lose-win-win scenario!
<rdar://problem/13466086>
llvm-svn: 182563
|
|
|
|
|
|
|
|
|
|
| |
The calls to fwrite/fread can be very expensive. GCC avoids this by using a
buffer to read and write from the file, thus limiting the number of fwrite/fread
calls.
<rdar://problem/13466086>
llvm-svn: 181924
|