summaryrefslogtreecommitdiff
path: root/src/vm/gcenv.ee.cpp
diff options
context:
space:
mode:
authorMaoni Stephens <Maoni0@users.noreply.github.com>2019-02-27 16:35:03 -0800
committerGitHub <noreply@github.com>2019-02-27 16:35:03 -0800
commitea099fba14da84c3e81eb8d5ad93ecae7c659489 (patch)
tree1bc50d932d45bf72a4680249365557c93159ccc2 /src/vm/gcenv.ee.cpp
parentd0743a467c1df473f511ca0ab73eaf1d119a309b (diff)
downloadcoreclr-ea099fba14da84c3e81eb8d5ad93ecae7c659489.tar.gz
coreclr-ea099fba14da84c3e81eb8d5ad93ecae7c659489.tar.bz2
coreclr-ea099fba14da84c3e81eb8d5ad93ecae7c659489.zip
added a lightweight GC profiling option (#22866)
added a profiling event mask in the high 32-bit, COR_PRF_HIGH_BASIC_GC, for basic GC monitoring. it can be set via `ICorProfilerInfo5::SetEventMask2`. all this gives you is * GC start callback * GC end callback * update generational bounds note that one different behavior between this and the existing COR_PRF_MONITOR_GC is, aside from the obvious that it doesn't give you any info beyond the above, is that the GC end callback + update generational bounds are enabled for _all_ GCs, not just non concurrent GCs. I kept the behavior the same for COR_PRF_MONITOR_GC because I don't want to risk breaking existing profiling tools that do not anticipate these for concurrent GCs.
Diffstat (limited to 'src/vm/gcenv.ee.cpp')
-rw-r--r--src/vm/gcenv.ee.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vm/gcenv.ee.cpp b/src/vm/gcenv.ee.cpp
index 6ecd325a08..f27d3f32c8 100644
--- a/src/vm/gcenv.ee.cpp
+++ b/src/vm/gcenv.ee.cpp
@@ -742,7 +742,7 @@ void GCToEEInterface::DiagGCStart(int gen, bool isInduced)
void GCToEEInterface::DiagUpdateGenerationBounds()
{
#ifdef GC_PROFILING
- if (CORProfilerTrackGC())
+ if (CORProfilerTrackGC() || CORProfilerTrackBasicGC())
UpdateGenerationBounds();
#endif // GC_PROFILING
}
@@ -750,9 +750,16 @@ void GCToEEInterface::DiagUpdateGenerationBounds()
void GCToEEInterface::DiagGCEnd(size_t index, int gen, int reason, bool fConcurrent)
{
#ifdef GC_PROFILING
+ // We were only doing generation bounds and GC finish callback for non concurrent GCs so
+ // I am keeping that behavior to not break profilers. But if BasicGC monitoring is enabled
+ // we will do these for all GCs.
if (!fConcurrent)
{
GCProfileWalkHeap();
+ }
+
+ if (CORProfilerTrackBasicGC() || (!fConcurrent && CORProfilerTrackGC()))
+ {
DiagUpdateGenerationBounds();
GarbageCollectionFinishedCallback();
}