Skip to content

[MemProf] Change histogram storage from uint64_t to uint16_t #147854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

snehasish
Copy link
Contributor

@snehasish snehasish commented Jul 9, 2025

Change memory access histogram storage from uint64_t to uint16_t to reduce profile size on disk. This change updates the raw profile format to v5. Also add a histogram test in compiler-rt since we didn't have one before. With this change the histogram memprof raw for the basic test reduces from 75KB -> 20KB.

Copy link
Contributor Author

snehasish commented Jul 9, 2025

Copy link

github-actions bot commented Jul 9, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@snehasish snehasish force-pushed the users/snehasish/07-08-draft_changes_to_trim_the_histogram_raw_profile_format branch from 38dfa22 to 3371ae2 Compare July 12, 2025 21:26
@snehasish snehasish marked this pull request as ready for review July 12, 2025 22:12
@llvmbot llvmbot added compiler-rt PGO Profile Guided Optimizations labels Jul 12, 2025
@snehasish snehasish changed the title Draft changes to trim the histogram raw profile format. [MemProf] Change histogram storage from uint64_t to uint8_t Jul 12, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 12, 2025

@llvm/pr-subscribers-pgo

Author: Snehasish Kumar (snehasish)

Changes

Patch is 20.05 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/147854.diff

26 Files Affected:

  • (modified) compiler-rt/include/profile/MemProfData.inc (+7-3)
  • (modified) compiler-rt/lib/memprof/memprof_allocator.cpp (+5-4)
  • (modified) compiler-rt/lib/memprof/memprof_rawprofile.cpp (+3-2)
  • (added) compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp (+32)
  • (modified) llvm/include/llvm/ProfileData/MemProfData.inc (+7-3)
  • (modified) llvm/lib/ProfileData/MemProfReader.cpp (+86)
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofraw ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/buildid.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/buildid.memprofraw ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofraw ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe ()
  • (modified) llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw ()
  • (modified) llvm/test/tools/llvm-profdata/memprof-basic-histogram.test (+2-2)
  • (modified) llvm/test/tools/llvm-profdata/memprof-basic.test (+2-2)
  • (modified) llvm/test/tools/llvm-profdata/memprof-inline.test (+1-1)
  • (modified) llvm/test/tools/llvm-profdata/memprof-multi.test (+1-1)
  • (modified) llvm/test/tools/llvm-profdata/memprof-padding-histogram.test (+2-2)
  • (modified) llvm/test/tools/llvm-profdata/memprof-pic.test (+2-2)
diff --git a/compiler-rt/include/profile/MemProfData.inc b/compiler-rt/include/profile/MemProfData.inc
index 3f785bd23fce3..4a43f72c2405d 100644
--- a/compiler-rt/include/profile/MemProfData.inc
+++ b/compiler-rt/include/profile/MemProfData.inc
@@ -33,11 +33,11 @@
    (uint64_t)'o' << 24 | (uint64_t)'f' << 16 | (uint64_t)'r' << 8 | (uint64_t)129)
 
 // The version number of the raw binary format.
-#define MEMPROF_RAW_VERSION 4ULL
+#define MEMPROF_RAW_VERSION 5ULL
 
 // Currently supported versions.
 #define MEMPROF_RAW_SUPPORTED_VERSIONS                                         \
-  { 3ULL, 4ULL }
+  { 3ULL, 4ULL, 5ULL }
 
 #define MEMPROF_V3_MIB_SIZE 132ULL;
 
@@ -219,7 +219,11 @@ void Merge(const MemInfoBlock &newMIB) {
     ShorterHistogramSize = newMIB.AccessHistogramSize;
   }
   for (size_t i = 0; i < ShorterHistogramSize; ++i) {
-    ((uint64_t *)AccessHistogram)[i] += ((uint64_t *)ShorterHistogram)[i];
+    // Cast to uint8_t* and cap the sum at 255 to prevent overflow
+    uint8_t *CurrentHistPtr = (uint8_t *)AccessHistogram;
+    uint8_t *ShorterHistPtr = (uint8_t *)ShorterHistogram;
+    uint32_t sum = CurrentHistPtr[i] + ShorterHistPtr[i];
+    CurrentHistPtr[i] = (sum > 255) ? 255 : (uint8_t)sum;
   }
 }
 
diff --git a/compiler-rt/lib/memprof/memprof_allocator.cpp b/compiler-rt/lib/memprof/memprof_allocator.cpp
index 60f5c853f9d76..c5cef5cde9466 100644
--- a/compiler-rt/lib/memprof/memprof_allocator.cpp
+++ b/compiler-rt/lib/memprof/memprof_allocator.cpp
@@ -77,7 +77,7 @@ void Print(const MemInfoBlock &M, const u64 id, bool print_terse) {
                              ? MAX_HISTOGRAM_PRINT_SIZE
                              : M.AccessHistogramSize;
     for (size_t i = 0; i < PrintSize; ++i) {
-      Printf("%llu ", ((uint64_t *)M.AccessHistogram)[i]);
+      Printf("%u ", ((uint8_t *)M.AccessHistogram)[i]);
     }
     Printf("\n");
   }
@@ -327,12 +327,13 @@ struct Allocator {
     uint32_t HistogramSize =
         RoundUpTo(user_size, HISTOGRAM_GRANULARITY) / HISTOGRAM_GRANULARITY;
     uintptr_t Histogram =
-        (uintptr_t)InternalAlloc(HistogramSize * sizeof(uint64_t));
-    memset((void *)Histogram, 0, HistogramSize * sizeof(uint64_t));
+        (uintptr_t)InternalAlloc(HistogramSize * sizeof(uint8_t));
+    memset((void *)Histogram, 0, HistogramSize * sizeof(uint8_t));
     for (size_t i = 0; i < HistogramSize; ++i) {
       u8 Counter =
           *((u8 *)HISTOGRAM_MEM_TO_SHADOW(p + HISTOGRAM_GRANULARITY * i));
-      ((uint64_t *)Histogram)[i] = (uint64_t)Counter;
+      // Cap the counter at HISTOGRAM_MAX_COUNTER (255) to prevent overflow
+      ((uint8_t *)Histogram)[i] = (Counter > HISTOGRAM_MAX_COUNTER) ? HISTOGRAM_MAX_COUNTER : Counter;
     }
     MemInfoBlock newMIB(user_size, c, m->timestamp_ms, curtime, m->cpu_id,
                         GetCpuId(), Histogram, HistogramSize);
diff --git a/compiler-rt/lib/memprof/memprof_rawprofile.cpp b/compiler-rt/lib/memprof/memprof_rawprofile.cpp
index a897648584828..95f22ffc5c42a 100644
--- a/compiler-rt/lib/memprof/memprof_rawprofile.cpp
+++ b/compiler-rt/lib/memprof/memprof_rawprofile.cpp
@@ -171,7 +171,8 @@ void SerializeMIBInfoToBuffer(MIBMapTy &MIBMap, const Vector<u64> &StackIds,
     // deserialization.
     Ptr = WriteBytes((*h)->mib, Ptr);
     for (u64 j = 0; j < (*h)->mib.AccessHistogramSize; ++j) {
-      u64 HistogramEntry = ((u64 *)((*h)->mib.AccessHistogram))[j];
+      // Read as uint8_t and write as uint8_t
+      uint8_t HistogramEntry = ((uint8_t *)((*h)->mib.AccessHistogram))[j];
       Ptr = WriteBytes(HistogramEntry, Ptr);
     }
     if ((*h)->mib.AccessHistogramSize > 0) {
@@ -249,7 +250,7 @@ u64 SerializeToRawProfile(MIBMapTy &MIBMap, ArrayRef<LoadedModule> Modules,
       },
       reinterpret_cast<void *>(&TotalAccessHistogramEntries));
   const u64 NumHistogramBytes =
-      RoundUpTo(TotalAccessHistogramEntries * sizeof(uint64_t), 8);
+      RoundUpTo(TotalAccessHistogramEntries * sizeof(uint8_t), 8);
 
   const u64 NumStackBytes = RoundUpTo(StackSizeBytes(StackIds), 8);
 
diff --git a/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp b/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
new file mode 100644
index 0000000000000..ec3e4494feaca
--- /dev/null
+++ b/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
@@ -0,0 +1,32 @@
+// RUN: %clangxx_memprof -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true %s -o %t && %env_memprof_opts=print_text=1:histogram=1:log_path=stdout %run %t 2>&1 | FileCheck %s
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main() {
+  // Allocate memory that will create a histogram
+  char *buffer = (char *)malloc(1024);
+  if (!buffer) return 1;
+
+  for (int i = 0; i < 10; ++i) {
+    // Access every 8th byte (since shadow granularity is 8b.
+    buffer[i * 8] = 'A';
+  }
+
+  for (int j = 0; j < 200; ++j) {
+    buffer[8] = 'B'; // Count = previous count + 200
+  }
+
+  for (int j = 0; j < 400; ++j) {
+    buffer[16] = 'B';  // Count is saturated at 255
+  }
+
+  // Free the memory to trigger MIB creation with histogram
+  free(buffer);
+
+  printf("Test completed successfully\n");
+  return 0;
+}
+
+// CHECK: AccessCountHistogram[128]: 1 201 255 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+// CHECK: Test completed successfully
diff --git a/llvm/include/llvm/ProfileData/MemProfData.inc b/llvm/include/llvm/ProfileData/MemProfData.inc
index 3f785bd23fce3..4a43f72c2405d 100644
--- a/llvm/include/llvm/ProfileData/MemProfData.inc
+++ b/llvm/include/llvm/ProfileData/MemProfData.inc
@@ -33,11 +33,11 @@
    (uint64_t)'o' << 24 | (uint64_t)'f' << 16 | (uint64_t)'r' << 8 | (uint64_t)129)
 
 // The version number of the raw binary format.
-#define MEMPROF_RAW_VERSION 4ULL
+#define MEMPROF_RAW_VERSION 5ULL
 
 // Currently supported versions.
 #define MEMPROF_RAW_SUPPORTED_VERSIONS                                         \
-  { 3ULL, 4ULL }
+  { 3ULL, 4ULL, 5ULL }
 
 #define MEMPROF_V3_MIB_SIZE 132ULL;
 
@@ -219,7 +219,11 @@ void Merge(const MemInfoBlock &newMIB) {
     ShorterHistogramSize = newMIB.AccessHistogramSize;
   }
   for (size_t i = 0; i < ShorterHistogramSize; ++i) {
-    ((uint64_t *)AccessHistogram)[i] += ((uint64_t *)ShorterHistogram)[i];
+    // Cast to uint8_t* and cap the sum at 255 to prevent overflow
+    uint8_t *CurrentHistPtr = (uint8_t *)AccessHistogram;
+    uint8_t *ShorterHistPtr = (uint8_t *)ShorterHistogram;
+    uint32_t sum = CurrentHistPtr[i] + ShorterHistPtr[i];
+    CurrentHistPtr[i] = (sum > 255) ? 255 : (uint8_t)sum;
   }
 }
 
diff --git a/llvm/lib/ProfileData/MemProfReader.cpp b/llvm/lib/ProfileData/MemProfReader.cpp
index 235b1347e0077..28e1cc2a4b665 100644
--- a/llvm/lib/ProfileData/MemProfReader.cpp
+++ b/llvm/lib/ProfileData/MemProfReader.cpp
@@ -166,6 +166,90 @@ readMemInfoBlocksV4(const char *Ptr) {
   return Items;
 }
 
+llvm::SmallVector<std::pair<uint64_t, MemInfoBlock>>
+readMemInfoBlocksV5(const char *Ptr) {
+  using namespace support;
+
+  const uint64_t NumItemsToRead =
+      endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+
+  llvm::SmallVector<std::pair<uint64_t, MemInfoBlock>> Items;
+  for (uint64_t I = 0; I < NumItemsToRead; I++) {
+    const uint64_t Id =
+        endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+
+    MemInfoBlock MIB;
+    MIB.AllocCount =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.TotalAccessCount =
+        endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MinAccessCount =
+        endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MaxAccessCount =
+        endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.TotalSize =
+        endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MinSize =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MaxSize =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.AllocTimestamp =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.DeallocTimestamp =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.TotalLifetime =
+        endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MinLifetime =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MaxLifetime =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.AllocCpuId =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.DeallocCpuId =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.NumMigratedCpu =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.NumLifetimeOverlaps =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.NumSameAllocCpu =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.NumSameDeallocCpu =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.DataTypeId =
+        endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.TotalAccessDensity =
+        endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MinAccessDensity =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MaxAccessDensity =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.TotalLifetimeAccessDensity =
+        endian::readNext<uint64_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MinLifetimeAccessDensity =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.MaxLifetimeAccessDensity =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.AccessHistogramSize =
+        endian::readNext<uint32_t, llvm::endianness::little, unaligned>(Ptr);
+    MIB.AccessHistogram =
+        endian::readNext<uintptr_t, llvm::endianness::little, unaligned>(Ptr);
+
+    if (MIB.AccessHistogramSize > 0) {
+      // The in-memory representation uses uint64_t for histogram entries.
+      MIB.AccessHistogram =
+          (uintptr_t)malloc(MIB.AccessHistogramSize * sizeof(uint64_t));
+      for (uint64_t J = 0; J < MIB.AccessHistogramSize; J++) {
+        // The on-disk format for V5 uses uint8_t.
+        const uint8_t Val =
+            endian::readNext<uint8_t, llvm::endianness::little, unaligned>(Ptr);
+        ((uint64_t *)MIB.AccessHistogram)[J] = Val;
+      }
+    }
+    Items.push_back({Id, MIB});
+  }
+  return Items;
+}
+
 CallStackMap readStackInfo(const char *Ptr) {
   using namespace support;
 
@@ -658,6 +742,8 @@ RawMemProfReader::readMemInfoBlocks(const char *Ptr) {
     return readMemInfoBlocksV3(Ptr);
   if (MemprofRawVersion == 4ULL)
     return readMemInfoBlocksV4(Ptr);
+  if (MemprofRawVersion == 5ULL)
+    return readMemInfoBlocksV5(Ptr);
   llvm_unreachable(
       "Panic: Unsupported version number when reading MemInfoBlocks");
 }
diff --git a/llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofexe
index f69c0b12a89eb..1c612f70bf940 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofexe differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofraw
index ed679dc49c53b..09fb96ace7e1e 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/basic-histogram.memprofraw differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe
index 14cbfeb88eaf8..8810ee1090869 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/basic.memprofexe differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw
index c3ac49e8079e9..6943c18c74792 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/basic.memprofraw differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/buildid.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/buildid.memprofexe
index 1b4db88d8186d..4ab80401496fe 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/buildid.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/buildid.memprofexe differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/buildid.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/buildid.memprofraw
index e959e7679f56c..c6aec8d0b59e1 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/buildid.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/buildid.memprofraw differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe
index 2822f2fa20434..5af6c81f07fad 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/inline.memprofexe differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw
index 05deb2e963a27..8958af941c59d 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/inline.memprofraw differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe
index 22c6136f3dda8..e9ec22cc96708 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/multi.memprofexe differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw
index 364aa1cefdd73..3952768d44c68 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/multi.memprofraw differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofexe
index 34db7e784208c..e558efc7cfbc9 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofexe differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofraw
index 7a7d3a6460aed..ed2e7757ac8f2 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/padding-histogram.memprofraw differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe b/llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe
index f7d172314de6d..63eea4438dad8 100755
Binary files a/llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe and b/llvm/test/tools/llvm-profdata/Inputs/pic.memprofexe differ
diff --git a/llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw b/llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw
index 0920028b55840..b6a733af50f5d 100644
Binary files a/llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw and b/llvm/test/tools/llvm-profdata/Inputs/pic.memprofraw differ
diff --git a/llvm/test/tools/llvm-profdata/memprof-basic-histogram.test b/llvm/test/tools/llvm-profdata/memprof-basic-histogram.test
index 3d30a627bdd79..ce534db77f4f4 100644
--- a/llvm/test/tools/llvm-profdata/memprof-basic-histogram.test
+++ b/llvm/test/tools/llvm-profdata/memprof-basic-histogram.test
@@ -7,7 +7,7 @@ We expect 5 MIBs, each with different AccessHistogramValues.
 
 CHECK: MemprofProfile:
 CHECK-NEXT:   Summary:
-CHECK-NEXT:     Version: 4
+CHECK-NEXT:     Version: 5
 CHECK-NEXT:     NumSegments: {{[0-9]+}}
 CHECK-NEXT:     NumMibInfo: 5
 CHECK-NEXT:     NumAllocFunctions: 3
@@ -241,4 +241,4 @@ CHECK-NEXT:         MinLifetimeAccessDensity: 56000
 CHECK-NEXT:         MaxLifetimeAccessDensity: 56000
 CHECK-NEXT:         AccessHistogramSize: 8
 CHECK-NEXT:         AccessHistogram: {{[0-9]+}}
-CHECK-NEXT:         AccessHistogramValues: 168 147 126 105 84 63 42 21
\ No newline at end of file
+CHECK-NEXT:         AccessHistogramValues: 168 147 126 105 84 63 42 21
diff --git a/llvm/test/tools/llvm-profdata/memprof-basic.test b/llvm/test/tools/llvm-profdata/memprof-basic.test
index e15df50bc1657..81550ebce40d3 100644
--- a/llvm/test/tools/llvm-profdata/memprof-basic.test
+++ b/llvm/test/tools/llvm-profdata/memprof-basic.test
@@ -8,7 +8,7 @@ additional allocations which do not originate from the main binary are pruned.
 
 CHECK:  MemprofProfile:
 CHECK-NEXT:   Summary:
-CHECK-NEXT:     Version: 4
+CHECK-NEXT:     Version: 5
 CHECK-NEXT:     NumSegments: {{[0-9]+}}
 CHECK-NEXT:     NumMibInfo: 2
 CHECK-NEXT:     NumAllocFunctions: 1
@@ -96,4 +96,4 @@ CHECK-NEXT:         TotalLifetimeAccessDensity: 20000
 CHECK-NEXT:         MinLifetimeAccessDensity: 20000
 CHECK-NEXT:         MaxLifetimeAccessDensity: 20000
 CHECK-NEXT:         AccessHistogramSize: 0
-CHECK-NEXT:         AccessHistogram: 0
\ No newline at end of file
+CHECK-NEXT:         AccessHistogram: 0
diff --git a/llvm/test/tools/llvm-profdata/memprof-inline.test b/llvm/test/tools/llvm-profdata/memprof-inline.test
index 79ce2ad838482..4a3f6201f0a35 100644
--- a/llvm/test/tools/llvm-profdata/memprof-inline.test
+++ b/llvm/test/tools/llvm-profdata/memprof-inline.test
@@ -5,7 +5,7 @@ RUN: llvm-profdata show --memory %p/Inputs/inline.memprofraw --profiled-binary %
 
 CHECK:  MemprofProfile:
 CHECK-NEXT:  Summary:
-CHECK-NEXT:    Version: 4
+CHECK-NEXT:    Version: 5
 CHECK-NEXT:    NumSegments: {{[0-9]+}}
 CHECK-NEXT:    NumMibInfo: 2
 CHECK-NEXT:    NumAllocFunctions: 2
diff --git a/llvm/test/tools/llvm-profdata/memprof-multi.test b/llvm/test/tools/llvm-profdata/memprof-multi.test
index 62439823defd0..35f94dfe2c096 100644
--- a/llvm/test/tools/llvm-profdata/memprof-multi.test
+++ b/llvm/test/tools/llvm-profdata/memprof-multi.test
@@ -7,7 +7,7 @@ We expect 2 MIB entries, 1 each for the malloc calls in the program.
 
 CHECK:  MemprofProfile:
 CHECK-NEXT:  Summary:
-CHECK-NEXT:    Version: 4
+CHECK-NEXT:    Version: 5
 CHECK-NEXT:    NumSegments: {{[0-9]+}}
 CHECK-NEXT:    NumMibInfo: 2
 CHECK-NEXT:    NumAllocFunctions: 1
diff --git a/llvm/test/tools/llvm-profdata/memprof-padding-histogram.test b/llvm/test/tools/llvm-profdata/memprof-padding-histogram.test
index 4ba58e3c870d5..79521f3aceb6d 100644
--- a/llvm/test/tools/llvm-profdata/memprof-padding-histogram.test
+++ b/llvm/test/tools/llvm-profdata/memprof-padding-histogram.test
@@ -7,7 +7,7 @@ We expect 2 different MIBs with histogram values. This test is to make sure we p
 
 CHECK: MemprofProfile:
 CHECK-NEXT:   Summary:
-CHECK-NEXT:     Version: 4
+CHECK-NEXT:     Version: 5
 CHECK-NEXT:     NumSegments: {{[0-9]+}}
 CHECK-NEXT:     NumMibInfo: 2
 CHECK-NEXT:     NumAllocFunctions: 1
@@ -96,4 +96,4 @@ CHEC-NEXT        MinLifetimeAccessDensity: 8000
 CHEC-NEXT        MaxLifetimeAccessDensity: 8000
 CHEC-NEXT        AccessHistogramSize: 6
 CHEC-NEXT        AccessHistogram: {{[0-9]+}}
-CHEC-NEXT        AccessHistogramValues: -2 -0 -0 -0 -1 -1
\ No newline at end of file
+CHEC-NEXT        AccessHistogramValues: -2 -0 -0 -0 -1 -1
diff --git a/llvm/test/tools/llvm-profdata/memprof-pic.test b/llvm/test/tools/llvm-profdata/memprof-pic.test
index 78d2c5c54feb1..66203ef9248ff 100644
--- a/llvm/test/tools/llvm-profdata/memprof-pic.test
+++ b/llvm/test/tools/llvm-profdata/memprof-pic.test
@@ -11,7 +11,7 @@ RUN: llvm-profdata show --memory %p/Inputs/pic.memprofraw --profiled-binary %p/I
 
 CHECK:  MemprofProfile:
 CHECK-NEXT:   Summary:
-CHECK-NEXT:     Version: 4
+CHECK-NEXT:     Version: 5
 CHECK-NEXT:     NumSegments: {{[0-9]+}}
 CHECK-NEXT:     NumMibInfo: 2
 CHECK-NEXT:     NumAllocFunctions: 1
@@ -100,4 +100,4 @@ CHECK-NEXT:         TotalLifetimeAccessDensity: 20000
 CHECK-NEXT:         MinLifetimeAccessDensity: 20000
 CHECK-NEXT:         MaxLifetimeAccessDensity: 20000
 CHECK-NEXT:         AccessHistogramSize: 0
-CHECK-NEXT:         AccessHistogram: 0
\ No newline at end o...
[truncated]

@snehasish snehasish force-pushed the users/snehasish/07-08-draft_changes_to_trim_the_histogram_raw_profile_format branch from 4135d07 to 1ec7c01 Compare July 12, 2025 22:17
@snehasish snehasish requested a review from teresajohnson July 12, 2025 22:18
@snehasish
Copy link
Contributor Author

Also @mattweingarten can you take a look?

@snehasish snehasish force-pushed the users/snehasish/07-08-draft_changes_to_trim_the_histogram_raw_profile_format branch from 1ec7c01 to f9fb66f Compare July 13, 2025 01:30
@snehasish snehasish force-pushed the users/snehasish/07-08-draft_changes_to_trim_the_histogram_raw_profile_format branch from f9fb66f to db646f8 Compare July 23, 2025 23:53
Copy link
Contributor Author

@snehasish snehasish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptal, thanks.

@snehasish snehasish changed the title [MemProf] Change histogram storage from uint64_t to uint8_t [MemProf] Change histogram storage from uint64_t to uint16_t Jul 24, 2025
@snehasish snehasish force-pushed the users/snehasish/07-08-draft_changes_to_trim_the_histogram_raw_profile_format branch from db646f8 to acf7853 Compare July 24, 2025 06:14
Copy link
Contributor

@teresajohnson teresajohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description needs an update. lgtm other than some minor comments

if (Count == 0)
return 0;

const uint64_t MaxRepresentableValue = static_cast<uint64_t>(MaxMantissa)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be moved out of the function and made a constexpr like the other Max values above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this get updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did not get updated. I made the changes to MemProfData.inc in compiler-rt and promptly copied the contents of the version in ProfileData over to compiler-rt. Thanks for catching this.

Copy link
Contributor Author

Updated description and addressed comments. Ptal, thanks!

Copy link
Contributor

@teresajohnson teresajohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with one question below

if (Count == 0)
return 0;

const uint64_t MaxRepresentableValue = static_cast<uint64_t>(MaxMantissa)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this get updated?

@snehasish snehasish force-pushed the users/snehasish/07-08-draft_changes_to_trim_the_histogram_raw_profile_format branch 3 times, most recently from 3129de2 to 12bb889 Compare July 30, 2025 17:13
Copy link
Contributor Author

snehasish commented Jul 30, 2025

Merge activity

  • Jul 30, 5:13 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 30, 5:42 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 30, 5:47 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 30, 5:57 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 30, 6:00 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jul 30, 6:22 PM UTC: Graphite rebased this pull request as part of a merge.

@snehasish snehasish force-pushed the users/snehasish/07-08-draft_changes_to_trim_the_histogram_raw_profile_format branch 4 times, most recently from 0a992ee to 13343c6 Compare July 30, 2025 18:00
@snehasish snehasish force-pushed the users/snehasish/07-08-draft_changes_to_trim_the_histogram_raw_profile_format branch from 13343c6 to 2805780 Compare July 30, 2025 18:21
@snehasish snehasish merged commit 1bf89e9 into main Jul 30, 2025
9 checks passed
@snehasish snehasish deleted the users/snehasish/07-08-draft_changes_to_trim_the_histogram_raw_profile_format branch July 30, 2025 18:52
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 30, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-gcc-ubuntu running on sie-linux-worker3 while building compiler-rt,llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/21989

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/./bin/clang  --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64  -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp && env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout  /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp 2>&1 | FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp # RUN: at line 5
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/./bin/clang --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
�[1m/home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp:36:11: �[0m�[0;1;31merror: �[0m�[1mCHECK: expected string not found in input
�[0m// CHECK: AccessCountHistogram[128]: 1 201 255 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
�[0;1;32m          ^
�[0m�[1m<stdin>:1:1: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0mRecorded MIBs (incl. live on exit):
�[0;1;32m^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/llvm-clang-x86_64-gcc-ubuntu/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m          1: �[0m�[1m�[0;1;46mRecorded MIBs (incl. live on exit): �[0m
�[0;1;31mcheck:36     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
�[0m�[0;1;30m          2: �[0m�[1m�[0;1;46mMemory allocation stack id = 1 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          3: �[0m�[1m�[0;1;46m alloc_count 1, size (ave/min/max) 72704.00 / 72704 / 72704 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          4: �[0m�[1m�[0;1;46m access_count (ave/min/max): 0.00 / 0 / 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          5: �[0m�[1m�[0;1;46m lifetime (ave/min/max): 35.00 / 35 / 35 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          6: �[0m�[1m�[0;1;46m num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          7: �[0m�[1m�[0;1;46mAccessCountHistogram[0]:  �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          8: �[0m�[1m�[0;1;46mMemory allocation stack id = 2 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          9: �[0m�[1m�[0;1;46m alloc_count 1, size (ave/min/max) 1024.00 / 1024 / 1024 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         10: �[0m�[1m�[0;1;46m access_count (ave/min/max): 144055823054733569.00 / 144055823054733569 / 144055823054733569 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         11: �[0m�[1m�[0;1;46m lifetime (ave/min/max): 0.00 / 0 / 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         12: �[0m�[1m�[0;1;46m num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         13: �[0m�[1m�[0;1;46mAccessCountHistogram[0]:  �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         14: �[0m�[1m�[0;1;46mMemory allocation stack id = 3 �[0m
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 30, 2025

LLVM Buildbot has detected a new failure on builder clang-m68k-linux-cross running on suse-gary-m68k-cross while building compiler-rt,llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/13871

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
...
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Sema/Sema.h:848:7: warning: ‘clang::Sema’ declared with greater visibility than the type of its field ‘clang::Sema::DelegatingCtorDecls’ [-Wattributes]
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Serialization/ASTReader.h:255:16: warning: ‘virtual bool clang::ASTReaderListener::visitInputFile(llvm::StringRef, llvm::StringRef, bool, bool, bool)’ was hidden [-Woverloaded-virtual=]
  255 |   virtual bool visitInputFile(StringRef FilenameAsRequested, StringRef Filename,
      |                ^~~~~~~~~~~~~~
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include/clang/Serialization/ASTReader.h:319:8: note:   by ‘virtual bool clang::ChainedASTReaderListener::visitInputFile(llvm::StringRef, bool, bool, bool)’
  319 |   bool visitInputFile(StringRef Filename, bool isSystem,
      |        ^~~~~~~~~~~~~~
[315/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/LambdaExpr.cpp.o
[316/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp.o
[317/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o
FAILED: tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o 
/usr/bin/c++ -DEXPERIMENTAL_KEY_INSTRUCTIONS -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__SHORT_FILE__=\"ASTImporterTest.cpp\" -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Tooling -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googletest/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG -std=c++17  -Wno-variadic-macros -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o -MF tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o.d -o tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o -c /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/AST/ASTImporterTest.cpp
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[318/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/TraversalScope.cpp.o
[319/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTestTypeLocVisitor.cpp.o
[320/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/NestedNameSpecifiers.cpp.o
[321/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/ParenExpr.cpp.o
[322/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/TemplateArgumentLocTraverser.cpp.o
[323/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/ReplacementsYamlTest.cpp.o
[324/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTestDeclVisitor.cpp.o
[325/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/InitListExprPostOrderNoQueue.cpp.o
[326/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/TreeTestBase.cpp.o
[327/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/MutationsTest.cpp.o
[328/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/SynthesisTest.cpp.o
[329/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/InitListExprPostOrder.cpp.o
[330/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RefactoringActionRulesTest.cpp.o
[331/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/SourceCodeBuildersTest.cpp.o
[332/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RangeSelectorTest.cpp.o
[333/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RefactoringCallbacksTest.cpp.o
[334/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RefactoringTest.cpp.o
[335/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/Attr.cpp.o
[336/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/TreeTest.cpp.o
[337/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/ToolingTest.cpp.o
[338/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersNodeTest.cpp.o
[339/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/SourceCodeTest.cpp.o
[340/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTestPostOrderVisitor.cpp.o
[341/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/StencilTest.cpp.o
[342/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/Syntax/BuildTreeTest.cpp.o
[343/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/CallbacksCompoundAssignOperator.cpp.o
[344/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersTraversalTest.cpp.o
[345/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/CallbacksUnaryOperator.cpp.o
[346/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersNarrowingTest.cpp.o
[347/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/CallbacksBinaryOperator.cpp.o
[348/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/CallbacksLeaf.cpp.o
[349/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/TransformerTest.cpp.o
[350/1165] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Tooling/RecursiveASTVisitorTests/CallbacksCallExpr.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 30, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux running on sanitizer-buildbot1 while building compiler-rt,llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/17246

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:248: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:259: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/i386-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:237: warning: Compiler lib dir != compiler-rt lib dir
Compiler libdir:     "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/i386-unknown-linux-gnu"
compiler-rt libdir:  "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:248: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:259: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 11038 tests, 88 workers --
Testing:  0.. 10.. 20.. 30
FAIL: MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp (3656 of 11038)
******************** TEST 'MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang  --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64  -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp && env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout  /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp # RUN: at line 5
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp:36:11: error: CHECK: expected string not found in input
// CHECK: AccessCountHistogram[128]: 1 201 255 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
          ^
<stdin>:1:1: note: scanning from here
Recorded MIBs (incl. live on exit):
^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          1: Recorded MIBs (incl. live on exit): 
check:36     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
          2: Memory allocation stack id = 1 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          3:  alloc_count 1, size (ave/min/max) 73728.00 / 73728 / 73728 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          4:  access_count (ave/min/max): 0.00 / 0 / 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          5:  lifetime (ave/min/max): 782.00 / 782 / 782 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          6:  num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
Step 9 (test compiler-rt symbolizer) failure: test compiler-rt symbolizer (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:248: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:259: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/i386-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:237: warning: Compiler lib dir != compiler-rt lib dir
Compiler libdir:     "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/i386-unknown-linux-gnu"
compiler-rt libdir:  "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:248: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:259: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 11038 tests, 88 workers --
Testing:  0.. 10.. 20.. 30
FAIL: MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp (3656 of 11038)
******************** TEST 'MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang  --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64  -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp && env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout  /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp # RUN: at line 5
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp:36:11: error: CHECK: expected string not found in input
// CHECK: AccessCountHistogram[128]: 1 201 255 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
          ^
<stdin>:1:1: note: scanning from here
Recorded MIBs (incl. live on exit):
^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          1: Recorded MIBs (incl. live on exit): 
check:36     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
          2: Memory allocation stack id = 1 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          3:  alloc_count 1, size (ave/min/max) 73728.00 / 73728 / 73728 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          4:  access_count (ave/min/max): 0.00 / 0 / 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          5:  lifetime (ave/min/max): 782.00 / 782 / 782 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          6:  num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
Step 11 (test compiler-rt debug) failure: test compiler-rt debug (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:248: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:259: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/i386-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:237: warning: Compiler lib dir != compiler-rt lib dir
Compiler libdir:     "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/i386-unknown-linux-gnu"
compiler-rt libdir:  "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:248: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:259: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 5125 of 11021 tests, 88 workers --
Testing:  0..
FAIL: MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp (431 of 5125)
******************** TEST 'MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang  --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64  -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp && env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout  /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp # RUN: at line 5
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
+ env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp:36:11: error: CHECK: expected string not found in input
// CHECK: AccessCountHistogram[128]: 1 201 255 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
          ^
<stdin>:1:1: note: scanning from here
Recorded MIBs (incl. live on exit):
^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          1: Recorded MIBs (incl. live on exit): 
check:36     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
          2: Memory allocation stack id = 1 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          3:  alloc_count 1, size (ave/min/max) 73728.00 / 73728 / 73728 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          4:  access_count (ave/min/max): 0.00 / 0 / 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          5:  lifetime (ave/min/max): 702.00 / 702 / 702 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          6:  num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
Step 14 (test compiler-rt default) failure: test compiler-rt default (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:248: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:259: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/i386-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:237: warning: Compiler lib dir != compiler-rt lib dir
Compiler libdir:     "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/i386-unknown-linux-gnu"
compiler-rt libdir:  "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:248: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:259: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 11038 tests, 88 workers --
Testing:  0.. 10.. 20.. 30
FAIL: MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp (3663 of 11038)
******************** TEST 'MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang  --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64  -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp && env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout  /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp # RUN: at line 5
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
+ env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp:36:11: error: CHECK: expected string not found in input
// CHECK: AccessCountHistogram[128]: 1 201 255 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
          ^
<stdin>:1:1: note: scanning from here
Recorded MIBs (incl. live on exit):
^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          1: Recorded MIBs (incl. live on exit): 
check:36     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
          2: Memory allocation stack id = 1 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          3:  alloc_count 1, size (ave/min/max) 73728.00 / 73728 / 73728 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          4:  access_count (ave/min/max): 0.00 / 0 / 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          5:  lifetime (ave/min/max): 401.00 / 401 / 401 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          6:  num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
Step 16 (test standalone compiler-rt) failure: test standalone compiler-rt (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/x86_64-unknown-linux-gnu". This path was found by running ['/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-nobuiltininc', '-I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/include', '-idirafter', '/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/include', '-resource-dir=/home/b/sanitizer-x86_64-linux/build/compiler_rt_build', '-Wl,-rpath,/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/linux', '-print-runtime-dir'].
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/x86_64-unknown-linux-gnu". This path was found by running ['/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-nobuiltininc', '-I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/include', '-idirafter', '/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/include', '-resource-dir=/home/b/sanitizer-x86_64-linux/build/compiler_rt_build', '-Wl,-rpath,/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/linux', '-print-runtime-dir'].
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/x86_64-unknown-linux-gnu". This path was found by running ['/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang', '--target=x86_64-unknown-linux-gnu', '-Wthread-safety', '-Wthread-safety-reference', '-Wthread-safety-beta', '-nobuiltininc', '-I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/include', '-idirafter', '/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/include', '-resource-dir=/home/b/sanitizer-x86_64-linux/build/compiler_rt_build', '-Wl,-rpath,/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/linux', '-print-runtime-dir'].
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/x86_64-unknown-linux-gnu". This path was found by running ['/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-nobuiltininc', '-I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/include', '-idirafter', '/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/include', '-resource-dir=/home/b/sanitizer-x86_64-linux/build/compiler_rt_build', '-Wl,-rpath,/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/linux', '-print-runtime-dir'].
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/x86_64-unknown-linux-gnu". This path was found by running ['/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-nobuiltininc', '-I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/include', '-idirafter', '/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/include', '-resource-dir=/home/b/sanitizer-x86_64-linux/build/compiler_rt_build', '-Wl,-rpath,/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/linux', '-print-runtime-dir'].
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/x86_64-unknown-linux-gnu". This path was found by running ['/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-nobuiltininc', '-I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/include', '-idirafter', '/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/include', '-resource-dir=/home/b/sanitizer-x86_64-linux/build/compiler_rt_build', '-Wl,-rpath,/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/linux', '-print-runtime-dir'].
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:60: warning: Path reported by clang does not exist: "/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/x86_64-unknown-linux-gnu". This path was found by running ['/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang', '--target=x86_64-unknown-linux-gnu', '-m64', '-nobuiltininc', '-I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/include', '-idirafter', '/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/include', '-resource-dir=/home/b/sanitizer-x86_64-linux/build/compiler_rt_build', '-Wl,-rpath,/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/linux', '-print-runtime-dir'].
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:73: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 6484 tests, 88 workers --
Testing:  0.. 10.. 20.. 30
FAIL: MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp (2280 of 6484)
******************** TEST 'MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/b/sanitizer-x86_64-linux/build/build_default/bin/clang  --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64 -nobuiltininc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/include -idirafter /home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/include -resource-dir=/home/b/sanitizer-x86_64-linux/build/compiler_rt_build -Wl,-rpath,/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/linux  -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/compiler_rt_build/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp && env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout  /home/b/sanitizer-x86_64-linux/build/compiler_rt_build/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp # RUN: at line 5
+ /home/b/sanitizer-x86_64-linux/build/build_default/bin/clang --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -nobuiltininc -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/include -idirafter /home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/include -resource-dir=/home/b/sanitizer-x86_64-linux/build/compiler_rt_build -Wl,-rpath,/home/b/sanitizer-x86_64-linux/build/compiler_rt_build/lib/linux -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/b/sanitizer-x86_64-linux/build/compiler_rt_build/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
+ env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout /home/b/sanitizer-x86_64-linux/build/compiler_rt_build/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp:36:11: error: CHECK: expected string not found in input
// CHECK: AccessCountHistogram[128]: 1 201 255 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
          ^
<stdin>:1:1: note: scanning from here
Recorded MIBs (incl. live on exit):
^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          1: Recorded MIBs (incl. live on exit): 
check:36     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
          2: Memory allocation stack id = 1 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          3:  alloc_count 1, size (ave/min/max) 73728.00 / 73728 / 73728 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          4:  access_count (ave/min/max): 0.00 / 0 / 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          5:  lifetime (ave/min/max): 198.00 / 198 / 198 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          6:  num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 
check:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .

llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jul 30, 2025
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 30, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-key-instructions running on sie-linux-worker5 while building compiler-rt,llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/208/builds/3236

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-ki/build/./bin/clang  --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64  -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp && env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout  /home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp 2>&1 | FileCheck /home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp # RUN: at line 5
+ /home/buildbot/buildbot-root/llvm-ki/build/./bin/clang --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout /home/buildbot/buildbot-root/llvm-ki/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ FileCheck /home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
�[1m/home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp:36:11: �[0m�[0;1;31merror: �[0m�[1mCHECK: expected string not found in input
�[0m// CHECK: AccessCountHistogram[128]: 1 201 255 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
�[0;1;32m          ^
�[0m�[1m<stdin>:1:1: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0mRecorded MIBs (incl. live on exit):
�[0;1;32m^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/llvm-ki/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m          1: �[0m�[1m�[0;1;46mRecorded MIBs (incl. live on exit): �[0m
�[0;1;31mcheck:36     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
�[0m�[0;1;30m          2: �[0m�[1m�[0;1;46mMemory allocation stack id = 1 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          3: �[0m�[1m�[0;1;46m alloc_count 1, size (ave/min/max) 72704.00 / 72704 / 72704 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          4: �[0m�[1m�[0;1;46m access_count (ave/min/max): 0.00 / 0 / 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          5: �[0m�[1m�[0;1;46m lifetime (ave/min/max): 679.00 / 679 / 679 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          6: �[0m�[1m�[0;1;46m num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          7: �[0m�[1m�[0;1;46mAccessCountHistogram[0]:  �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          8: �[0m�[1m�[0;1;46mMemory allocation stack id = 2 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          9: �[0m�[1m�[0;1;46m alloc_count 1, size (ave/min/max) 1024.00 / 1024 / 1024 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         10: �[0m�[1m�[0;1;46m access_count (ave/min/max): 144055823054733569.00 / 144055823054733569 / 144055823054733569 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         11: �[0m�[1m�[0;1;46m lifetime (ave/min/max): 0.00 / 0 / 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         12: �[0m�[1m�[0;1;46m num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         13: �[0m�[1m�[0;1;46mAccessCountHistogram[0]:  �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         14: �[0m�[1m�[0;1;46mMemory allocation stack id = 3 �[0m
...

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 30, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-gcc-ubuntu-no-asserts running on doug-worker-6 while building compiler-rt,llvm at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/202/builds/2585

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'MemProfiler-x86_64-linux-dynamic :: TestCases/memprof_histogram_uint8.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/buildbot-root/gcc-no-asserts/build/./bin/clang  --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  -m64  -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/buildbot/buildbot-root/gcc-no-asserts/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp && env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout  /home/buildbot/buildbot-root/gcc-no-asserts/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp 2>&1 | FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp # RUN: at line 5
+ /home/buildbot/buildbot-root/gcc-no-asserts/build/./bin/clang --driver-mode=g++ -fmemory-profile -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -shared-libsan -O0 -mllvm -memprof-histogram -mllvm -memprof-use-callbacks=true /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp -o /home/buildbot/buildbot-root/gcc-no-asserts/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ env MEMPROF_OPTIONS=print_text=1:histogram=1:log_path=stdout /home/buildbot/buildbot-root/gcc-no-asserts/build/runtimes/runtimes-bins/compiler-rt/test/memprof/X86_64LinuxDynamicConfig/TestCases/Output/memprof_histogram_uint8.cpp.tmp
+ FileCheck /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp
�[1m/home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp:36:11: �[0m�[0;1;31merror: �[0m�[1mCHECK: expected string not found in input
�[0m// CHECK: AccessCountHistogram[128]: 1 201 255 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
�[0;1;32m          ^
�[0m�[1m<stdin>:1:1: �[0m�[0;1;30mnote: �[0m�[1mscanning from here
�[0mRecorded MIBs (incl. live on exit):
�[0;1;32m^
�[0m
Input file: <stdin>
Check file: /home/buildbot/buildbot-root/gcc-no-asserts/llvm-project/compiler-rt/test/memprof/TestCases/memprof_histogram_uint8.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
�[1m�[0m�[0;1;30m          1: �[0m�[1m�[0;1;46mRecorded MIBs (incl. live on exit): �[0m
�[0;1;31mcheck:36     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
�[0m�[0;1;30m          2: �[0m�[1m�[0;1;46mMemory allocation stack id = 1 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          3: �[0m�[1m�[0;1;46m alloc_count 1, size (ave/min/max) 72704.00 / 72704 / 72704 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          4: �[0m�[1m�[0;1;46m access_count (ave/min/max): 0.00 / 0 / 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          5: �[0m�[1m�[0;1;46m lifetime (ave/min/max): 841.00 / 841 / 841 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          6: �[0m�[1m�[0;1;46m num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          7: �[0m�[1m�[0;1;46mAccessCountHistogram[0]:  �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          8: �[0m�[1m�[0;1;46mMemory allocation stack id = 2 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m          9: �[0m�[1m�[0;1;46m alloc_count 1, size (ave/min/max) 1024.00 / 1024 / 1024 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         10: �[0m�[1m�[0;1;46m access_count (ave/min/max): 144055823054733569.00 / 144055823054733569 / 144055823054733569 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         11: �[0m�[1m�[0;1;46m lifetime (ave/min/max): 1.00 / 1 / 1 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         12: �[0m�[1m�[0;1;46m num migrated: 0, num lifetime overlaps: 0, num same alloc cpu: 0, num same dealloc_cpu: 0 �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         13: �[0m�[1m�[0;1;46mAccessCountHistogram[0]:  �[0m
�[0;1;31mcheck:36     ~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[0;1;30m         14: �[0m�[1m�[0;1;46mMemory allocation stack id = 3 �[0m
...

snehasish added a commit that referenced this pull request Jul 30, 2025
Add the necessary sanitizer interface decls required when the memprof
runtime is built in dynamic mode.  This was a latent issue since we didn't
add tests for the histogram feature in compiler-rt. These tests are run
with `ninja check-memprof-dynamic`.  I discovered this after the CI
failures for #147854.
snehasish added a commit that referenced this pull request Jul 31, 2025
#151431)

Reapply #147854 after fixes merged in #151398.

Change memory access histogram storage from uint64_t to uint16_t to
reduce profile size on disk. This change updates the raw profile format
to v5. Also add a histogram test in compiler-rt since we didn't have one
before. With this change the histogram memprof raw for the basic test
reduces from 75KB -> 20KB.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-rt PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants