summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-04-27 10:48:09 +0300
committerTor Lillqvist <tml@collabora.com>2021-04-28 13:44:15 +0200
commit843db78050bb44db2839c1bd7f765a5b258ba4da (patch)
treeadb3e37603e38c173be18018d5f8fd603587700a /comphelper
parent2d867eff480c03ab125f4c0149dd73afee08db85 (diff)
Move some static functions from ProfileZone to TraceEvent where they belong
Change-Id: I35f3d5d8c0a69a224cf7d3a2decba9c8e13c7dc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114698 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/traceevent.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/comphelper/source/misc/traceevent.cxx b/comphelper/source/misc/traceevent.cxx
index aa99e8bf7e39..6e86c3f03993 100644
--- a/comphelper/source/misc/traceevent.cxx
+++ b/comphelper/source/misc/traceevent.cxx
@@ -67,14 +67,30 @@ void TraceEvent::addInstantEvent(const char* sProfileId)
+ OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
}
-void ProfileZone::startRecording()
+void TraceEvent::startRecording()
{
::osl::MutexGuard aGuard(g_aMutex);
s_nNesting = 0;
s_bRecording = true;
}
-void ProfileZone::stopRecording() { s_bRecording = false; }
+void TraceEvent::stopRecording() { s_bRecording = false; }
+
+css::uno::Sequence<OUString> TraceEvent::getRecordingAndClear()
+{
+ bool bRecording;
+ std::vector<OUString> aRecording;
+ {
+ ::osl::MutexGuard aGuard(g_aMutex);
+ bRecording = s_bRecording;
+ stopRecording();
+ aRecording.swap(g_aRecording);
+ }
+ // reset start time and nesting level
+ if (bRecording)
+ startRecording();
+ return ::comphelper::containerToSequence(aRecording);
+}
void ProfileZone::addRecording()
{
@@ -104,22 +120,6 @@ void ProfileZone::addRecording()
+ OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
}
-css::uno::Sequence<OUString> ProfileZone::getRecordingAndClear()
-{
- bool bRecording;
- std::vector<OUString> aRecording;
- {
- ::osl::MutexGuard aGuard(g_aMutex);
- bRecording = s_bRecording;
- stopRecording();
- aRecording.swap(g_aRecording);
- }
- // reset start time and nesting level
- if (bRecording)
- startRecording();
- return ::comphelper::containerToSequence(aRecording);
-}
-
void ProfileZone::startConsole() { m_nCreateTime = osl_getGlobalTimer(); }
void ProfileZone::stopConsole()