[Libreoffice-commits] core.git: comphelper/source include/comphelper
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 17 10:55:33 UTC 2021
comphelper/source/misc/traceevent.cxx | 10 ----------
include/comphelper/profilezone.hxx | 26 ++++++--------------------
2 files changed, 6 insertions(+), 30 deletions(-)
New commits:
commit 1394bfba870a38d7d4edbd3c387b5e87182bc90f
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Jun 17 10:05:54 2021 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Jun 17 12:54:51 2021 +0200
Drop the "console" functionality of ProfileZone
It was not used anywhere and had not been cherry-picked to the
relevant vendor production branches so apparently it was just some
temporary experimentation? It is good to reduce complexity and
increase code similarity between branches.
Change-Id: Ib6717063f96d901d65ec36d65f3683af31065f2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117364
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml at collabora.com>
diff --git a/comphelper/source/misc/traceevent.cxx b/comphelper/source/misc/traceevent.cxx
index cd6d3929e27c..793fea6cdb0e 100644
--- a/comphelper/source/misc/traceevent.cxx
+++ b/comphelper/source/misc/traceevent.cxx
@@ -118,16 +118,6 @@ void ProfileZone::addRecording()
+ OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
}
-void ProfileZone::stopConsole()
-{
- TimeValue systemTime;
- osl_getSystemTime(&systemTime);
- long long nEndTime
- = static_cast<long long>(systemTime.Seconds) * 1000000 + systemTime.Nanosec / 1000;
- std::cerr << "comphelper::ProfileZone: " << m_sName << " finished in "
- << (nEndTime - m_nCreateTime) / 1000 << " ms" << std::endl;
-}
-
} // namespace comphelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx
index 08e6a8b031e8..772a1b6f51be 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -25,18 +25,15 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent
static int s_nNesting; // level of nested zones.
long long m_nCreateTime;
- bool m_bConsole;
- void stopConsole();
int m_nNesting;
void addRecording();
- ProfileZone(const char* sName, const OUString& sArgs, bool bConsole)
+ ProfileZone(const char* sName, const OUString& sArgs)
: NamedEvent(sName, sArgs)
- , m_bConsole(bConsole)
, m_nNesting(-1)
{
- if (s_bRecording || m_bConsole)
+ if (s_bRecording)
{
TimeValue systemTime;
osl_getSystemTime(&systemTime);
@@ -56,22 +53,14 @@ public:
* Note that the char pointer is stored as such in the ProfileZone object and used in the
* destructor, so be sure to pass a pointer that stays valid for the duration of the object's
* lifetime.
- *
- * The second parameter can be used for ad-hoc local measuring by adding a single line of code
- * at a C++ scope start. Example:
- *
- * comphelper::ProfileZone aZone("RtfFilter::filter", true);
- *
- * Similar to the DEBUG macro in sal/log.hxx, don't forget to remove these lines before
- * committing.
*/
- ProfileZone(const char* sName, const std::map<OUString, OUString>& aArgs, bool bConsole = false)
- : ProfileZone(sName, createArgsString(aArgs), bConsole)
+ ProfileZone(const char* sName, const std::map<OUString, OUString>& aArgs)
+ : ProfileZone(sName, createArgsString(aArgs))
{
}
- ProfileZone(const char* sName, bool bConsole = false)
- : ProfileZone(sName, OUString(), bConsole)
+ ProfileZone(const char* sName)
+ : ProfileZone(sName, OUString())
{
}
@@ -90,9 +79,6 @@ public:
if (s_bRecording)
addRecording();
}
-
- if (m_bConsole)
- stopConsole();
}
}
More information about the Libreoffice-commits
mailing list