Commit Graph

160 Commits

Author SHA1 Message Date
Renato Golin 18342e39e6 Revert "[PGO] Suspend SIGKILL for PR_SET_PDEATHSIG in profile-write"
Revert "[PGO] remove unintended debug trace. NFC"

This reverts commit r295469, r295364, as they are unstable on ARM/AArch64.

llvm-svn: 295664
2017-02-20 15:03:12 +00:00
Rong Xu 72f1e5440e [PGO] Suspend SIGKILL for PR_SET_PDEATHSIG in profile-write
Summary:
We found a nondeterministic behavior when doing online profile merging
for multi-process applications. The application forks a sub-process and
sub-process sets to get SIGKILL when the parent process exits,

The first process gets the lock, and dumps the profile. The second one
will mmap the file, do the merge and write out the file. Note that before
the merged write, we truncate the profile.

Depending on the timing, the child process might be terminated
abnormally when the parent exits first. If this happens:
(1) before the truncation, we will get the profile for the main process
(2) after the truncation, and before write-out the profile,  we will get
0 size profile.
(3) after the merged write, we get merged profile.

This patch temporarily suspend the SIGKILL for PR_SET_PDEATHSIG
before profile-write and restore it after the write.

This patch only applies to Linux system.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: xur, llvm-commits

Differential Revision: https://reviews.llvm.org/D29954

llvm-svn: 295364
2017-02-16 19:21:31 +00:00
Xinliang David Li f2d9481028 [PGO] Delay profile dir creation until write
Differential Revision: http://reviews.llvm.org/D29960

llvm-svn: 295108
2017-02-14 21:39:55 +00:00
Rong Xu af2f1dbde8 [PGO] Update the test cases after r291588.
llvm-svn: 291594
2017-01-10 20:07:01 +00:00
Francis Ricci 17781c71b0 Make cmake link flag naming consistent
Summary:
The build system was inconsistent in its naming conventions for
link flags. This patch changes all uses of LINKFLAGS to LINK_FLAGS,
for consistency with cmake's LINK_FLAGS property.

This patch should make it easier to search the source code for
uses of link flags, as well as providing the benefit of improved
style and consistency.

Reviewers: compnerd, beanz

Subscribers: kubabrecka, llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D28506

llvm-svn: 291539
2017-01-10 04:33:04 +00:00
NAKAMURA Takumi 5ce101a848 compiler-rt/test/profile/Linux/lit.local.cfg: [Py3] Use text mode (universal_newlines=True).
llvm-svn: 288490
2016-12-02 08:17:17 +00:00
Xinliang David Li 8b19a0a100 [Profile] Fix value profiler eviction bug
Differential Revision: https://reviews.llvm.org/D27224

llvm-svn: 288204
2016-11-29 22:00:54 +00:00
Kuba Mracek ff1bd20ded [sanitizer] Add macOS minimum deployment target to all compiler invocations in lit tests
The Clang driver on macOS decides the deployment target based on various things, like your host OS version, the SDK version and some environment variables, which makes lit tests pass or fail based on your environment. Let's make sure we run all lit tests with `-mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}` (10.9 unless overriden).

Differential Revision: https://reviews.llvm.org/D26929

llvm-svn: 288186
2016-11-29 19:25:53 +00:00
Vedant Kumar 6ff82bd0ec [profile] Mark lprofCurFilename as COMPILER_RT_WEAK
This makes __llvm_profile_set_filename() work across dylib boundaries on
Darwin.

This functionality was originally meant to work on all platforms, but
was moved to a Linux-only directory with r272404. The root cause of the
test failure on Darwin was that lprofCurFilename was not marked weak.
Each dylib maintained its own copy of the variable due to the two-level
namespace.

Tested with check-profile (on Darwin). I don't expect this to regress
other platforms.

Differential Revision: https://reviews.llvm.org/D25707

llvm-svn: 284440
2016-10-18 00:02:28 +00:00
Vedant Kumar d5454ce10e [profile] Add test for dead_strip+live_support functionality
Differential Revision: https://reviews.llvm.org/D25457

llvm-svn: 283948
2016-10-11 21:48:48 +00:00
Chad Rosier 6c46efba78 Fix the following tests when running under cross-compilation:
Profile-aarch64 :: Linux/comdat_rename.test
 Profile-aarch64 :: Linux/extern_template.test
 Profile-aarch64 :: Linux/instrprof-comdat.test
 Profile-aarch64 :: Linux/instrprof-cs.c

The issue is that the created (aarch64) binaries were attempting to run natively
instead of running through %run, which guarantees running in the proper
environment if the compilation was configured correctly.

llvm-svn: 282264
2016-09-23 17:40:40 +00:00
Renato Golin fbd3de7851 Try to fix another profile test
Another CFG optimisation patch (280364) has broken bad profile tests, and this
is a similar attempt to fix the test without changing the semantics.

llvm-svn: 280373
2016-09-01 14:44:02 +00:00
Renato Golin 0f298a2655 Fix profile test assuming dumb compiler
Commit r280364 has introduced some call-graph optmisations making a profiler
test "fail" due to not expecting the compiler to be "smart", and fold constants
across functions. This commit works around the issue, leaving the origial
semantics intact.

llvm-svn: 280365
2016-09-01 13:45:47 +00:00
Vedant Kumar 5e3c5e8065 [test] Update coverage tests to sync up with r278152
This should fix the following bot failure:

  http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/6522

Patch by Ying Yi!

llvm-svn: 278164
2016-08-09 21:04:22 +00:00
Xinliang David Li 3b2c002c6d [Profile] Implement new API __llvm_profile_dump
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
2016-08-09 04:21:14 +00:00
Xinliang David Li 24a927b3c2 improve test cases to fix bot failure
llvm-svn: 277403
2016-08-01 23:20:30 +00:00
Xinliang David Li e594277683 Make test more robust with better matching
llvm-svn: 277387
2016-08-01 21:06:54 +00:00
Xinliang David Li 7380a0d4a6 [Profile] Add new test case to cover comdat renaming
Test checks that context specific profiles for comdat functions
are not lost.

llvm-svn: 277381
2016-08-01 20:28:26 +00:00
Xinliang David Li 52626f132c Fix a bug in lit var def: remove extra space
llvm-svn: 277312
2016-08-01 01:54:40 +00:00
Xinliang David Li f418bb8023 [Profile] Add a new test case
The end-end test checks that cs-profile counter update
is obtained as expected.

llvm-svn: 277276
2016-07-30 20:12:00 +00:00
Xinliang David Li 6f6825fe13 Fix buildbot failure
llvm-svn: 276512
2016-07-23 03:34:30 +00:00
Xinliang David Li 54bb751a87 [Profile] Tighten test with expected profile count
llvm-svn: 276500
2016-07-22 23:53:00 +00:00
Xinliang David Li 544ae6c4f3 [Profile] Fix a fixme in the test
llvm-svn: 276494
2016-07-22 23:44:06 +00:00
Xinliang David Li 5a6dc4c9b8 [Profile] Add new test
To test that online merging is enabled by default.

llvm-svn: 276493
2016-07-22 23:38:58 +00:00
Xinliang David Li e953933a9f [Profile] deprecate __llvm_profile_override_default_filename (part2)
This eliminates unncessary calls and init functions.

Differential Revision: http://reviews.llvm.org/D22614

llvm-svn: 276355
2016-07-21 23:19:18 +00:00
Xinliang David Li fa7c6f0d84 [Profile] Add new test to cover %m specifier with shared library (instrumented)
llvm-svn: 276229
2016-07-21 02:58:28 +00:00
Xinliang David Li ab8d32d53a [Profile] More test clean up to read profile from directory specified by -fprofile-generate=
llvm-svn: 276226
2016-07-21 02:14:55 +00:00
Xinliang David Li f6b2ba687b [Profile] Cleanup test to use new dir input feature
llvm-svn: 276225
2016-07-21 01:53:41 +00:00
Xinliang David Li eaf238d494 [Profile] implement interface to get profile path prefix
Differential Revision:  http://reviews.llvm.org/D22546

llvm-svn: 276083
2016-07-20 04:26:09 +00:00
Xinliang David Li 5d2ea9dcf8 [Profile] Test cleanup -- use new lit var for IR PGO tests /NFC
llvm-svn: 276036
2016-07-19 22:12:00 +00:00
Xinliang David Li f26e1d9fb5 [Profile] Introduce lit test vars for IR based instrumentation
llvm-svn: 276034
2016-07-19 21:55:55 +00:00
Etienne Bergeron ab42f4ddba [compiler-rt] Fix VisualStudio virtual folders layout
Summary:
This patch is a refactoring of the way cmake 'targets' are grouped.
It won't affect non-UI cmake-generators.

Clang/LLVM are using a structured way to group targets which ease
navigation through Visual Studio UI. The Compiler-RT projects
differ from the way Clang/LLVM are grouping targets.

This patch doesn't contain behavior changes.

Reviewers: kubabrecka, rnk

Subscribers: wang0109, llvm-commits, kubabrecka, chrisha

Differential Revision: http://reviews.llvm.org/D21952

llvm-svn: 275111
2016-07-11 21:51:56 +00:00
Xinliang David Li 3e9bbddcbb fix a test bug when executed remotedly
llvm-svn: 273693
2016-06-24 17:42:51 +00:00
Sean Silva 537b146798 [libprofile] Define an expansion `%clang_profgen=`
llvm-svn: 272498
2016-06-12 04:17:57 +00:00
Xinliang David Li df5843a532 [profile] fix bot failure on darwin
Profile setting accross shared lib is broken on darwin (to be investigated).
Move the test to Linux only for now

llvm-svn: 272404
2016-06-10 16:23:32 +00:00
Xinliang David Li 1d58b8d95e [profile] add profile path tests for shared lib
Test that __llvm_profile_set_filename invoked in
main program is 'visible' to shared lib (overriding
shared libary's profile path set on command line)

llvm-svn: 272375
2016-06-10 06:14:17 +00:00
Xinliang David Li af053d8b97 [profile] add profile path tests
Testing profile path setter predendence.

llvm-svn: 272372
2016-06-10 05:19:38 +00:00
Xinliang David Li 5846d08a2c Fix win bot failure
llvm-svn: 272316
2016-06-09 21:52:24 +00:00
Vedant Kumar 2494d18f84 [profile] Fix test to bail on failed waitpid in instrprof-file_ex.c
This resolves PR28066.

Patch by David Binderman!

llvm-svn: 272268
2016-06-09 15:29:59 +00:00
Xinliang David Li e2ce2e0020 [profile] in-process merging support part-3
Differential Revision: http://reviews.llvm.org/D21056

llvm-svn: 272227
2016-06-08 23:43:56 +00:00
David Blaikie 7d492c4ff8 add -f to rm so the test passes the first time it's run the file file is not present
(otherwise it just keeps failing at the rm step and never passes... )

llvm-svn: 271959
2016-06-06 23:31:58 +00:00
Sean Silva 7e4e69abe2 [libprofile] Also use `env` for this test.
(necessary on Windows)

llvm-svn: 271955
2016-06-06 23:19:23 +00:00
Sean Silva d7caf5889b [libprofile] Add %run to a couple tests.
llvm-svn: 271947
2016-06-06 22:19:49 +00:00
Xinliang David Li 0891b6d59b [profile] code cleanup /NFC
Address review feedback for better
readability.

llvm-svn: 271922
2016-06-06 18:31:29 +00:00
Xinliang David Li 5cd1f94d4f [profile] in-process mergeing support (part-2)
(Part-1 merging API is in profile runtime)

This patch implements a portable file opening API
with exclusive access for the process. In-process
profile merge requires profile file update to be
atomic/fully sychronized.

llvm-svn: 271864
2016-06-06 03:17:58 +00:00
Xinliang David Li c012d086fa reapply r271577 after OSX bug is fixed (hopefully)
llvm-svn: 271759
2016-06-04 01:51:25 +00:00
Mehdi Amini e1db5a0400 Revert "[profile] enable a subtest for vcall inline virtual func"
This reverts commit r271577.

The test does not pass on OSX.

llvm-svn: 271617
2016-06-03 00:45:26 +00:00
Xinliang David Li d4c23fc76f [profile] enable a subtest for vcall inline virtual func
llvm-svn: 271577
2016-06-02 20:12:06 +00:00
Xinliang David Li 66703ebfe5 [profile] Add end-end test of vp for inline virtual functions
Make sure inline virtual function's address is properly recorded and
dumped in raw profile so that value profiling does not loss tracking.
(Second part of the test will be enabled after the lowering bug is fixed
in LLVM)

llvm-svn: 271528
2016-06-02 16:24:21 +00:00
Xinliang David Li 9ab45cf1eb Move test only for the relevant platform
llvm-svn: 271098
2016-05-28 04:26:06 +00:00