Skip to content

Commit 0bd8015

Browse files
author
Mike Kaufman
committed
[1.10>master] [MERGE #5414 @mike-kaufman] Updating telemetry reporting to include a variety of boolean flags from the recyclerFlagsTable
Merge pull request #5414 from mike-kaufman:build/mkaufman/gc-telemetry-tweaks-2018-07-02
2 parents dc29778 + e782dc3 commit 0bd8015

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

lib/Common/Memory/Recycler.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,11 +711,17 @@ class Recycler
711711
virtual void ValueChanged(const CollectionState& newVal, const CollectionState& oldVal)
712712
{
713713
#ifdef ENABLE_BASIC_TELEMETRY
714-
if (oldVal == CollectionState::CollectionStateNotCollecting && newVal != CollectionState::CollectionStateNotCollecting && newVal != CollectionState::Collection_PreCollection)
714+
if (oldVal == CollectionState::CollectionStateNotCollecting &&
715+
newVal != CollectionState::CollectionStateNotCollecting &&
716+
newVal != CollectionState::Collection_PreCollection &&
717+
newVal != CollectionState::CollectionStateExit)
715718
{
716719
this->recycler->GetRecyclerTelemetryInfo().StartPass(newVal);
717720
}
718-
else if (oldVal != CollectionState::CollectionStateNotCollecting && oldVal != CollectionState::Collection_PreCollection && newVal == CollectionState::CollectionStateNotCollecting)
721+
else if (oldVal != CollectionState::CollectionStateNotCollecting &&
722+
oldVal != CollectionState::Collection_PreCollection &&
723+
oldVal != CollectionState::CollectionStateExit &&
724+
newVal == CollectionState::CollectionStateNotCollecting)
719725
{
720726
this->recycler->GetRecyclerTelemetryInfo().EndPass(oldVal);
721727
}

lib/Common/Memory/RecyclerTelemetryInfo.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,29 @@ namespace Memory
5252
return this->recycler->GetRecyclerID();
5353
}
5454

55-
bool RecyclerTelemetryInfo::GetIsConcurrentEnabled() const
55+
RecyclerFlagsTableSummary RecyclerTelemetryInfo::GetRecyclerConfigFlags() const
5656
{
57-
return this->recycler->IsConcurrentEnabled();
57+
58+
// select set of config flags that we can pack into an uint32
59+
RecyclerFlagsTableSummary flags = RecyclerFlagsTableSummary::None;
60+
61+
if (this->recycler->IsMemProtectMode()) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::IsMemProtectMode); }
62+
if (this->recycler->IsConcurrentEnabled()) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::IsConcurrentEnabled); }
63+
if (this->recycler->enableScanInteriorPointers) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::EnableScanInteriorPointers); }
64+
if (this->recycler->enableScanImplicitRoots) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::EnableScanImplicitRoots); }
65+
if (this->recycler->disableCollectOnAllocationHeuristics) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::DisableCollectOnAllocationHeuristics); }
66+
#ifdef RECYCLER_STRESS
67+
if (this->recycler->recyclerStress) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::RecyclerStress); }
68+
#if ENABLE_CONCURRENT_GC
69+
if (this->recycler->recyclerBackgroundStress) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::RecyclerBackgroundStress); }
70+
if (this->recycler->recyclerConcurrentStress) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::RecyclerConcurrentStress); }
71+
if (this->recycler->recyclerConcurrentRepeatStress) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::RecyclerConcurrentRepeatStress); }
72+
#endif
73+
#if ENABLE_PARTIAL_GC
74+
if (this->recycler->recyclerPartialStress) { flags = static_cast<RecyclerFlagsTableSummary>(flags | RecyclerFlagsTableSummary::RecyclerPartialStress); }
75+
#endif
76+
#endif
77+
return flags;
5878
}
5979

6080
bool RecyclerTelemetryInfo::ShouldStartTelemetryCapture() const
@@ -65,7 +85,6 @@ namespace Memory
6585
this->hostInterface->IsTelemetryProviderEnabled();
6686
}
6787

68-
6988
void RecyclerTelemetryInfo::FillInSizeData(IdleDecommitPageAllocator* allocator, AllocatorSizes* sizes) const
7089
{
7190
sizes->committedBytes = allocator->GetCommittedBytes();

lib/Common/Memory/RecyclerTelemetryInfo.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,25 @@ namespace Memory
8787
#endif
8888
};
8989

90+
/**
91+
* Consolidated summary of data from RecyclerFlagsTable that we want to
92+
* transmit via telemetry. Goal is to pack this into maximum of 64-bits.
93+
*/
94+
enum RecyclerFlagsTableSummary : uint32
95+
{
96+
None = 0x0000,
97+
IsMemProtectMode = 0x0001,
98+
IsConcurrentEnabled = 0x0002,
99+
EnableScanInteriorPointers = 0x0004,
100+
EnableScanImplicitRoots = 0x0008,
101+
DisableCollectOnAllocationHeuristics = 0x0016,
102+
RecyclerStress = 0x0032,
103+
RecyclerBackgroundStress = 0x0064,
104+
RecyclerConcurrentStress = 0x0128,
105+
RecyclerConcurrentRepeatStress = 0x0256,
106+
RecyclerPartialStress = 0x0512,
107+
};
108+
90109
typedef SList<RecyclerTelemetryGCPassStats, HeapAllocator> GCPassStatsList;
91110

92111
/**
@@ -109,9 +128,9 @@ namespace Memory
109128
inline const Js::Tick& GetLastTransmitTime() const { return this->lastTransmitTime; }
110129
inline const uint16 GetPassCount() const { return this->passCount; }
111130
const GUID& GetRecyclerID() const;
112-
bool GetIsConcurrentEnabled() const;
113131
bool IsOnScriptThread() const;
114132
GCPassStatsList::Iterator GetGCPassStatsIterator() const;
133+
RecyclerFlagsTableSummary GetRecyclerConfigFlags() const;
115134

116135
AllocatorDecommitStats* GetThreadPageAllocator_decommitStats() { return &this->threadPageAllocator_decommitStats; }
117136
AllocatorDecommitStats* GetRecyclerLeafPageAllocator_decommitStats() { return &this->recyclerLeafPageAllocator_decommitStats; }

0 commit comments

Comments
 (0)