16 Commits

Author SHA1 Message Date
Aiden Grossman
fa90a0aa0e [llvm-exegesis] Improve error handling for shm_open calls
This patch adds error handling for shm_open failures in one case where
they were not handled before and also makes an error handler in another
case report the value of errno for diagnosis.
2024-03-27 13:25:44 -07:00
Aiden Grossman
50e6218132 Reland "[llvm-exegesis] Add thread IDs to subprocess memory names (#84451)"
This reverts commit 1fe9c417a0bf143f9bb9f9e1fbf7b20f44196883.

This relands commit 6bbe8a296ee91754d423c59c35727eaa624f7140.

This was causing build failures on one of the ARMv8 builders. Still not
completely sure why, but relanding it to see if the failure pops up
again. If it does, the plan is to fix forward by disabling tests on ARM
temporarily as llvm-exegesis does not currently use SubprocessMemory
on ARM.
2024-03-22 11:51:09 -07:00
Aiden Grossman
1fe9c417a0 Revert "Reland "[llvm-exegesis] Add thread IDs to subprocess memory names (#84451)""
This reverts commit 8003f553a01a9a2a7eb09fe07e88f1ba9ee7d3a7.

This (and/or a related commit) was causing build failures on one of the
buildbots that needs more investigation. More information is available
at https://lab.llvm.org/buildbot/#/builders/178/builds/7015.
2024-03-13 00:49:23 -07:00
Aiden Grossman
5a4e2210bd Revert "[llvm-exegesis] Use LLVM Support to get thread ID"
This reverts commit 1c3b15e9f5bc671e40bcf5d3475f5425466754ce.

This (and/or) a related patch was causing build failures on one of the
buildbots. More information is available at
https://lab.llvm.org/buildbot/#/builders/178/builds/7015.
2024-03-13 00:48:46 -07:00
Aiden Grossman
1c3b15e9f5 [llvm-exegesis] Use LLVM Support to get thread ID
This patch switches from manually using the Linux syscall to get the
current thread ID to using the relevant LLVM Support libraries that
abstract over the low level system details.
2024-03-12 16:55:01 -07:00
Aiden Grossman
8003f553a0 Reland "[llvm-exegesis] Add thread IDs to subprocess memory names (#84451)"
This reverts commit aefad27096bba513f06162fac2763089578f3de4.

This relands commit 6bbe8a296ee91754d423c59c35727eaa624f7140.

This patch was casuing build failures on non-Linux platforms due to the
default implementations for the functions not being updated. This ended
up causing out-of-line definition errors. Fixed for the relanding.
2024-03-12 16:35:05 -07:00
Florian Hahn
aefad27096
Revert "[llvm-exegesis] Add thread IDs to subprocess memory names (#84451)"
This reverts commit 6bbe8a296ee91754d423c59c35727eaa624f7140.

This breaks building LLVM on macOS, failing with

    llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp:146:33: error: out-of-line definition of 'setupAuxiliaryMemoryInSubprocess' does not match any declaration in 'llvm::exegesis::SubprocessMemory'
    Expected<int> SubprocessMemory::setupAuxiliaryMemoryInSubprocess(
2024-03-12 08:52:29 +00:00
Aiden Grossman
6bbe8a296e
[llvm-exegesis] Add thread IDs to subprocess memory names (#84451)
This patch adds the thread ID to the subprocess memory shared memory
names. This avoids conflicts for downstream consumers that might want to
consume llvm-exegesis across multiple threads, which would otherwise run
into conflicts due to the same PID running multiple instances.
2024-03-12 01:24:21 -07:00
Christopher Di Bella
e1b88a9794 [llvm-exegesis][NFC] imports <cerrno>
`SubprocessMemory.cpp` depends on `errno` and was likely getting it via
a transitive include, but this prevents building with modules.
2023-07-09 11:04:56 -07:00
Aiden Grossman
71cbc62a24 [llvm-exegesis] Disable SubprocessMemory class on Android
Having the SubprocessMemory class available on Android was causing build
failures in downstream builds as Android doesn't implement the SystemV
IPC specification that supplies shm_open and other functions that the
class relies on. This patch simply makes it unavailable on Android using
preprocessor directives.
2023-07-06 19:12:28 -07:00
Aiden Grossman
1048b7f8e7 [llvm-exegesis] Make sure auxiliary memory is unlinked after usage
Currently the shm_unlink is never called on the auxiliary memory shared
memory, so it stays around after running llvm-exegesis (including
running the llvm-exegesis tests). This patch adds the auxiliary memory
shared memory name to the SharedMemoryNames list so that it gets
unlinked when the destructor of SubprocessMemory is called.
2023-06-30 12:43:20 -07:00
Aiden Grossman
5a63b2b304 [llvm-exegesis] Introduce SubprocessMemory Utility Class
This patch introduces the SubprocessMemory class to llvm-exegesis. This
class contains several utilities that are needed for managing memory to
set up an execution environment for memory annotations.

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D151022
2023-06-26 18:22:04 +00:00
Aiden Grossman
d40dd6be00 Revert "[llvm-exegesis] Introduce SubprocessMemory Utility Class"
This reverts commit 0b6b400b98b921279fc08c63a2a68ebfcb12a3e2.

The sporadic test failures were fixed during this land, but I forgot to
fix the build failures on certain platforms (seems to mostly be
AArch64/PPC) that result from them not being able to find the symbols
for shm_open and shm_unlink.
2023-06-26 03:15:43 +00:00
Aiden Grossman
0b6b400b98 [llvm-exegesis] Introduce SubprocessMemory Utility Class
This patch introduces the SubprocessMemory class to llvm-exegesis. This
class contains several utilities that are needed for managing memory to
set up an execution environment for memory annotations.

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D151022
2023-06-26 02:36:40 +00:00
Aiden Grossman
edc9e2c267 Revert "[llvm-exegesis] Introduce SubprocessMemory Utility Class"
This reverts commit 1b9b78fd481a13b54afaf4804ee4ad18fcf006fd.

There are spurious test failures on the ml-* bots and some of the ARM
builders are complaining about shm_open being missing. Pulling this
commit so that I can investigate after I sleep.
2023-06-21 08:43:52 +00:00
Aiden Grossman
1b9b78fd48 [llvm-exegesis] Introduce SubprocessMemory Utility Class
This patch introduces the SubprocessMemory class to llvm-exegesis. This
class contains several utilities that are needed for managing memory to
set up an execution environment for memory annotations.

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D151022
2023-06-21 08:15:03 +00:00