private void AddToFunctionsList(PProfInfo.Function functionInfo) { if (functionInfo != null && !functionInfo.IsIncludedInSession) { PProfBuildSessionState buildState = ValidOwnerBuildState; functionInfo.IsIncludedInSession = true; buildState.Functions.Add(functionInfo); _profile.Function.Add(functionInfo.Item); } }
private void AddToMappingsList(PProfInfo.Mapping mappingInfo) { if (mappingInfo != null && !mappingInfo.IsIncludedInSession) { PProfBuildSessionState buildState = ValidOwnerBuildState; mappingInfo.IsIncludedInSession = true; buildState.Mappings.Add(mappingInfo); _profile.Mapping.Add(mappingInfo.Item); } }
private void AddToLocationsList(PProfInfo.Location locationInfo) { if (locationInfo != null && !locationInfo.IsIncludedInSession) { PProfBuildSessionState buildState = ValidOwnerBuildState; locationInfo.IsIncludedInSession = true; buildState.Locations.Add(locationInfo); _profile.Location.Add(locationInfo.Item); } }
private void AddToStringTable(PProfInfo.String stringInfo) { if (stringInfo != null && !stringInfo.IsIncludedInSession) { PProfBuildSessionState buildState = ValidOwnerBuildState; stringInfo.OffsetInStringTable = buildState.StringTable.Count; buildState.StringTable.Add(stringInfo); _profile.StringTable.Add(stringInfo.Item); } }
internal PProfBuildSession(PProfBuilder owner, PProfBuildSessionState ownerBuildState) { Validate.NotNull(owner, nameof(owner)); Validate.NotNull(ownerBuildState, nameof(ownerBuildState)); _ownerBuildState = ownerBuildState; this.OwnerBuilder = owner; _profile = new PProfProto.Profile(); _lastSample = null; this.SamplesCount = 0; }
public void Dispose() { PProfBuildSessionState prevOwnerBuildState = Interlocked.Exchange(ref _ownerBuildState, null); if (prevOwnerBuildState != null) { if (!OwnerBuilder.TryFinishPProfBuildSessionInternal(this)) { throw new InvalidOperationException($"Cannot dispose this {nameof(PProfBuildSession)}." + $" Is this not the current session of the {nameof(OwnerBuilder)}?"); } } }