diff options
author | Tor Lillqvist <tml@collabora.com> | 2021-06-29 15:04:58 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2021-06-30 09:19:58 +0200 |
commit | e9dc82b761a71369c4c49ae6d5fd8892f999c77a (patch) | |
tree | aa26a78bc89f58076215caeb4aed8b40d85d0a83 /desktop | |
parent | dbbd4f356487d7d4f68cddd5a06a71f236d358ed (diff) |
Avoid accumulating a huge number of Trace Events before calling the callback
Don't use only the five second timer to flush the buffer. Set a limit
on the number of accumulated events, too.
Change-Id: I075028ce653d89cf099d91ce0d4d97c1361a3bb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118089
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 25206944d90d..7d3fc9f078ab 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -210,8 +210,14 @@ public: SetTimeout(dumpTimeoutMS); Start(); } + virtual void Invoke() override { + flushRecordings(); + } + + static void flushRecordings() + { const css::uno::Sequence<OUString> aEvents = comphelper::TraceEvent::getRecordingAndClear(); OStringBuffer aOutput; @@ -3905,6 +3911,7 @@ static void lo_setOption(LibreOfficeKit* /*pThis*/, const char *pOption, const c { if (strcmp(pValue, "start") == 0) { + comphelper::TraceEvent::setBufferSizeAndCallback(100, TraceEventDumper::flushRecordings); comphelper::TraceEvent::startRecording(); if (traceEventDumper == nullptr) traceEventDumper = new TraceEventDumper(); |