| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When forking in several threads, the counters were written out in using the same global static variables (see GCDAProfiling.c): that leads to crashes.
So when there is a fork, the counters are resetted in the child process and they will be dumped at exit using the interprocess file locking.
When there is an exec, the counters are written out and in case of failures they're resetted.
Reviewers: jfb, vsk, marco-c, serge-sans-paille
Reviewed By: marco-c, serge-sans-paille
Subscribers: llvm-commits, serge-sans-paille, dmajor, cfe-commits, hiraditya, dexonsmith, #sanitizers, marco-c, sylvestre.ledru
Tags: #sanitizers, #clang, #llvm
Differential Revision: https://reviews.llvm.org/D78477
(cherry picked from commit bec223a9bc4eb9747993ee9a4c1aa135c32123e6)
|
|
|
|
|
|
| |
See the discussion on PR44792.
This reverts commit 02ce9d8ef5a84bc884de4105eae5f8736ef67634.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Counters can be flushed in a multi-threaded context for example when the process is forked in different threads (https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp#L632-L663).
In order to avoid pretty bad things, a critical section is needed around the flush.
We had a lot of crashes in this code in Firefox CI when we switched to clang for linux ccov builds and those crashes disappeared with this patch.
Reviewers: marco-c, froydnj, dmajor, davidxl, vsk
Reviewed By: marco-c, dmajor
Subscribers: ahatanak, froydnj, dmajor, dberris, jfb, #sanitizers, llvm-commits, sylvestre.ledru
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D70910
|
|
|
|
|
|
|
| |
This reverts commit 88f5bf77f92899b19fdafdffc7b060f930c1cb8b as it broke
green dragon bots.
http://lab.llvm.org:8080/green/job/clang-stage1-RA/4401/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Counters can be flushed in a multi-threaded context for example when the process is forked in different threads (https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp#L632-L663).
In order to avoid pretty bad things, a critical section is needed around the flush.
We had a lot of crashes in this code in Firefox CI when we switched to clang for linux ccov builds and those crashes disappeared with this patch.
Reviewers: marco-c, froydnj, dmajor, davidxl
Reviewed By: marco-c, dmajor
Subscribers: froydnj, dmajor, dberris, jfb, #sanitizers, llvm-commits, sylvestre.ledru
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D70910
|
|
|
|
| |
llvm-svn: 353485
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to reflect the new license.
We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.
Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.
llvm-svn: 351636
|
|
|
|
|
|
| |
removed while the process is in execution
llvm-svn: 346300
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This ports the profiling runtime on Fuchsia and enables the
instrumentation. Unlike on other platforms, Fuchsia doesn't use
files to dump the instrumentation data since on Fuchsia, filesystem
may not be accessible to the instrumented process. We instead use
the data sink to pass the profiling data to the system the same
sanitizer runtimes do.
Differential Revision: https://reviews.llvm.org/D47208
llvm-svn: 337881
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The write buffer contains signed chars, which means the shift operations caused values such as the arc tag value (0x01a10000) to be read incorrectly (0xffa10000).
This fixes a regression from https://reviews.llvm.org/D49132.
Reviewers: uweigand, davidxl
Reviewed By: uweigand
Subscribers: llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D49161
llvm-svn: 336775
|
|
|
|
|
|
|
| |
Fix building GCDAProfiling.c with pre-C99 compilers.
This caused a build bot failure.
llvm-svn: 336706
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Two fixes required to handle big-endian systems:
- 64-bit counter values are stored in a mixed-endian format in the
gcov files: a 32-bit low-part followed by a 32-bit high part. Note that
this is already implemented correctly on the LLVM side, see
GCOVBuffer::readInt64.
- The tag values (e.g. arcs tag, object summary tag, ...) are aways
written as the same sequence of bytes independent of byte order. But
when *reading* them back in, the code reads them as 32-bit values in
host byte order. For the comparisons to work correctly, this should
instead always read them as little-endian values.
Fixes PR 38121.
Reviewed By: marco-c
Differential Revision: https://reviews.llvm.org/D49132
llvm-svn: 336693
|
|
|
|
|
|
|
| |
This reapplies r336365, after marking tests as failing on various
configurations.
llvm-svn: 336678
|
|
|
|
|
|
|
| |
This reverts r336365: the added tests are failing on various
configurations (e.g. on green-dragon).
llvm-svn: 336474
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This will make the behavior of __gcov_flush match the GCC behavior.
I would like to rename __gcov_flush to __llvm_gcov_flush (in case of programs linking to libraries built with different compilers), but I guess we can't for compatibility reasons.
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: samsonov, vitalybuka, pcc, kcc, junbuml, glider, fhahn, eugenis, dvyukov, davidxl, srhines, chh, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D48538
llvm-svn: 336365
|
|
|
|
|
|
|
|
|
|
| |
__gcov_flush is hidden.
For applications to dump profiling data of selected .so files,
they can use dlsym to find and call llvm_gcov_flush in each .so file.
Differential Revision: https://reviews.llvm.org/D45454
llvm-svn: 336019
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
llvm-svn: 321703
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
llvm-svn: 321702
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
llvm-svn: 320731
|
|
|
|
|
|
|
|
|
|
|
| |
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
llvm-svn: 320728
|
|
|
|
|
|
|
|
|
|
|
| |
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
llvm-svn: 320726
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
llvm-svn: 316048
|
|
|
|
|
|
|
| |
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
llvm-svn: 312246
|
|
|
|
|
|
|
|
|
|
|
| |
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
llvm-svn: 312240
|
|
|
|
| |
llvm-svn: 276708
|
|
|
|
| |
llvm-svn: 276021
|
|
|
|
|
|
| |
.. into reusable interfaces. No functional change is expected.
llvm-svn: 275807
|
|
|
|
| |
llvm-svn: 275597
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 262779
|
|
|
|
|
|
|
|
|
|
|
| |
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)'
llvm-svn: 260475
|
|
|
|
| |
llvm-svn: 258200
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 234037
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 234036
|
|
|
|
| |
llvm-svn: 215933
|
|
|
|
| |
llvm-svn: 204267
|
|
|
|
|
|
| |
x64 FreeBSD in 32-bit mode
llvm-svn: 203470
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|