summaryrefslogtreecommitdiff
path: root/include/comphelper/profilezone.hxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-04-27 11:14:07 +0300
committerTor Lillqvist <tml@collabora.com>2021-04-28 16:31:56 +0200
commitd57ac8ff9c0b4ec8706d1d64c4a0ee9eb23de66c (patch)
treeee35ba4f2b5a32ec5c444b750054fed9b97491aa /include/comphelper/profilezone.hxx
parentfd4df675dfe1012448285134082f61a0c03a7d15 (diff)
Make the console logging in ProfileZone work more sanely
Do not re-assing a value to the m_nCreateTime if bConsole is true. Just use the same code that sets it in the constructor as in the case when recording is on. Change-Id: I1ca3c5aa00e2f8f0faa7ca3433e1eb066413c2a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114734 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'include/comphelper/profilezone.hxx')
-rw-r--r--include/comphelper/profilezone.hxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx
index 4bdd6ad53fb5..32dc02e14f74 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -23,7 +23,6 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public TraceEvent
const char* m_sProfileId;
long long m_nCreateTime;
bool m_bConsole;
- void startConsole();
void stopConsole();
int m_nPid;
@@ -49,13 +48,18 @@ public:
: m_sProfileId(sProfileId ? sProfileId : "(null)")
, m_bConsole(bConsole)
{
- if (s_bRecording)
+ if (s_bRecording || m_bConsole)
{
TimeValue systemTime;
osl_getSystemTime(&systemTime);
m_nCreateTime
= static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec / 1000;
+ }
+ else
+ m_nCreateTime = 0;
+ if (s_bRecording)
+ {
oslProcessInfo aProcessInfo;
aProcessInfo.Size = sizeof(oslProcessInfo);
if (osl_getProcessInfo(nullptr, osl_Process_IDENTIFIER, &aProcessInfo)
@@ -64,12 +68,6 @@ public:
s_nNesting++;
}
- else
- m_nCreateTime = 0;
- if (m_bConsole)
- {
- startConsole();
- }
}
~ProfileZone()