[flang] [lld] [clang] [libcxxabi] [compiler-rt] [libc] [llvm] [clang-tools-extra] [libcxx] [CSSPGO] Compute and report post-match profile staleness (PR #79090)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 27 10:40:08 PST 2024


================
@@ -433,6 +433,44 @@ using CandidateQueue =
     PriorityQueue<InlineCandidate, std::vector<InlineCandidate>,
                   CandidateComparer>;
 
+// Profile matching statstics.
+class ProfileMatchStats {
+  const Module &M;
+  SampleProfileReader &Reader;
+  const PseudoProbeManager *ProbeManager;
+
+public:
+  ProfileMatchStats(const Module &M, SampleProfileReader &Reader,
+                    const PseudoProbeManager *ProbeManager)
+      : M(M), Reader(Reader), ProbeManager(ProbeManager) {}
+
+  uint64_t NumMismatchedCallsites = 0;
+  uint64_t TotalProfiledCallsites = 0;
+  uint64_t MismatchedCallsiteSamples = 0;
+  uint64_t NumMismatchedFuncHash = 0;
+  uint64_t TotalProfiledFunc = 0;
+  uint64_t MismatchedFuncHashSamples = 0;
----------------
WenleiHe wrote:

Add some comment for those stats, particularly what is different between `MismatchedCallsiteSamples` and `MismatchedFuncHashSamples`.

https://github.com/llvm/llvm-project/pull/79090


More information about the cfe-commits mailing list