Revert "[compiler-rt][Profile] Disable test on Arm/AArch64 Linux"This reverts commit 8b86f8a3256a59cbaa12858cb0842025d48f549f.The inconsistent behaviour has been fixed with5e50d3073a5ead122a7315
Revert "[compiler-rt][Profile] Disable test on Arm/AArch64 Linux"This reverts commit 8b86f8a3256a59cbaa12858cb0842025d48f549f.The inconsistent behaviour has been fixed with5e50d3073a5ead122a731580ded3f1cb3c21ee54.
show more ...
[compiler-rt][Profile] Wait for child threads in set-file-object testWe've been seeing this test return 31 instead of 32 for the "functions"line in this test on our AArch64 bots.One possible cau
[compiler-rt][Profile] Wait for child threads in set-file-object testWe've been seeing this test return 31 instead of 32 for the "functions"line in this test on our AArch64 bots.One possible cause is some of the children not finishing in timebefore the llvm-profdata commands are run, if the machine is heavily loaded.Wait for all the children to finish before exiting the parent.Reviewed By: zequanwuDifferential Revision: https://reviews.llvm.org/D109222
[compiler-rt][Profile] Disable test on Arm/AArch64 LinuxWhile a fix for flaky results is being reviewed.
[Profile] Support __llvm_profile_set_file_object in continuous mode.Replace D107203, because __llvm_profile_set_file_object is usually used when theprocess doesn't have permission to open/create f
[Profile] Support __llvm_profile_set_file_object in continuous mode.Replace D107203, because __llvm_profile_set_file_object is usually used when theprocess doesn't have permission to open/create file. That patch trying to copyfrom old profile to new profile contradicts with the usage.Differential Revision: https://reviews.llvm.org/D108242
[profile] Skip mmap() if there are no countersIf there are no counters, an mmap() of the counters section would faildue to the size argument being too small (EINVAL).rdar://78175925Differentia
[profile] Skip mmap() if there are no countersIf there are no counters, an mmap() of the counters section would faildue to the size argument being too small (EINVAL).rdar://78175925Differential Revision: https://reviews.llvm.org/D102735
Revert "Revert "[Coverage] Emit gap region between statements if first statements contains terminate statements.""Reland with update on test case ContinuousSyncmode/basic.c.This reverts commit fe
Revert "Revert "[Coverage] Emit gap region between statements if first statements contains terminate statements.""Reland with update on test case ContinuousSyncmode/basic.c.This reverts commit fe5c2c3ca682b140dd5e640e75948363b6b25ef9.
Revert "[Coverage] Emit gap region between statements if first statements contains terminate statements."This reverts commit 2d7374a0c680f96bdcdb3d05034a93bf145d140f.Breaks ContinuousSyncMode/basi
Revert "[Coverage] Emit gap region between statements if first statements contains terminate statements."This reverts commit 2d7374a0c680f96bdcdb3d05034a93bf145d140f.Breaks ContinuousSyncMode/basic.c in check-profile on macOS.
[Coverage] Emit gap region between statements if first statements contains terminate statements.Differential Revision: https://reviews.llvm.org/D97101
[profile] Fix buffer overrun when parsing %c in filename stringFix a buffer overrun that can occur when parsing '%c' at the end of afilename pattern string.rdar://74571261Reviewed By: kastigli
[profile] Fix buffer overrun when parsing %c in filename stringFix a buffer overrun that can occur when parsing '%c' at the end of afilename pattern string.rdar://74571261Reviewed By: kastiglioneDifferential Revision: https://reviews.llvm.org/D97239
[profile] Suppress spurious 'expected profile to require unlock' warningIn %c (continuous sync) mode, avoid attempting to unlock analready-unlocked profile.The profile is only locked when profil
[profile] Suppress spurious 'expected profile to require unlock' warningIn %c (continuous sync) mode, avoid attempting to unlock analready-unlocked profile.The profile is only locked when profile merging is enabled.
[test] Deflake test/profile/ContinuousSyncMode/online-merging.cThis test spawns 32 child processes which race to update counters onshared memory pages. On some Apple-internal machines, two process
[test] Deflake test/profile/ContinuousSyncMode/online-merging.cThis test spawns 32 child processes which race to update counters onshared memory pages. On some Apple-internal machines, two processes raceto perform an update in approximately 0.5% of the test runs, leading todropped counter updates. Deflake the test by using atomic increments.Tested with:```$ for I in $(seq 1 1000); do echo ":: Test run $I..."; ./bin/llvm-lit projects/compiler-rt/test/profile/Profile-x86_64h/ContinuousSyncMode/online-merging.c -av || break; done```rdar://64956774
[profile] Support counter relocation at runtimeThis is an alternative to the continous mode that was implemented inD68351. This mode relies on padding and the ability to mmap a file overthe exist
[profile] Support counter relocation at runtimeThis is an alternative to the continous mode that was implemented inD68351. This mode relies on padding and the ability to mmap a file overthe existing mapping which is generally only available on POSIX systemsand isn't suitable for other platforms.This change instead introduces the ability to relocate counters atruntime using a level of indirection. On every counter access, we add abias to the counter address. This bias is stored in a symbol that'sprovided by the profile runtime and is initially set to zero, meaning norelocation. The runtime can mmap the profile into memory at abitrarylocation, and set bias to the offset between the original and the newcounter location, at which point every subsequent counter access will beto the new location, which allows updating profile directly akin to thecontinous mode.The advantage of this implementation is that doesn't require any specialOS support. The disadvantage is the extra overhead due to additionalinstructions required for each counter access (overhead both in terms ofbinary size and performance) plus duplication of counters (i.e. one copyin the binary itself and another copy that's mmapped).Differential Revision: https://reviews.llvm.org/D69740
[profile] Support online merging with continuous sync modeMake it possible to use online profile merging ("%m" mode) withcontinuous sync ("%c" mode).To implement this, the merged profile is lock
[profile] Support online merging with continuous sync modeMake it possible to use online profile merging ("%m" mode) withcontinuous sync ("%c" mode).To implement this, the merged profile is locked in the runtimeinitialization step and either a) filled out for the first time or b)checked for compatibility. Then, the profile can simply be mmap()'d withMAP_SHARED set. With the mmap() in place, counter updates from everyprocess which uses an image are mapped onto the same set of physicalpages assigned by the filesystem cache. After the mmap() is set up, theprofile is unlocked.Differential Revision: https://reviews.llvm.org/D69586
[profile] Add a mode to continuously sync counter updates to a fileAdd support for continuously syncing profile counter updates to a file.The motivation for this is that programs do not always ex
[profile] Add a mode to continuously sync counter updates to a fileAdd support for continuously syncing profile counter updates to a file.The motivation for this is that programs do not always exit cleanly. OniOS, for example, programs are usually killed via a signal from the OS.Running atexit() handlers after catching a signal is unreliable, so somemethod for progressively writing out profile data is necessary.The approach taken here is to mmap() the `__llvm_prf_cnts` section ontoa raw profile. To do this, the linker must page-align the counter anddata sections, and the runtime must ensure that counters are mapped to apage-aligned offset within a raw profile.Continuous mode is (for the moment) incompatible with the online mergingmode. This limitation is lifted in https://reviews.llvm.org/D69586.Continuous mode is also (for the moment) incompatible with valueprofiling, as I'm not sure whether there is interest in this and theimplementation 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 modemay "just work" without modification on Linux and some UNIX-likes. AIUIthe default value for the GNU linker's `--section-alignment` flag is setto the page size on many systems. This appears to be true for LLD aswell, as its `no_nmagic` option is on by default. Continuous mode willnot "just work" on Fuchsia or Windows, as it's not possible to mmap() asection on these platforms. There is a proposal to add a layer ofindirection to the profile instrumentation to support these platforms.rdar://54210980Differential Revision: https://reviews.llvm.org/D68351