summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@libreoffice.org>2018-05-28 16:25:39 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-05-30 21:47:07 -0700
commit76f61468e69020bb42f8b726e78635ec4d4b8a57 (patch)
treec45bc57c3c031ec80e86a6edb5db753cb141a4ae /core
parent3963e44404738d3d01d4051094b05f81f0a181e0 (diff)
downloadsubsurface-76f61468e69020bb42f8b726e78635ec4d4b8a57.tar.gz
mobile: add timer to measure startup.
Subsurface-mobile has a long startup time; in order to isolate the problem(s) a timer is added to see where time is "lost". The collected startup times are added to the clipboard together with the other logs, allowing test users to report back. All this is only enabled when compiling with -DENABLE_STARTUP_TIMING Closes #1340 [Dirk Hohndel: collapsed multiple commits and minor white space cleanups, added missing QMutex variable] Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/ssrf.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/ssrf.h b/core/ssrf.h
index 7f65f2dc5..20dc569a4 100644
--- a/core/ssrf.h
+++ b/core/ssrf.h
@@ -12,6 +12,21 @@ extern "C" {
#endif
#ifdef __cplusplus
+
+#ifdef SUBSURFACE_MOBILE
+#ifdef ENABLE_STARTUP_TIMING
+// Declare generic function, will be seen only in CPP code
+// Use void parameters to avoid extra includes
+extern void log_stp(const char *ident, QString *buf);
+
+#define LOG_STP(x) log_stp(x, NULL)
+#define LOG_STP_CLIPBOARD(x) log_stp(NULL, x)
+#else
+#define LOG_STP(x)
+#define LOG_STP_CLIPBOARD(x)
+#endif // ENABLE_STARTUP_TIMING
+#endif // SUBSURFACE_MOBILE
+
}
#else