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>
This commit is contained in:
@@ -210,7 +210,13 @@ public:
|
||||
SetTimeout(dumpTimeoutMS);
|
||||
Start();
|
||||
}
|
||||
|
||||
virtual void Invoke() override
|
||||
{
|
||||
flushRecordings();
|
||||
}
|
||||
|
||||
static void flushRecordings()
|
||||
{
|
||||
const css::uno::Sequence<OUString> aEvents =
|
||||
comphelper::TraceEvent::getRecordingAndClear();
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user