Skip to content

Commit

Permalink
Merge pull request #1462 from Maoni0/perheaphist
Browse files Browse the repository at this point in the history
GC events changes
  • Loading branch information
brianrob authored Jul 22, 2021
2 parents 74fc28e + 79ac1f9 commit b8afc73
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
28 changes: 22 additions & 6 deletions src/TraceEvent/Computers/TraceManagedProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2616,7 +2616,7 @@ internal static FreeListEfficiency GetFreeListEfficiency(List<TraceGC> GCs, Trac
return freeList;
}

if (gc.PerHeapHistories[0].HasFreeListAllocated && gc.PerHeapHistories[0].HasFreeListRejected)
if (gc.PerHeapHistories[0].HasAllocatedInfo)
{
freeList.Allocated = 0;
freeList.FreeListConsumed = 0;
Expand Down Expand Up @@ -3526,15 +3526,27 @@ public MarkInfo(bool initPromoted = true)
/// <summary>
/// Per heap statistics
/// </summary>
/// HasAllocatedInfo indicates the following fields will not be -1
/// FreeListAllocated
/// FreeListRejected
/// EndOfSegAllocated
/// CondemnedAllocated
/// PinnedAllocated
/// PinnedAllocatedAdvance
/// RunningFreeListEfficiency
public class GCPerHeapHistory
{
public int MemoryPressure;
public bool HasMemoryPressure;
public bool VersionRecognized;
public long FreeListAllocated;
public bool HasFreeListAllocated;
public bool HasAllocatedInfo;
public long FreeListRejected;
public bool HasFreeListRejected;
public long EndOfSegAllocated;
public long CondemnedAllocated;
public long PinnedAllocated;
public long PinnedAllocatedAdvance;
public int RunningFreeListEfficiency;
public int CondemnReasons0;
public int CondemnReasons1;
public bool HasCondemnReasons1;
Expand Down Expand Up @@ -4599,9 +4611,13 @@ internal static void ProcessPerHeapHistory(TraceLoadedDotNetRuntime proc, GCPerH
var hist = new GCPerHeapHistory()
{
FreeListAllocated = (data.HasFreeListAllocated) ? data.FreeListAllocated : -1,
HasFreeListAllocated = data.HasFreeListAllocated,
FreeListRejected = (data.HasFreeListRejected) ? data.FreeListRejected : -1,
HasFreeListRejected = data.HasFreeListRejected,
HasAllocatedInfo = data.HasFreeListAllocated,
FreeListRejected = (data.HasFreeListAllocated) ? data.FreeListRejected : -1,
EndOfSegAllocated = (data.HasFreeListAllocated) ? data.EndOfSegAllocated : -1,
CondemnedAllocated = (data.HasFreeListAllocated) ? data.CondemnedAllocated : -1,
PinnedAllocated = (data.HasFreeListAllocated) ? data.PinnedAllocated: -1,
PinnedAllocatedAdvance = (data.HasFreeListAllocated) ? data.PinnedAllocatedAdvance : -1,
RunningFreeListEfficiency = (data.HasFreeListAllocated) ? data.RunningFreeListEfficiency : -1,
MemoryPressure = (data.HasMemoryPressure) ? data.MemoryPressure : -1,
HasMemoryPressure = data.HasMemoryPressure,
VersionRecognized = data.VersionRecognized,
Expand Down
6 changes: 5 additions & 1 deletion src/TraceEvent/Parsers/ClrTraceEventParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4827,7 +4827,11 @@ public enum MarkRootType
MarkOlder = 3,
MarkSizedRef = 4,
MarkOverflow = 5,
MarkMax = 6,
MarkDependentHandles = 6,
MarkNewFQ = 7,
MarkSteal = 8,
MarkBGCRoots = 9,
MarkMax = 10,
}

public sealed class GCMarkTraceData : TraceEvent
Expand Down

0 comments on commit b8afc73

Please sign in to comment.