Age | Commit message (Collapse) | Author |
|
Summary:
gcov / gcda-based profiling crashes when shared libraries are unloaded
Patch by Benoit Belley and test by Marco Castelluccio for Firefox
See https://bugs.llvm.org/show_bug.cgi?id=27224 & https://bugzilla.mozilla.org/show_bug.cgi?id=1401230
Reviewers: davidxl, rnk, void
Subscribers: jessicah, marco-c, belleyb, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D38124
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321703 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=35464.
Reviewers: zturner, rnk, void
Subscribers: sylvestre.ledru, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D40610
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321702 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This includes a few nice bits of refactoring (e.g splitting out the
exclusive locking code into a common utility).
Hopefully the Windows support is fixed now.
Patch by Rainer Orth!
Differential Revision: https://reviews.llvm.org/D40944
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320731 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
runtime to Solaris"
This reverts commit r320726. It looks like flock isn't available on
Windows:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21317/steps/build%20compiler-rt/logs/stdio
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320728 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This includes a few nice bits of refactoring (e.g splitting out the
exclusive locking code into a common utility).
Patch by Rainer Orth!
Differential Revision: https://reviews.llvm.org/D40944
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320726 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
Fixes https://bugs.llvm.org/show_bug.cgi?id=34922.
Apparently, the mode in **fdopen** gets simply ignored and Windows only cares about the mode of the original **open**.
I have verified this both with the simple case from bug 34922 and with a full Firefox build.
Reviewers: zturner
Reviewed By: zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D38984
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316048 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The buildbots have shown that -Wstrict-prototypes behaves differently in GCC
and Clang so we should keep it disabled until Clang follows GCC's behaviour
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312246 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Clang 5 supports -Wstrict-prototypes. We should use it to catch any C
declarations that declare a non-prototype function.
rdar://33705313
Differential Revision: https://reviews.llvm.org/D36669
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312240 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276708 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276021 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
.. into reusable interfaces. No functional change is expected.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275807 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@275597 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The GCDA writer closed the arc file before unlocking it. This causes an
EBADF while unlocking the file, and opens us up to racy behavior.
Fixes PR26847.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@262779 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
It thinks that these functions don't match the function pointer type
that they are passed with:
GCDAProfiling.c(578) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'
GCDAProfiling.c(579) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'
GCDAProfiling.c(580) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@260475 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@258200 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
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
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256848 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
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.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@241824 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@234037 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This avoids crashing or corrupting data if multiple concurrent
processes write to the same .gcda file. This is hard to test, since
the previous behaviour was a data race that often worked out, and it
ignores errors in flock to fall back to the old racy behaviour so that
it won't degrade the behaviour on filesystems that don't support
flock.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@234036 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215933 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204267 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
x64 FreeBSD in 32-bit mode
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203470 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
filename the global variable.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199572 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
precise in the length accounting and use memcpy instead of
strcpy/strcat.
Differential Revision: http://llvm-reviews.chandlerc.com/D2547
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199332 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
C++ style comments not allowed in C90,
signed unsigned comparision.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196948 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196357 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Takes file checksum as an argument to write to .gcda file.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195190 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This function will be called by GCOVProfiling to write and update object
and program summaries to be read in by llvm-cov.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194499 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190543 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190359 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
'errno' header.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@185106 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
(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!
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184895 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184878 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
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.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@184799 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182599 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
this out.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182598 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
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>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182563 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
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>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181924 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
There isn't a speedup when using unbuffered I/O. It slows it down in fact.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181060 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
implementation is now only about 5 times slower than gcc's.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@180980 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The fread / fwrite calls were happening for each timer. However, that could be
pretty expensive for a large number of timers. Instead, read and write the
timers in one call.
This gives ~10% speedup in compilation time.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@179990 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This function replaces the call of `atexit' from being generated in the compile
units. Basically, it registers the "writeout" and "flush" functions (if
present). It will generate calls to the `atexit' function for cleanups and final
writeout functions, but only once. This is better than checking for `main',
because a library may not have a `main' function in it.
<rdar://problem/12439551>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177578 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
It may be prohibitively expensive to write out >1000 files at the same time. So
we would rather emit them serially. These functions allow the GCOV
implementation to register the functions that writeout the GCOV information per
compile unit. At exit, they are written.
<rdar://problem/12439551>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177436 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The __llvm_gcov_flush() functions only work for the local compile unit. However,
when __gcov_flush() is called, the user expects all of the counters to be
flushed, not just the ones in the current compile unit.
This adds some library functions that register the flush functions. It also
defined __gcov_flush() so that loops through that list and calls the functions.
PR15191 & <rdar://problem/13167507>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177337 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
it. Fortunately, versions of gcov that predate the extra checksum also ignore
any extra data, so this isn't a problem. This matches the API change made in
r176745.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176746 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176618 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
didn't delete the original, and now they've diverged. I have no idea what's
going on. Apply my patch in r176173 to this one too, this one looks newer?
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176236 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@164052 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163930 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
With the advent of the __llvm_gcov_flush function, we need to be able to merge
counts into the .gcda files in an intelligent manner. This involves reading the
file if it exists, adding the counts together, and then writing the results.
<rdar://problem/12185886>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163923 91177308-0d34-0410-b5e6-96231b3b80d8
|