diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-04-29 11:07:18 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2021-04-29 22:12:40 +0200 |
commit | 76451767b9c6bb90704265d109fc32c861a3c7cd (patch) | |
tree | 1be037b494ee85cce9b093f8075d46735f6ecf7a /include | |
parent | 43075227198e2aef027446611b6cbe9dfec895cb (diff) |
Add SAL_WARN in case ProfileZones are overlapping and not hierarchical
Change-Id: Id09904db762b6d931ab23cce16e55d5213079516
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114851
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/profilezone.hxx | 14 | ||||
-rw-r--r-- | include/sal/log-areas.dox | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/include/comphelper/profilezone.hxx b/include/comphelper/profilezone.hxx index e8b2ce99472b..a8570a36e9ba 100644 --- a/include/comphelper/profilezone.hxx +++ b/include/comphelper/profilezone.hxx @@ -12,6 +12,8 @@ #include <sal/config.h> +#include <sal/log.hxx> + #include <comphelper/traceevent.hxx> // implementation of XToolkitExperimental profiling API @@ -56,10 +58,16 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent if (m_nCreateTime > 0) { s_nNesting--; - assert(m_nNesting == s_nNesting); - if (s_bRecording) - addRecording(); + if (m_nNesting != s_nNesting) + { + SAL_WARN("comphelper.traceevent", "Incorrect ProfileZone nesting for " << m_sName); + } + else + { + if (s_bRecording) + addRecording(); + } } } diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 517008da6983..a6cc5ab8e9db 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -100,6 +100,7 @@ certain functionality. @li @c comphelper.container - EmbeddedObjectContainer @li @c comphelper.crypto @li @c comphelper.lok +@li @c comphelper.traceevent @section cppu |