177 Commits

Author SHA1 Message Date
gbMattN
2b1ebef8b8
Fixed small memory leak in libprofile (#141739)
Inside `getCurFilename`, there is this code snippit
```
if (!lprofCurFilename.FilenamePat || !lprofCurFilename.FilenamePat[0])
    return 0;
```
If this is true, we return `"\0"`, but would leak the memory in
`FilenameBuf`.
This pull request adds a free before then to properly free the memory.
There was already a check that we allocated memory, so there is no need
to worry about freeing unallocated memory.
2025-05-28 14:51:50 +01:00
Qinkun Bao
45b9e24b1e
Fix some small typos in compiler-rt. NFC (#133388) 2025-03-28 15:51:13 -04:00
Ethan Luis McDonough
80d5185bd4
[PGO][Offload] Don't define GPU entrypoint on Darwin (#132966)
This PR partially reverts 83e180c and instead opts to not define the GPU entry
point on Darwin platforms. Marking `__llvm_write_custom_profile` as used
was causing issues on embedded platforms.
2025-03-25 23:28:01 -05:00
Wael Yehia
e202ff45df [profile] Implement a non-mmap path when reading profile files from a non-local filesystem (#131177)
On AIX, when accessing mmap'ed memory associated to a file on NFS, a
SIGBUS might be raised at random.
The problem is still in open state with the OS team.

This PR teaches the profile runtime, under certain conditions, to avoid
the mmap when reading the profile file during online merging.
This PR has no effect on any platform other than AIX because I'm not
aware of this problem on other platforms.
Other platforms can easily opt-in to this functionality in the future.

The logic in function `is_local_filesystem` was copied from
[llvm/lib/Support/Unix/Path.inc](f388ca3d9d/llvm/lib/Support/Unix/Path.inc (L515))
(https://reviews.llvm.org/D58801), because it seems that the
compiler-rt/profile cannot reuse code from llvm except through
`InstrProfData.inc`.

Thanks to @hubert-reinterpretcast for substantial feedback downstream.

---------

Co-authored-by: Wael Yehia <wyehia@ca.ibm.com>
Co-authored-by: Hubert Tong <hubert.reinterpretcast@gmail.com>
2025-03-20 17:34:34 +00:00
Ethan Luis McDonough
c50d39f073
[PGO][Offload] Allow PGO flags to be used on GPU targets (#94268)
This pull request is the third part of an ongoing effort to extends PGO
instrumentation to GPU device code and depends on
https://github.com/llvm/llvm-project/pull/93365. This PR makes the
following changes:

- Allows PGO flags to be supplied to GPU targets
- Pulls version global from device
- Modifies `__llvm_write_custom_profile` and `lprofWriteDataImpl` to
allow the PGO version to be overridden
2025-03-19 19:01:38 -05:00
Arthur Eubanks
32476b9934 Revert " [profile] Implement a non-mmap path when reading profile files from a non-local filesystem (#131177)"
This reverts commit 14c95e0c8b25f6deba47cd279c5dcdeef3870159.

Test fails on mac, e.g. https://green.lab.llvm.org/job/llvm.org/job/clang-stage1-RA/3899/testReport/junit/Profile-x86_64/Profile-x86_64/instrprof_no_mmap_during_merging_c/
2025-03-19 20:31:32 +00:00
Wael Yehia
14c95e0c8b
[profile] Implement a non-mmap path when reading profile files from a non-local filesystem (#131177)
On AIX, when accessing mmap'ed memory associated to a file on NFS, a
SIGBUS might be raised at random.
The problem is still in open state with the OS team.

This PR teaches the profile runtime, under certain conditions, to avoid
the mmap when reading the profile file during online merging.
This PR has no effect on any platform other than AIX because I'm not
aware of this problem on other platforms.
Other platforms can easily opt-in to this functionality in the future.

The logic in function `is_local_filesystem` was copied from
[llvm/lib/Support/Unix/Path.inc](f388ca3d9d/llvm/lib/Support/Unix/Path.inc (L515))
(https://reviews.llvm.org/D58801), because it seems that the
compiler-rt/profile cannot reuse code from llvm except through
`InstrProfData.inc`.

Thanks to @hubert-reinterpretcast for substantial feedback downstream.

---------

Co-authored-by: Wael Yehia <wyehia@ca.ibm.com>
Co-authored-by: Hubert Tong <hubert.reinterpretcast@gmail.com>
2025-03-18 14:13:15 -04:00
Ellis Hoag
2044dd07da
[InstrProf] Remove -forder-file-instrumentation (#130192) 2025-03-13 08:28:16 -07:00
Ethan Luis McDonough
83e180cb70
[Clang][PGO] Fix profile function visibility bug (#127257)
This pull request fixes an issue that was introduced in #93365.
`__llvm_write_custom_profile` visibility was causing issues on Darwin.
This function needs to be publicly accessible in order to be accessed by
libomptarget, so this pull request makes `__llvm_write_custom_profile`
an explicitly exported symbol on Darwin. Tested on M3 and X86 macs.
2025-02-17 13:46:37 -06:00
Ethan Luis McDonough
9e5c136d5a
[PGO][Offload] Profile profraw generation for GPU instrumentation #76587 (#93365)
This pull request is the second part of an ongoing effort to extends PGO
instrumentation to GPU device code and depends on #76587. This PR makes
the following changes:

- Introduces `__llvm_write_custom_profile` to PGO compiler-rt library.
This is an external function that can be used to write profiles with
custom data to target-specific files.
- Adds `__llvm_write_custom_profile` as weak symbol to libomptarget so
that it can write the collected data to a profraw file.
- Adds `PGODump` debug flag and only displays dump when the
aforementioned flag is set
2025-02-11 23:30:54 -06:00
Sinkevich Artem
da053415d2
[profile] Add %b LLVM_PROFILE_FILE option for binary ID (#123963)
Add support for expanding `%b` in `LLVM_PROFILE_FILE` to the binary ID
(build ID). It can be used with `%m` to avoid its signature collisions.

This is supported on all platforms where writing binary IDs into
profiles is implemented, as the `__llvm_write_binary_ids` function is
used.

Fixes #51560.
2025-02-06 16:05:10 -05:00
Wael Yehia
f0083c6af7 [AIX][PGO] Enable PGO continuous mode support on AIX (#110196) 2024-09-27 22:34:05 +00:00
Rainer Orth
70a19adbc6
[profile] Change __llvm_profile_counter_bias etc. types to match llvm (#102747)
As detailed in Issue #101667, two `profile` tests `FAIL` on 32-bit
SPARC, both Linux/sparc64 and Solaris/sparcv9 (where the tests work when
enabled):
```
  Profile-sparc :: ContinuousSyncMode/runtime-counter-relocation.c
  Profile-sparc :: ContinuousSyncMode/set-file-object.c
```
The Solaris linker provides the crucial clue as to what's wrong:
```
ld: warning: symbol '__llvm_profile_counter_bias' has differing sizes:
	(file runtime-counter-relocation-17ff25.o value=0x8; file libclang_rt.profile-sparc.a(InstrProfilingFile.c.o) value=0x4);
	runtime-counter-relocation-17ff25.o definition taken
```
In fact, the types in `llvm` and `compiler-rt` differ:
- `__llvm_profile_counter_bias`/`INSTR_PROF_PROFILE_COUNTER_BIAS_VAR` is
created in `llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp`
(`InstrLowerer::getCounterAddress`) as `int64_t`, while
`compiler-rt/lib/profile/InstrProfilingFile.c` uses `intptr_t`. While
this doesn't matter in the 64-bit case, the type sizes differ for
32-bit.
- `__llvm_profile_bitmap_bias`/`INSTR_PROF_PROFILE_BITMAP_BIAS_VAR` has
the same issue: created in `InstrProfiling.cpp`
(`InstrLowerer::getBitmapAddress`) as `int64_t`, while
`InstrProfilingFile.c` again uses `intptr_t`.

This patch changes the `compiler-rt` types to match `llvm`. At the same
time, the affected testcases are enabled on Solaris, too, where they now
just `PASS`.

Tested on `sparc64-unknown-linux-gnu`, `sparcv9-sun-solaris2.11`,
`x86_64-pc-linux-gnu`, and `amd64-pc-solaris2.11.
2024-09-03 14:29:49 +02:00
Wael Yehia
2abed78b4d
[AIX][PGO] Handle atexit functions when dlclose'ing shared libraries (#102940)
Problem:
On AIX, functions registered by atexit in a shared library are not run
when the library is dlclosed, but instead run (and fail because the
function pointer is no longer valid) during main program exit.

The profile-rt registers some functions with atexit:

 1. writeFileWithoutReturn that writes out the profile file
 2. llvm_delete_reset_function_list that does some cleanup in the gcov 
    instrumentation library (not sure)

And so right now, we get an "Illegal instruction (core dumped)" when an
instrumented shared object is dlopen'ed and dlclosed.

Solution:
  When a shared library is dlclose'd, destructors from the library are
  called. So create a destructor function that iterates over all known
  functions that profile-rt registers with atexit, and unregister the ones
  that have been registered and execute them.

Scenarios tested:
(0) gcov dlopen/dlclose                                       (AIX/gcov-dlopen-dlclose.test)
(1) multiple dlopen/dlclose of the same lib and multiple libs (instrprof-dlopen-dlclose.test)
(2) dlopen but no dlclose                                     (exists: Posix/instrprof-dlopen.test)
(3) a simple fork testcase with dlopen/dlclose                (instrprof-dlopen-dlclose.test)
(4) dlopen/dlclose by multiple threads.                       (instrprof-dlopen-dlclose.test)
(5) regular dynamic-linking of instrumented shared libs       (exists: AIX/shared-bexpall-pgo.c)
(6) a simple fork testcase produces correct profile           (instrprof-fork.c)


---------

Co-authored-by: Hubert Tong <hstong@ca.ibm.com>
2024-08-27 14:30:32 -04:00
NAKAMURA Takumi
20d723e626 Fix for #96126, add BitmapBiasAddr to definitions for unsupported targets. 2024-07-31 14:59:31 +09:00
NAKAMURA Takumi
d2f77eb8ec
[MC/DC][Coverage] Introduce "Bitmap Bias" for continuous mode (#96126)
`counter_bias` is incompatible to Bitmap. The distance between Counters
and Bitmap is different between on-memory sections and profraw image.

Reference to `__llvm_profile_bitmap_bias` is generated only if
`-fcoverge-mcdc` `-runtime-counter-relocation` are specified. The
current implementation rejected their options.

```
Runtime counter relocation is presently not supported for MC/DC bitmaps
```
2024-07-31 10:14:12 +09:00
NAKAMURA Takumi
8426586f87 Revert "Reformat", due to wrong version of clang-format.
This reverts commit f4ce3448be9c47c61755197173a6a9e9b612dff8.
2024-06-26 15:15:50 +09:00
NAKAMURA Takumi
2fe8498654 mmapForContinuousMode: Redo #95702: Align Linux's impl to __APPLE__'s a little.
I've made this small cosmetic changes,
`s/CountersOffsetInBiasMode/FileOffsetToCounters/`
2024-06-21 09:38:25 +09:00
NAKAMURA Takumi
e908320a03 Revert "mmapForContinuousMode: Align Linux's impl to __APPLE__'s more. NFC. (#95702)"
This reverts commit 7cf84d3b0bc5eda3a907dfd026d51a17e28114a3.
(llvmorg-19-init-14939-g7cf84d3b0bc5)

This has my wrong assumptions possibly. This was failing fuchsia.
2024-06-21 08:00:22 +09:00
NAKAMURA Takumi
7cf84d3b0b
mmapForContinuousMode: Align Linux's impl to __APPLE__'s more. NFC. (#95702) 2024-06-20 16:50:54 +09:00
NAKAMURA Takumi
d442bf0435 mmapForContinuousMode: Calculate FileOffsetToBitmap from FileOffsetToCounters. NFC. 2024-06-16 21:57:31 +09:00
NAKAMURA Takumi
f4ce3448be Reformat 2024-06-16 21:57:31 +09:00
Mingming Liu
16e74fd489
Reland "[TypeProf][InstrPGO] Introduce raw and instr profile format change for type profiling." (#82711)
New change on top of [reviewed
patch](https://github.com/llvm/llvm-project/pull/81691) are [in commits
after this
one](d0757f46b3).
Previous commits are restored from the remote branch with timestamps.

1. Fix build breakage for non-ELF platforms, by defining the missing
functions {`__llvm_profile_begin_vtables`, `__llvm_profile_end_vtables`,
`__llvm_profile_begin_vtabnames `, `__llvm_profile_end_vtabnames`}
everywhere.
* Tested on mac laptop (for darwins) and Windows. Specifically,
functions in `InstrProfilingPlatformWindows.c` returns `NULL` to make it
more explicit that type prof isn't supported; see comments for the
reason.
* For the rest (AIX, other), mostly follow existing examples (like this
[one](f95b2f1acf))
   
2. Rename `__llvm_prf_vtabnames` -> `__llvm_prf_vns` for shorter section
name, and make returned pointers
[const](a825d2a4ec (diff-4de780ce726d76b7abc9d3353aef95013e7b21e7bda01be8940cc6574fb0b5ffR120-R121))

**Original Description**

* Raw profile format
- Header: records the byte size of compressed vtable names, and the
number of profiled vtable entries (call it `VTableProfData`). Header
also records padded bytes of each section.
- Payload: adds a section for compressed vtable names, and a section to
store `VTableProfData`. Both sections are padded so the size is a
multiple of 8.
* Indexed profile format
  - Header: records the byte offset of compressed vtable names.
- Payload: adds a section to store compressed vtable names. This section
is used by `llvm-profdata` to show the list of vtables profiled for an
instrumented site.
  
[The originally reviewed
patch](https://github.com/llvm/llvm-project/pull/66825) will have
profile reader/write change and llvm-profdata change.
- To ensure this PR has all the necessary profile format change along
with profile version bump, created a copy of the originally reviewed
patch in https://github.com/llvm/llvm-project/pull/80761. The copy
doesn't have profile format change, but it has the set of tests which
covers type profile generation, profile read and profile merge. Tests
pass there.
  
rfc in
https://discourse.llvm.org/t/rfc-dynamic-type-profiling-and-optimizations-in-llvm/74600

---------

Co-authored-by: modiking <modiking213@gmail.com>
2024-02-27 11:07:40 -08:00
David CARLIER
0a255fcf4a
[compiler-rt][profile] Fix InstrProfilingFile possible resource leak. (#81363)
close #79708
2024-02-10 19:14:28 +00:00
AtariDreams
3c20e25b0c
[NFC] Size and element numbers are often swapped when calling calloc (#79081)
gcc-14 will now throw a warning if size and elements are swapped.
2024-01-23 11:13:55 -08:00
Alexandre Ganea
6f8b633d0b [compiler-rt] Silence warnings when building with Clang ToT
Fixes several warnings such as:
```
C:\git\llvm-project\compiler-rt\lib\profile\InstrProfilingFile.c(760,18): warning: cast from 'const char *' to 'void *' drops const qualifier [-Wcast-qual]
  760 |     free((void *)lprofCurFilename.FilenamePat);
      |                  ^
3 warnings generated.
```
2024-01-17 07:23:56 -05:00
Zequan Wu
ace26b380f
[Profile] Disable continuous mode when reset to default.profraw due to malformed LLVM_PROFILE_FILE. (#74879)
When LLVM_PROFILE_FILE is set incorrectly (e.g. multiple %c) and it
falls back to use `default.profraw` name, but continuous mode is still
set. This might cause signal bus in the following scenario.

LLVM_PROFILE_FILE is set incorrectly (with "%c%c") for process A and B.
Suppose A starts first and falls back to use `default.profraw` and
mmaped its file content to memory. Later B starts and also falls back to
use `default.profraw`, but it will truncate the file because online
merging is disable when reseting to `default.profraw`. When A tries to
update counter via mmaped memory, signal bus will occur.

This fixes it by disabling continuous mode when reset to
default.profraw.
2023-12-11 10:13:08 -05:00
Alan Phipps
f95b2f1acf Reland "[InstrProf][compiler-rt] Enable MC/DC Support in LLVM Source-based Code Coverage (1/3)"
Part 1 of 3. This includes the LLVM back-end processing and profile
reading/writing components. compiler-rt changes are included.

Differential Revision: https://reviews.llvm.org/D138846
2023-10-30 11:15:02 -05:00
serge-sans-paille
97b989b274
[compiler-rt] During profile flushing, setup SIGKILL mask earlier (#68622)
In multi threaded application, it is possible for one thread to
terminate the program while another is flushing profile information. We
setup a signal mask to delay SIGKILL so that we can safely flush the
profile.

This patch setups the mask earlier: it reduces the window during which a
SIGKILL can end the computation prematurely.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1850940, where a
profiled firefox was encountering several:

LLVM Profile Error: Failed to write file "default_*.profraw": Broken
pipe

Co-authored-by: serge-sans-paille <sguelton@mozilla.com>
2023-10-10 19:19:23 +00:00
Hans Wennborg
53a2923bf6 Revert "[InstrProf][compiler-rt] Enable MC/DC Support in LLVM Source-based Code Coverage (1/3)"
This seems to cause Clang to crash, see comments on the code review. Reverting
until the problem can be investigated.

> Part 1 of 3. This includes the LLVM back-end processing and profile
> reading/writing components. compiler-rt changes are included.
>
> Differential Revision: https://reviews.llvm.org/D138846

This reverts commit a50486fd736ab2fe03fcacaf8b98876db77217a7.
2023-09-21 12:20:24 +02:00
Alan Phipps
a50486fd73 [InstrProf][compiler-rt] Enable MC/DC Support in LLVM Source-based Code Coverage (1/3)
Part 1 of 3. This includes the LLVM back-end processing and profile
reading/writing components. compiler-rt changes are included.

Differential Revision: https://reviews.llvm.org/D138846
2023-09-19 17:07:23 -05:00
Zequan Wu
8cee8183d4 [Profile] Fix 98dec28458172091893e46040d7b5ab745a44b82 2023-08-04 14:24:45 -04:00
Zequan Wu
98dec28458 Reland [Profile] Remove duplicate file locks when enabled continuous mode and online merging.
This reverts commit 4b08be77c98a4c15b8b3d634fab4ffc24bf4ef38.

Add file lock when doing online merging only and associated test.
2023-08-04 14:11:22 -04:00
Zequan Wu
4b08be77c9 Revert "[Profile] Remove duplicate file locks when enabled continuous mode and online merging."
This reverts commit 985486dca48bffd9e991d9f5ac32e1d109ae000f.

This seems to cause malformed profdata: crbug.com/1469456
2023-08-03 13:09:33 -04:00
Jie Fu
51c8cacafd [InstrProf] Ignore -Wcast-qual after D153911 to fix build failure (NFC)
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:46:60: error: cast from 'const char *' to 'struct __llvm_profile_header *' drops const qualifier [-Werror,-Wcast-qual]
  __llvm_profile_header *Header = (__llvm_profile_header *)ProfileData;
                                                           ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:49:30: error: cast from 'const char *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
      (__llvm_profile_data *)(ProfileData + sizeof(__llvm_profile_header) +
                             ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:77:41: error: cast from 'const struct __llvm_profile_data *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
       DstData = (__llvm_profile_data *)__llvm_profile_begin_data();
                                        ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:109:60: error: cast from 'const char *' to 'struct __llvm_profile_header *' drops const qualifier [-Werror,-Wcast-qual]
  __llvm_profile_header *Header = (__llvm_profile_header *)ProfileData;
                                                           ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:116:30: error: cast from 'const char *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
      (__llvm_profile_data *)(ProfileData + sizeof(__llvm_profile_header) +
                             ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:129:40: error: cast from 'const struct __llvm_profile_data *' to 'struct __llvm_profile_data *' drops const qualifier [-Werror,-Wcast-qual]
      DstData = (__llvm_profile_data *)__llvm_profile_begin_data(),
                                       ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:179:34: error: cast from 'const char *' to 'struct ValueProfData *' drops const qualifier [-Werror,-Wcast-qual]
    VPMergeHook((ValueProfData *)SrcValueProfData, DstData);
                                 ^
/data/llvm-project/compiler-rt/lib/profile/InstrProfilingMerge.c:181:46: error: cast from 'const char *' to 'struct ValueProfData *' drops const qualifier [-Werror,-Wcast-qual]
        SrcValueProfData + ((ValueProfData *)SrcValueProfData)->TotalSize;
                                             ^
...
2023-07-19 18:00:05 +08:00
Zequan Wu
985486dca4 [Profile] Remove duplicate file locks when enabled continuous mode and online merging.
In `initializeProfileForContinuousMode`, we have already locked the profile file when merging is enabled, so there's no need to lock the same file second time in `openFileForMerging`.

On Linux/Darwin, the locking the same file twice doesn't cause any problem. But on Windows, it causes the problem to hang forever.

With this minor fix, continuous mode seems working with online merging on Windows.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D154748
2023-07-10 11:01:28 -04:00
Alex Brachet
a672b7a7d7 [InstrProf] Make __llvm_profile_counter_bias_default hidden
This symbol shouldn't have default visibility.

Differential Revision: https://reviews.llvm.org/D135346
2022-10-06 06:16:22 +00:00
Aaron Ballman
bdbfaf0ca7 Giving a lot more functions prototypes; NFC
This should address https://lab.llvm.org/buildbot/#/builders/37/builds/12315
and speculatively fix other similar diagnostics.
2022-04-09 17:25:10 -04:00
Ellis Hoag
9c35303981 [InstrProf][NFC] Fix warning by removing typecast
This fixes a warning about comparing mismatched types. Since `mmap()` already returns a `void *` use that as the pointer type for comparison.

Reviewed By: kyulee, zequanwu

Differential Revision: https://reviews.llvm.org/D120945
2022-03-04 10:48:25 -08:00
Ellis Hoag
f21473752b [InstrProf][NFC] Do not assume size of counter type
Existing code tended to assume that counters had type `uint64_t` and
computed size from the number of counters. Fix this code to directly
compute the counters size in number of bytes where possible. When the
number of counters is needed, use `__llvm_profile_counter_entry_size()`
or `getCounterTypeSize()`. In a later diff these functions will depend
on the profile mode.

Change the meaning of `DataSize` and `CountersSize` to make them more clear.
* `DataSize` (`CountersSize`) - the size of the data (counter) section in bytes.
* `NumData` (`NumCounters`) - the number of data (counter) entries.

Reviewed By: kyulee

Differential Revision: https://reviews.llvm.org/D116179
2022-01-14 11:29:11 -08:00
Zequan Wu
4e8efff53e [Profile] Add missing fflush in __llvm_profile_set_file_object 2021-10-05 15:41:51 -07:00
Zequan Wu
ab694cd845 [Profile] Add a warning when lock file failed in __llvm_profile_set_file_object with continuous mode 2021-10-01 14:37:09 -07:00
Zequan Wu
1b05245119 [Profile] Support __llvm_profile_set_file_object in continuous mode.
Replace D107203, because __llvm_profile_set_file_object is usually used when the
process doesn't have permission to open/create file. That patch trying to copy
from old profile to new profile contradicts with the usage.

Differential Revision: https://reviews.llvm.org/D108242
2021-08-27 13:06:46 -07:00
Petr Hosek
8111f2f7ee [profile] Update counter offset to account for binary ids
In the raw profile, binary ids immediately follow the header so when
computing counters offset we need to account for the new section.

Differential Revision: https://reviews.llvm.org/D108608
2021-08-23 21:43:30 -07:00
Nikita Popov
4cfb047d6a [profile] Don't use pragma comment linker on mingw
At least when compiling with gcc, this is not supported and will
result in errors when linking against the profiler runtime. Only
use the pragma comment linker based code with MSVC, but not with
a mingw toolchain. This also undoes D107620, which shouldn't be
relevant anymore.

Differential Revision: https://reviews.llvm.org/D108095
2021-08-16 18:20:32 +02:00
Zequan Wu
2129c4a861 Fix Windows bots failure caused by 8c4208d5c1671d1b44eaf87e8f876b7d635f5114 2021-08-06 15:03:00 -07:00
Zequan Wu
8c4208d5c1 [Profile][NFC] Clean up initializeProfileForContinuousMode
Merge two versions of `initializeProfileForContinuousMode` function into one.

Differential Revision: https://reviews.llvm.org/D107591
2021-08-06 14:00:36 -07:00
Vedant Kumar
3b0a9e7b39 [profile] Move assertIsZero to InstrProfilingUtil.c
... and rename it to 'warnIfNonZero' to better-reflect what it actually
does.

The goal is to minimize the amount of logic that's conditionally
compiled under '#if __APPLE__'.
2021-08-02 15:25:09 -07:00
Arthur Eubanks
ef2627e1fa [profile] Add underscore to /alternatename for Win/x86
/alternatename should use the mangled name. On x86 we need an extra
underscore.

Copied from sanitizer_win_defs.h

Fixes https://crbug.com/1233589.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D107000
2021-07-28 14:58:35 -07:00
Petr Hosek
ff427909ca [NFC][profile] Move writeMMappedFile to ELF ifdef block
This avoids the compiler warning on Darwin where that function is unused.
2021-07-19 23:13:13 -07:00