[llvm] [llvm-exegesis] Add thread IDs to subprocess memory names (PR #84451)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 12 01:19:49 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff dd36138e9c23c462ce5379a3d83530fb4ebec9e7 a1bf3bb1bdc3671406da9c62d978ea6285f06b5d -- llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp llvm/tools/llvm-exegesis/lib/SubprocessMemory.h llvm/unittests/tools/llvm-exegesis/X86/SubprocessMemoryTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp b/llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp
index 50c00d6f8b..11ad72a914 100644
--- a/llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp
+++ b/llvm/tools/llvm-exegesis/lib/SubprocessMemory.cpp
@@ -58,8 +58,8 @@ Error SubprocessMemory::addMemoryDefinition(
pid_t ProcessPID) {
SharedMemoryNames.reserve(MemoryDefinitions.size());
for (auto &[Name, MemVal] : MemoryDefinitions) {
- std::string SharedMemoryName = formatv(
- "/{0}t{1}memdef{2}", ProcessPID, getCurrentTID(), MemVal.Index);
+ std::string SharedMemoryName =
+ formatv("/{0}t{1}memdef{2}", ProcessPID, getCurrentTID(), MemVal.Index);
SharedMemoryNames.push_back(SharedMemoryName);
int SharedMemoryFD =
shm_open(SharedMemoryName.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
@@ -109,7 +109,8 @@ Expected<int> SubprocessMemory::setupAuxiliaryMemoryInSubprocess(
return make_error<Failure>("Mapping auxiliary memory failed");
AuxiliaryMemoryMapping[0] = CounterFileDescriptor;
for (auto &[Name, MemVal] : MemoryDefinitions) {
- std::string MemoryValueName = formatv("/{0}t{1}memdef{2}", ParentPID, ParentTID, MemVal.Index);
+ std::string MemoryValueName =
+ formatv("/{0}t{1}memdef{2}", ParentPID, ParentTID, MemVal.Index);
AuxiliaryMemoryMapping[AuxiliaryMemoryOffset + MemVal.Index] =
shm_open(MemoryValueName.c_str(), O_RDWR, S_IRUSR | S_IWUSR);
if (AuxiliaryMemoryMapping[AuxiliaryMemoryOffset + MemVal.Index] == -1)
``````````
</details>
https://github.com/llvm/llvm-project/pull/84451
More information about the llvm-commits
mailing list