summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorMaoni0 <maonis@microsoft.com>2016-06-24 15:45:51 -0700
committerMaoni0 <maonis@microsoft.com>2016-06-30 17:22:06 -0700
commitfa2ff58d3198122cbbc216e0fd664d9e09120669 (patch)
tree1d76efc355770923fced0a0c76df65ad61aa1dfa /src/vm
parent8e8f0499f6245c5e3d678675e3b9ecd1fb6fbd58 (diff)
downloadcoreclr-fa2ff58d3198122cbbc216e0fd664d9e09120669.tar.gz
coreclr-fa2ff58d3198122cbbc216e0fd664d9e09120669.tar.bz2
coreclr-fa2ff58d3198122cbbc216e0fd664d9e09120669.zip
GC ETW fixes. The code for getting data for ETW and perf counter was written by different
folks and was very intertwined. For full CLR we always have both defined but for coreclr perf counters are not enabled so some things for ETW were just 0. Need to make sure when one is not defined the rest are still getting the data they need.
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/syncblk.cpp6
-rw-r--r--src/vm/syncblk.h5
-rw-r--r--src/vm/vars.cpp4
-rw-r--r--src/vm/vars.hpp6
4 files changed, 15 insertions, 6 deletions
diff --git a/src/vm/syncblk.cpp b/src/vm/syncblk.cpp
index 8fded72f30..3975542d98 100644
--- a/src/vm/syncblk.cpp
+++ b/src/vm/syncblk.cpp
@@ -1055,7 +1055,6 @@ SyncBlock *SyncBlockCache::GetNextFreeSyncBlock()
SyncBlock *psb;
SLink *plst = m_FreeBlockList;
- COUNTER_ONLY(GetPerfCounters().m_GC.cSinkBlocks ++);
m_ActiveCount++;
if (plst)
@@ -1311,8 +1310,6 @@ void SyncBlockCache::DeleteSyncBlockMemory(SyncBlock *psb)
}
CONTRACTL_END
- COUNTER_ONLY(GetPerfCounters().m_GC.cSinkBlocks --);
-
m_ActiveCount--;
m_FreeCount++;
@@ -1337,9 +1334,6 @@ void SyncBlockCache::GCDeleteSyncBlock(SyncBlock *psb)
// operator delete).
delete psb;
- COUNTER_ONLY(GetPerfCounters().m_GC.cSinkBlocks --);
-
-
m_ActiveCount--;
m_FreeCount++;
diff --git a/src/vm/syncblk.h b/src/vm/syncblk.h
index 82930dd636..6d32e3eafa 100644
--- a/src/vm/syncblk.h
+++ b/src/vm/syncblk.h
@@ -1028,6 +1028,11 @@ class SyncBlockCache
return m_bSyncBlockCleanupInProgress;
}
+ DWORD GetActiveCount()
+ {
+ return m_ActiveCount;
+ }
+
// Encapsulate a CrstHolder, so that clients of our lock don't have to know
// the details of our implementation.
class LockHolder : public CrstHolder
diff --git a/src/vm/vars.cpp b/src/vm/vars.cpp
index e4543bf3cf..b737e66cd5 100644
--- a/src/vm/vars.cpp
+++ b/src/vm/vars.cpp
@@ -110,6 +110,10 @@ GPTR_IMPL(Thread,g_pSuspensionThread);
// Global SyncBlock cache
GPTR_IMPL(SyncTableEntry,g_pSyncTable);
+#if defined(ENABLE_PERF_COUNTERS) || defined(FEATURE_EVENT_TRACE)
+DWORD g_dwHandles = 0;
+#endif // ENABLE_PERF_COUNTERS || FEATURE_EVENT_TRACE
+
#ifdef STRESS_LOG
GPTR_IMPL_INIT(StressLog, g_pStressLog, &StressLog::theLog);
#endif
diff --git a/src/vm/vars.hpp b/src/vm/vars.hpp
index 576f0061db..d197e0559d 100644
--- a/src/vm/vars.hpp
+++ b/src/vm/vars.hpp
@@ -472,6 +472,12 @@ GPTR_DECL(Thread,g_pSuspensionThread);
typedef DPTR(SyncTableEntry) PTR_SyncTableEntry;
GPTR_DECL(SyncTableEntry, g_pSyncTable);
+#if defined(ENABLE_PERF_COUNTERS) || defined(FEATURE_EVENT_TRACE)
+// Note this is not updated in a thread safe way so the value may not be accurate. We get
+// it accurately in full GCs if the handle count is requested.
+extern DWORD g_dwHandles;
+#endif // ENABLE_PERF_COUNTERS || FEATURE_EVENT_TRACE
+
#ifdef FEATURE_COMINTEROP
// Global RCW cleanup list
typedef DPTR(RCWCleanupList) PTR_RCWCleanupList;