diff options
-rw-r--r-- | comphelper/source/misc/profilezone.cxx | 27 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 2 | ||||
-rw-r--r-- | include/comphelper/profilezone.hxx | 3 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 4 |
4 files changed, 20 insertions, 16 deletions
diff --git a/comphelper/source/misc/profilezone.cxx b/comphelper/source/misc/profilezone.cxx index f9284b1f4a51..dc945c7f715d 100644 --- a/comphelper/source/misc/profilezone.cxx +++ b/comphelper/source/misc/profilezone.cxx @@ -32,17 +32,19 @@ static int g_aNesting; // level of overlapped zones static long long g_aStartTime; // start time of recording static ::osl::Mutex g_aMutex; -void startRecording(bool bStartRecording) +void startRecording() { - if (bStartRecording) - { - TimeValue systemTime; - osl_getSystemTime( &systemTime ); - ::osl::MutexGuard aGuard( g_aMutex ); - g_aStartTime = static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec/1000; - g_aNesting = 0; - } - ProfileZone::g_bRecording = bStartRecording; + TimeValue systemTime; + osl_getSystemTime( &systemTime ); + ::osl::MutexGuard aGuard( g_aMutex ); + g_aStartTime = static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec/1000; + g_aNesting = 0; + ProfileZone::g_bRecording = true; +} + +void stopRecording() +{ + ProfileZone::g_bRecording = false; } long long addRecording(const char * aProfileId, long long aCreateTime) @@ -88,13 +90,14 @@ css::uno::Sequence<OUString> getRecordingAndClear() { ::osl::MutexGuard aGuard( g_aMutex ); bRecording = ProfileZone::g_bRecording; - startRecording(false); + stopRecording(); aRecording.swap(g_aRecording); long long aSumTime = g_aSumTime; aRecording.insert(aRecording.begin(), OUString::number(aSumTime/1000000.0)); } // reset start time and nesting level - startRecording(bRecording); + if (bRecording) + startRecording(); return ::comphelper::containerToSequence(aRecording); } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4b78a68d86d1..d2a7b1351a35 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -6159,7 +6159,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char // Turn profile zones on early if (bProfileZones && eStage == SECOND_INIT) { - comphelper::ProfileRecording::startRecording(true); + comphelper::ProfileRecording::startRecording(); new ProfileZoneDumper(); } diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx index f1276e64cd67..0c0df2089c98 100644 --- a/include/comphelper/profilezone.hxx +++ b/include/comphelper/profilezone.hxx @@ -24,7 +24,8 @@ namespace comphelper { namespace ProfileRecording { -COMPHELPER_DLLPUBLIC void startRecording(bool bRecording); +COMPHELPER_DLLPUBLIC void startRecording(); +COMPHELPER_DLLPUBLIC void stopRecording(); COMPHELPER_DLLPUBLIC long long addRecording(const char* aProfileId, long long aCreateTime); diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index e503a4585906..18ae78f9f925 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -2562,12 +2562,12 @@ void SAL_CALL VCLXToolkit::pause(sal_Int32 nMilliseconds) void SAL_CALL VCLXToolkit::startRecording() { - ::comphelper::ProfileRecording::startRecording(true); + ::comphelper::ProfileRecording::startRecording(); } void SAL_CALL VCLXToolkit::stopRecording() { - ::comphelper::ProfileRecording::startRecording( false ); + ::comphelper::ProfileRecording::stopRecording(); } css::uno::Sequence< OUString > VCLXToolkit::getRecordingAndClear() |