| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
This header fragment is useful on its own for any consumer that wants
to use custom instruction profile runtime with the LLVM instrumentation.
The concrete use case is in Fuchsia's kernel where we want to use
instruction profile instrumentation, but we cannot use the compiler-rt
runtime because it's not designed for use in the kernel environment.
This change allows installing this header as part of compiler-rt.
Differential Revision: https://reviews.llvm.org/D64532
|
|
|
|
|
| |
This reverts commit f11bc1776fd2815b60e0b1ed97be00b517348162 since it's
failing to build on some bots.
|
|
|
|
|
|
|
|
|
|
|
| |
This header fragment is useful on its own for any consumer that wants
to use custom instruction profile runtime with the LLVM instrumentation.
The concrete use case is in Fuchsia's kernel where we want to use
instruction profile instrumentation, but we cannot use the compiler-rt
runtime because it's not designed for use in the kernel environment.
This change allows installing this header as part of compiler-rt.
Differential Revision: https://reviews.llvm.org/D64532
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for continuously syncing profile counter updates to a file.
The motivation for this is that programs do not always exit cleanly. On
iOS, for example, programs are usually killed via a signal from the OS.
Running atexit() handlers after catching a signal is unreliable, so some
method for progressively writing out profile data is necessary.
The approach taken here is to mmap() the `__llvm_prf_cnts` section onto
a raw profile. To do this, the linker must page-align the counter and
data sections, and the runtime must ensure that counters are mapped to a
page-aligned offset within a raw profile.
Continuous mode is (for the moment) incompatible with the online merging
mode. This limitation is lifted in https://reviews.llvm.org/D69586.
Continuous mode is also (for the moment) incompatible with value
profiling, as I'm not sure whether there is interest in this and the
implementation may be tricky.
As I have not been able to test extensively on non-Darwin platforms,
only Darwin support is included for the moment. However, continuous mode
may "just work" without modification on Linux and some UNIX-likes. AIUI
the default value for the GNU linker's `--section-alignment` flag is set
to the page size on many systems. This appears to be true for LLD as
well, as its `no_nmagic` option is on by default. Continuous mode will
not "just work" on Fuchsia or Windows, as it's not possible to mmap() a
section on these platforms. There is a proposal to add a layer of
indirection to the profile instrumentation to support these platforms.
rdar://54210980
Differential Revision: https://reviews.llvm.org/D68351
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the %m filename pattern is used, the filename is unique to each
image, so the cached value is wrong.
It struck me that the full filename isn't something that's recomputed
often, so perhaps it doesn't need to be cached at all. David Li pointed
out we can go further and just hide lprofCurFilename. This may regress
workflows that depend on using the set-filename API to change filenames
across all loaded DSOs, but this is expected to be very rare.
rdar://55137071
Differential Revision: https://reviews.llvm.org/D69137
llvm-svn: 375301
|
|
|
|
|
|
|
|
| |
See https://reviews.llvm.org/D58620 for discussion.
Note how the comment in the file already said ".cpp" :)
llvm-svn: 367460
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
User code can open a file on its own and pass it to the runtime, rather than
specifying a name and having the runtime open the file. This supports the use
case where a process cannot open a file on its own but can receive a file
descriptor from another process.
Relanding https://reviews.llvm.org/D62541. The original revision unlocked
the file before calling flush, this revision fixes that.
Reviewers: Dor1s, davidxl
Reviewed By: Dor1s
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D63581
llvm-svn: 364231
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
profile data."
This caused instrumented Clang to become crashy. See llvm-commits thread
for repro steps.
This also reverts follow-up r362716 which added test cases.
> Author: Sajjad Mirza
>
> Differential Revision: http://reviews.llvm.org/D62541
llvm-svn: 363134
|
|
|
|
|
|
|
|
| |
Author: Sajjad Mirza
Differential Revision: http://reviews.llvm.org/D62541
llvm-svn: 362676
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
profile data has been dumped to the file.
Summary:
The main use is for users to disable dumping profile data to the file
for certain processes in case the processes don't have permission to
write to the disks, and trying to do so would result in side effects
such as crashes.
Patch by Yuke Liao (@liaoyuke).
Additional context (Chromium use case):
- https://bugs.chromium.org/p/chromium/issues/detail?id=842424
- https://bugs.chromium.org/p/chromium/issues/detail?id=957655
- https://chromium-review.googlesource.com/c/chromium/src/+/1610093
Reviewers: Dor1s, vsk, davidxl
Reviewed By: Dor1s, davidxl
Subscribers: delcypher, davidxl, sajjadm, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D62078
llvm-svn: 361194
|
|
|
|
|
|
|
|
| |
Make it more readable for an average user.
Differential Revision: https://reviews.llvm.org/D60896
llvm-svn: 359043
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r355343 was landed and was reverted in r355363 due to build breakage.
This patch adds Linux/Windows support on top of r355343.
In this patch, Darwin should be working with testing case. Linux should be working,
I will enable the testing case in a follwup diff. Windows/Other should be building.
Correct implementation for Other platforms will be added.
Thanks David for reviewing the original diff, helping me with issues on Linux, and
giving suggestions for adding support for Other platforms.
llvm-svn: 355701
|
|
|
|
|
|
|
|
| |
This caused issues on Linux/Windows and other platforms.
r355343 355350 355350
llvm-svn: 355363
|
|
|
|
|
|
|
|
| |
The profile data will be dumped in a file default_xxx.profraw.order.
Differential Revision: https://reviews.llvm.org/D57530
llvm-svn: 355343
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add __llvm_profile_get_filename interface to get the profile filename,
which can be used for identifying which profile file belongs to an app
when multiple binaries are instrumented and dumping profiles into the
same directory. The filename includes the path.
Reviewers: davidxl
Subscribers: delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D49529
llvm-svn: 337482
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the following issues:
(1) The strong definition of the merge hook function was not working which
breaks the online value profile merging. This patch removes the weak
attribute of VPMergeHook and assigns the value dynamically.
(2) Truncate the proifle file so that we don't have garbage data at the end of
the file.
(3) Add new __llvm_profile_instrument_target_value() interface to do the value
profile update in batch. This is needed as the original incremental by 1
in __llvm_profile_instrument_target() is too slow for online merge.
Differential Revision: https://reviews.llvm.org/D44847
llvm-svn: 328987
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
The API is intended to be used by user to do fine
grained (per-region) control of profile dumping.
Differential Revision: http://reviews.llvm.org/D23106
llvm-svn: 278092
|
|
|
|
|
|
| |
and llvm
llvm-svn: 276385
|
|
|
|
|
|
|
|
| |
This eliminates unncessary calls and init functions.
Differential Revision: http://reviews.llvm.org/D22614
llvm-svn: 276355
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D22546
llvm-svn: 276083
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D21116
llvm-svn: 272167
|
|
|
|
|
|
| |
Differentianl Revision: http://reviews.llvm.org/D20572
llvm-svn: 270617
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D20460
llvm-svn: 270337
|
|
|
|
| |
llvm-svn: 270177
|
|
|
|
| |
llvm-svn: 270005
|
|
|
|
| |
llvm-svn: 269964
|
|
|
|
|
|
|
| |
This is one of the enabler patch to allow value profiler to
allocate counter statically.
llvm-svn: 269689
|
|
|
|
|
|
|
| |
Revert r268864 that reverted 268840 after underlying problem
is fixed for arm bot.
llvm-svn: 268992
|
|
|
|
|
|
|
|
| |
This reverts commit r268840, as it breaks Thumb2 self-hosting. There is something
unstable in the profiling for Thumb2 that needs to be sorted out before we continue
implementing these changes to the profiler. See PR27667.
llvm-svn: 268864
|
|
|
|
|
|
|
|
| |
With this patch, value data are longer pre-collected
before writing. The code is simplified and requires
less heap space for dumping.
llvm-svn: 268840
|
|
|
|
|
|
| |
This is needed by client which uses in-process merge API.
llvm-svn: 262736
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D17831
llvm-svn: 262644
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compiler-rt miscalculates the number of entries in the __llvm_prf_data section
on i386 Darwin. This results in a number of test failures (which we started
catching after r261344).
The fix we attempted earlier is insufficient (r261683). It caused some tests to
start passing again, but that hid the fact that we drop some data entries.
This patch should fix the real problem. It fixes the way we compute DataSize by
taking into account the way the Darwin linker lays out __llvm_prf_data.
Differential Revision: http://reviews.llvm.org/D17623
llvm-svn: 261957
|
|
|
|
|
|
|
|
|
|
| |
The profile reader no longer depends on this field to be updated and point
to owning func's vp data. The VP data also no longer needs to be allocated
in a contiguous memory space.
Differential Revision: http://reviews.llvm.org/D15258
llvm-svn: 256543
|
|
|
|
| |
llvm-svn: 255748
|
|
|
|
|
|
|
|
|
| |
InstrProfiling.h file declares profile runtime public APIs.
It has become a dumping place for many different things, which
needs cleanups. In this change, core type declarations and
portability macros are moved to a new file InstrProfilingPort.h.
llvm-svn: 255270
|
|
|
|
| |
llvm-svn: 254943
|
|
|
|
| |
llvm-svn: 254761
|
|
|
|
|
|
| |
Also added a test case for runtime error reporting.
llvm-svn: 254625
|
|
|
|
| |
llvm-svn: 253911
|
|
|
|
|
|
|
| |
Replace duplicate definition raw header with
common definition in InstrProfData.inc.
llvm-svn: 253896
|
|
|
|
| |
llvm-svn: 253895
|
|
|
|
|
|
|
| |
Replace duplicate definition per-func profile control data
with common definition in InstrProfData.inc.
llvm-svn: 253891
|
|
|
|
|
|
|
| |
Replace duplicate definition value profile kind definitions
with common definition in InstrProfData.inc.
llvm-svn: 253890
|
|
|
|
|
|
|
| |
- Replace use of __llvm_profile_value_data with common data structure.
- Remve duplicate InstrProfValueNode
llvm-svn: 253883
|
|
|
|
|
|
|
| |
This makes code more readable and be made more portable in the future.
There is no functional change.
llvm-svn: 253845
|
|
|
|
|
|
|
|
| |
There seems to be a problem in system header (stdint.h) of FreeBSD
where uint8_t nor uint16_t are defined. Explicitly define the key
types as done for FreeBSD i386.
llvm-svn: 253703
|