diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2013-03-26 09:31:59 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2013-03-26 09:31:59 +0000 |
commit | 94fe1336adfd8c350e0608047a4cf619e0281679 (patch) | |
tree | 76a71a932e6a67a941e505bd92fab8d8f5e6016a /src/VBox/VMM/VMMR3/STAM.cpp | |
parent | 1ea6b30e64a1d1bfd7d95a76e630ca296b1be623 (diff) | |
download | VirtualBox-svn-94fe1336adfd8c350e0608047a4cf619e0281679.tar.gz |
STAM,VM: ring-3 only testing of pdmcritsectrw.h (disabled).
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@45189 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/VMM/VMMR3/STAM.cpp')
-rw-r--r-- | src/VBox/VMM/VMMR3/STAM.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/VBox/VMM/VMMR3/STAM.cpp b/src/VBox/VMM/VMMR3/STAM.cpp index 53b0eaac36a..f29f037fc4b 100644 --- a/src/VBox/VMM/VMMR3/STAM.cpp +++ b/src/VBox/VMM/VMMR3/STAM.cpp @@ -47,6 +47,7 @@ /******************************************************************************* * Header Files * *******************************************************************************/ +/*#define USE_PDMCRITSECTRW - testing, not for production. */ #define LOG_GROUP LOG_GROUP_STAM #include <VBox/vmm/stam.h> #include "STAMInternal.h" @@ -262,6 +263,7 @@ static const STAMR0SAMPLE g_aGMMStats[] = */ VMMR3DECL(int) STAMR3InitUVM(PUVM pUVM) { + int rc; LogFlow(("STAMR3Init\n")); /* @@ -271,10 +273,12 @@ VMMR3DECL(int) STAMR3InitUVM(PUVM pUVM) AssertRelease(sizeof(pUVM->stam.s) <= sizeof(pUVM->stam.padding)); /* - * Setup any fixed pointers and offsets. + * Initialize the read/write lock. */ - int rc = RTSemRWCreate(&pUVM->stam.s.RWSem); +#ifndef USE_PDMCRITSECTRW + rc = RTSemRWCreate(&pUVM->stam.s.RWSem); AssertRCReturn(rc, rc); +#endif /* * Register the ring-0 statistics (GVMM/GMM). @@ -317,9 +321,11 @@ VMMR3DECL(void) STAMR3TermUVM(PUVM pUVM) } pUVM->stam.s.pHead = NULL; +#ifndef USE_PDMCRITSECTRW Assert(pUVM->stam.s.RWSem != NIL_RTSEMRW); RTSemRWDestroy(pUVM->stam.s.RWSem); pUVM->stam.s.RWSem = NIL_RTSEMRW; +#endif } @@ -597,6 +603,7 @@ static int stamR3SlashCompare(const char *psz1, const char *psz2) static int stamR3RegisterU(PUVM pUVM, void *pvSample, PFNSTAMR3CALLBACKRESET pfnReset, PFNSTAMR3CALLBACKPRINT pfnPrint, STAMTYPE enmType, STAMVISIBILITY enmVisibility, const char *pszName, STAMUNIT enmUnit, const char *pszDesc) { + STAM_LAZY_INIT(pUVM); STAM_LOCK_WR(pUVM); /* |