private void Analyze(FingerprintStoreEntry newEntry, Process pip, bool fromCacheLookup) { using (var watch = new CacheMissTimer(pip.PipId, this)) { if (!IsCacheMissEligible(pip.PipId)) { return; } TryGetFingerprintStoreEntry(pip, out FingerprintStoreEntry oldEntry); PerformCacheMissAnalysis(pip, oldEntry, newEntry, fromCacheLookup); } }
internal void AnalyzeForCacheLookup(ProcessFingerprintComputationEventData data) { var pipId = data.PipId; using (var watch = new CacheMissTimer(pipId, this)) { // During cache-lookup, we only perform cache miss analysis for strong fingerprint misses. if (!m_pipCacheMissesDict.TryGetValue(data.PipId, out PipCacheMissInfo info) || info.CacheMissType != PipCacheMissType.MissForDescriptorsDueToStrongFingerprints) { return; } if (!IsCacheMissEligible(pipId)) { return; } Process pip = m_logTarget.GetProcess(pipId); if (!TryGetFingerprintStoreEntry(pip, out FingerprintStoreEntry oldEntry)) { return; } // WeakFingerprint must match if (!string.Equals(oldEntry.PipToFingerprintKeys.Value.WeakFingerprint, data.WeakFingerprint.Hash.ToString())) { return; } foreach (var computation in data.StrongFingerprintComputations) { if (!computation.IsStrongFingerprintHit && string.Equals(ContentHashToString(computation.PathSetHash), oldEntry.PipToFingerprintKeys.Value.PathSetHash)) { // If pathSets do match and it is a strongfingerprint miss, we can perform the cache miss analysis // First, we need to create the entry. var pipFingerprintKeys = new PipFingerprintKeys(data.WeakFingerprint, computation.ComputedStrongFingerprint, ContentHashToString(computation.PathSetHash)); var newEntry = m_logTarget.CreateFingerprintStoreEntry(pip, pipFingerprintKeys, data.WeakFingerprint, computation); Counters.IncrementCounter(FingerprintStoreCounters.CacheMissAnalysisCacheLookupAnalyzeCount); PerformCacheMissAnalysis(pip, oldEntry, newEntry, true); return; } } } }
internal void AnalyzeForExecution(FingerprintStoreEntry newEntry, Process pip) { using (var watch = new CacheMissTimer(pip.PipId, this)) { if (!IsCacheMissEligible(pip.PipId)) { return; } if (!TryGetFingerprintStoreEntry(pip, out FingerprintStoreEntry oldEntry)) { return; } PerformCacheMissAnalysis(pip, oldEntry, newEntry, false); } }