Kaydet (Commit) a34a4aae authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Jan Holesovsky

lok: add profile zones.

NB. outside of the often contended SolarMutexGuard.

Change-Id: Ieb651e2ed4349e692010a7588721f461af7d2b5b
Reviewed-on: https://gerrit.libreoffice.org/70848
Tested-by: Jenkins
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst bf440a2f
...@@ -941,6 +941,8 @@ void CallbackFlushHandler::callback(const int type, const char* payload, void* d ...@@ -941,6 +941,8 @@ void CallbackFlushHandler::callback(const int type, const char* payload, void* d
void CallbackFlushHandler::queue(const int type, const char* data) void CallbackFlushHandler::queue(const int type, const char* data)
{ {
comphelper::ProfileZone aZone("CallbackFlushHander::queue");
CallbackData aCallbackData(type, (data ? data : "(nil)")); CallbackData aCallbackData(type, (data ? data : "(nil)"));
const std::string& payload = aCallbackData.PayloadString; const std::string& payload = aCallbackData.PayloadString;
SAL_INFO("lok", "Queue: " << type << " : " << payload); SAL_INFO("lok", "Queue: " << type << " : " << payload);
...@@ -1394,6 +1396,8 @@ void CallbackFlushHandler::queue(const int type, const char* data) ...@@ -1394,6 +1396,8 @@ void CallbackFlushHandler::queue(const int type, const char* data)
void CallbackFlushHandler::Invoke() void CallbackFlushHandler::Invoke()
{ {
comphelper::ProfileZone aZone("CallbackFlushHander::Invoke");
if (m_pCallback && !m_bEventLatch) if (m_pCallback && !m_bEventLatch)
{ {
std::unique_lock<std::mutex> lock(m_mutex); std::unique_lock<std::mutex> lock(m_mutex);
...@@ -1478,6 +1482,8 @@ void CallbackFlushHandler::removeViewStates(int viewId) ...@@ -1478,6 +1482,8 @@ void CallbackFlushHandler::removeViewStates(int viewId)
static void doc_destroy(LibreOfficeKitDocument *pThis) static void doc_destroy(LibreOfficeKitDocument *pThis)
{ {
comphelper::ProfileZone aZone("doc_destroy");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
LibLODocument_Impl *pDocument = static_cast<LibLODocument_Impl*>(pThis); LibLODocument_Impl *pDocument = static_cast<LibLODocument_Impl*>(pThis);
...@@ -1567,6 +1573,8 @@ static LibreOfficeKitDocument* lo_documentLoad(LibreOfficeKit* pThis, const char ...@@ -1567,6 +1573,8 @@ static LibreOfficeKitDocument* lo_documentLoad(LibreOfficeKit* pThis, const char
static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, const char* pURL, const char* pOptions) static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, const char* pURL, const char* pOptions)
{ {
comphelper::ProfileZone aZone("lo_documentLoadWithOptions");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis); LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
...@@ -1678,6 +1686,8 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, ...@@ -1678,6 +1686,8 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
static int lo_runMacro(LibreOfficeKit* pThis, const char *pURL) static int lo_runMacro(LibreOfficeKit* pThis, const char *pURL)
{ {
comphelper::ProfileZone aZone("lo_runMacro");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis); LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
...@@ -1772,6 +1782,8 @@ static bool lo_signDocument(LibreOfficeKit* /*pThis*/, ...@@ -1772,6 +1782,8 @@ static bool lo_signDocument(LibreOfficeKit* /*pThis*/,
const unsigned char* pPrivateKeyBinary, const unsigned char* pPrivateKeyBinary,
const int nPrivateKeyBinarySize) const int nPrivateKeyBinarySize)
{ {
comphelper::ProfileZone aZone("lo_signDocument");
OUString aURL(getAbsoluteURL(pURL)); OUString aURL(getAbsoluteURL(pURL));
if (aURL.isEmpty()) if (aURL.isEmpty())
return false; return false;
...@@ -1849,6 +1861,8 @@ static void lo_registerCallback (LibreOfficeKit* pThis, ...@@ -1849,6 +1861,8 @@ static void lo_registerCallback (LibreOfficeKit* pThis,
static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions) static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const char* pFormat, const char* pFilterOptions)
{ {
comphelper::ProfileZone aZone("doc_saveAs");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2150,6 +2164,8 @@ static void doc_iniUnoCommands () ...@@ -2150,6 +2164,8 @@ static void doc_iniUnoCommands ()
static int doc_getDocumentType (LibreOfficeKitDocument* pThis) static int doc_getDocumentType (LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getDocumentType");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2190,6 +2206,8 @@ static int doc_getDocumentType (LibreOfficeKitDocument* pThis) ...@@ -2190,6 +2206,8 @@ static int doc_getDocumentType (LibreOfficeKitDocument* pThis)
static int doc_getParts (LibreOfficeKitDocument* pThis) static int doc_getParts (LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getParts");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
ITiledRenderable* pDoc = getTiledRenderable(pThis); ITiledRenderable* pDoc = getTiledRenderable(pThis);
...@@ -2204,6 +2222,8 @@ static int doc_getParts (LibreOfficeKitDocument* pThis) ...@@ -2204,6 +2222,8 @@ static int doc_getParts (LibreOfficeKitDocument* pThis)
static int doc_getPart (LibreOfficeKitDocument* pThis) static int doc_getPart (LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getPart");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2220,6 +2240,8 @@ static int doc_getPart (LibreOfficeKitDocument* pThis) ...@@ -2220,6 +2240,8 @@ static int doc_getPart (LibreOfficeKitDocument* pThis)
static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart) static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
{ {
comphelper::ProfileZone aZone("doc_setPart");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2236,6 +2258,8 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart) ...@@ -2236,6 +2258,8 @@ static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart)
static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart) static char* doc_getPartInfo(LibreOfficeKitDocument* pThis, int nPart)
{ {
comphelper::ProfileZone aZone("doc_getPartInfo");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
ITiledRenderable* pDoc = getTiledRenderable(pThis); ITiledRenderable* pDoc = getTiledRenderable(pThis);
if (!pDoc) if (!pDoc)
...@@ -2286,6 +2310,8 @@ static void doc_moveSelectedParts(LibreOfficeKitDocument* pThis, int nPosition, ...@@ -2286,6 +2310,8 @@ static void doc_moveSelectedParts(LibreOfficeKitDocument* pThis, int nPosition,
static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis) static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getPartPageRectangles");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2307,6 +2333,8 @@ static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis) ...@@ -2307,6 +2333,8 @@ static char* doc_getPartPageRectangles(LibreOfficeKitDocument* pThis)
static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart) static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
{ {
comphelper::ProfileZone aZone("doc_getPartName");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2328,6 +2356,8 @@ static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart) ...@@ -2328,6 +2356,8 @@ static char* doc_getPartName(LibreOfficeKitDocument* pThis, int nPart)
static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart) static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart)
{ {
comphelper::ProfileZone aZone("doc_getPartHash");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2350,6 +2380,8 @@ static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart) ...@@ -2350,6 +2380,8 @@ static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart)
static void doc_setPartMode(LibreOfficeKitDocument* pThis, static void doc_setPartMode(LibreOfficeKitDocument* pThis,
int nPartMode) int nPartMode)
{ {
comphelper::ProfileZone aZone("doc_setPartMode");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2391,6 +2423,8 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis, ...@@ -2391,6 +2423,8 @@ static void doc_paintTile(LibreOfficeKitDocument* pThis,
const int nTilePosX, const int nTilePosY, const int nTilePosX, const int nTilePosY,
const int nTileWidth, const int nTileHeight) const int nTileWidth, const int nTileHeight)
{ {
comphelper::ProfileZone aZone("doc_paintTile");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2518,6 +2552,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, ...@@ -2518,6 +2552,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis,
const int nTilePosX, const int nTilePosY, const int nTilePosX, const int nTilePosY,
const int nTileWidth, const int nTileHeight) const int nTileWidth, const int nTileHeight)
{ {
comphelper::ProfileZone aZone("doc_paintPartTile");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2613,6 +2649,8 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, ...@@ -2613,6 +2649,8 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
long* pWidth, long* pWidth,
long* pHeight) long* pHeight)
{ {
comphelper::ProfileZone aZone("doc_getDocumentSize");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2633,6 +2671,8 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, ...@@ -2633,6 +2671,8 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
static void doc_initializeForRendering(LibreOfficeKitDocument* pThis, static void doc_initializeForRendering(LibreOfficeKitDocument* pThis,
const char* pArguments) const char* pArguments)
{ {
comphelper::ProfileZone aZone("doc_initializeForRendering");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2749,6 +2789,8 @@ static char* getRulerState(LibreOfficeKitDocument* pThis) ...@@ -2749,6 +2789,8 @@ static char* getRulerState(LibreOfficeKitDocument* pThis)
static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode) static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode)
{ {
comphelper::ProfileZone aZone("doc_postKeyEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2765,6 +2807,8 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar ...@@ -2765,6 +2807,8 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar
static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, int nType, const char* pText) static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, int nType, const char* pText)
{ {
comphelper::ProfileZone aZone("doc_postWindowExtTextInputEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
VclPtr<vcl::Window> pWindow; VclPtr<vcl::Window> pWindow;
if (nWindowId == 0) if (nWindowId == 0)
...@@ -2804,6 +2848,8 @@ static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig ...@@ -2804,6 +2848,8 @@ static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig
static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nCharCode, int nKeyCode) static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nCharCode, int nKeyCode)
{ {
comphelper::ProfileZone aZone("doc_postWindowKeyEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2833,6 +2879,8 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n ...@@ -2833,6 +2879,8 @@ static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned n
static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOutput) static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOutput)
{ {
comphelper::ProfileZone aZone("doc_renderShapeSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -2936,6 +2984,8 @@ public: ...@@ -2936,6 +2984,8 @@ public:
static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished) static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, bool bNotifyWhenFinished)
{ {
comphelper::ProfileZone aZone("doc_postUnoCommand");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3046,6 +3096,8 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma ...@@ -3046,6 +3096,8 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, int nY, int nCount, int nButtons, int nModifier) static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{ {
comphelper::ProfileZone aZone("doc_postMouseEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3062,6 +3114,8 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, ...@@ -3062,6 +3114,8 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX,
static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier) static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{ {
comphelper::ProfileZone aZone("doc_postWindowMouseEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3100,6 +3154,8 @@ static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned ...@@ -3100,6 +3154,8 @@ static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned
static void doc_postWindowGestureEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, const char* pType, int nX, int nY, int nOffset) static void doc_postWindowGestureEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, const char* pType, int nX, int nY, int nOffset)
{ {
comphelper::ProfileZone aZone("doc_postWindowGestureEvent");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3137,6 +3193,8 @@ static void doc_postWindowGestureEvent(LibreOfficeKitDocument* /*pThis*/, unsign ...@@ -3137,6 +3193,8 @@ static void doc_postWindowGestureEvent(LibreOfficeKitDocument* /*pThis*/, unsign
static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY) static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY)
{ {
comphelper::ProfileZone aZone("doc_setTextSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3153,6 +3211,8 @@ static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int n ...@@ -3153,6 +3211,8 @@ static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int n
static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMimeType, char** pUsedMimeType) static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMimeType, char** pUsedMimeType)
{ {
comphelper::ProfileZone aZone("doc_getTextSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3183,6 +3243,8 @@ static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMi ...@@ -3183,6 +3243,8 @@ static char* doc_getTextSelection(LibreOfficeKitDocument* pThis, const char* pMi
static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, const char* pData, size_t nSize) static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, const char* pData, size_t nSize)
{ {
comphelper::ProfileZone aZone("doc_paste");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3220,6 +3282,8 @@ static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, cons ...@@ -3220,6 +3282,8 @@ static bool doc_paste(LibreOfficeKitDocument* pThis, const char* pMimeType, cons
static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY) static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY)
{ {
comphelper::ProfileZone aZone("doc_setGraphicSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3236,6 +3300,8 @@ static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, in ...@@ -3236,6 +3300,8 @@ static void doc_setGraphicSelection(LibreOfficeKitDocument* pThis, int nType, in
static void doc_resetSelection(LibreOfficeKitDocument* pThis) static void doc_resetSelection(LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_resetSelection");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3618,6 +3684,8 @@ static char* getTrackedChangeAuthors(LibreOfficeKitDocument* pThis) ...@@ -3618,6 +3684,8 @@ static char* getTrackedChangeAuthors(LibreOfficeKitDocument* pThis)
static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand) static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCommand)
{ {
comphelper::ProfileZone aZone("doc_getCommandValues");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3790,6 +3858,8 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo ...@@ -3790,6 +3858,8 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth, int nTilePixelHeight, static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth, int nTilePixelHeight,
int nTileTwipWidth, int nTileTwipHeight) int nTileTwipWidth, int nTileTwipHeight)
{ {
comphelper::ProfileZone aZone("doc_setClientZoom");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3806,6 +3876,8 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth ...@@ -3806,6 +3876,8 @@ static void doc_setClientZoom(LibreOfficeKitDocument* pThis, int nTilePixelWidth
static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight) static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight)
{ {
comphelper::ProfileZone aZone("doc_setClientVisibleArea");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3823,6 +3895,8 @@ static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int ...@@ -3823,6 +3895,8 @@ static void doc_setClientVisibleArea(LibreOfficeKitDocument* pThis, int nX, int
static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden) static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden)
{ {
comphelper::ProfileZone aZone("doc_setOutlineState");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3840,6 +3914,8 @@ static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int ...@@ -3840,6 +3914,8 @@ static void doc_setOutlineState(LibreOfficeKitDocument* pThis, bool bColumn, int
static int doc_createViewWithOptions(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, static int doc_createViewWithOptions(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/,
const char* pOptions) const char* pOptions)
{ {
comphelper::ProfileZone aZone("doc_createView");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3863,6 +3939,8 @@ static int doc_createView(LibreOfficeKitDocument* pThis) ...@@ -3863,6 +3939,8 @@ static int doc_createView(LibreOfficeKitDocument* pThis)
static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId) static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId)
{ {
comphelper::ProfileZone aZone("doc_destroyView");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3872,6 +3950,8 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis ...@@ -3872,6 +3950,8 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis
static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId) static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId)
{ {
comphelper::ProfileZone aZone("doc_setView");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3881,6 +3961,8 @@ static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, ...@@ -3881,6 +3961,8 @@ static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/,
static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
{ {
comphelper::ProfileZone aZone("doc_getView");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3890,6 +3972,8 @@ static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) ...@@ -3890,6 +3972,8 @@ static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/)
{ {
comphelper::ProfileZone aZone("doc_getViewsCount");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3899,6 +3983,8 @@ static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThi ...@@ -3899,6 +3983,8 @@ static int doc_getViewsCount(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThi
static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int* pArray, size_t nSize) static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int* pArray, size_t nSize)
{ {
comphelper::ProfileZone aZone("doc_getViewsIds");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3908,6 +3994,8 @@ static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis* ...@@ -3908,6 +3994,8 @@ static bool doc_getViewIds(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*
static void doc_setViewLanguage(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, const char* language) static void doc_setViewLanguage(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId, const char* language)
{ {
comphelper::ProfileZone aZone("doc_setViewLanguage");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -3921,6 +4009,8 @@ unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pTh ...@@ -3921,6 +4009,8 @@ unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pTh
int* pFontWidth, int* pFontWidth,
int* pFontHeight) int* pFontHeight)
{ {
comphelper::ProfileZone aZone("doc_renderFont");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -4034,6 +4124,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW ...@@ -4034,6 +4124,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW
const int nWidth, const int nHeight, const int nWidth, const int nHeight,
const double fDPIScale) const double fDPIScale)
{ {
comphelper::ProfileZone aZone("doc_paintWindowDPI");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -4098,6 +4190,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW ...@@ -4098,6 +4190,8 @@ static void doc_paintWindowDPI(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKW
static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nAction) static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nAction)
{ {
comphelper::ProfileZone aZone("doc_postWindow");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -4123,6 +4217,8 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* pThis, ...@@ -4123,6 +4217,8 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* pThis,
const unsigned char* pCertificateBinary, const int nCertificateBinarySize, const unsigned char* pCertificateBinary, const int nCertificateBinarySize,
const unsigned char* pPrivateKeyBinary, const int nPrivateKeySize) const unsigned char* pPrivateKeyBinary, const int nPrivateKeySize)
{ {
comphelper::ProfileZone aZone("doc_insertCertificate");
if (!xContext.is()) if (!xContext.is())
return false; return false;
...@@ -4196,6 +4292,8 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* pThis, ...@@ -4196,6 +4292,8 @@ static bool doc_insertCertificate(LibreOfficeKitDocument* pThis,
static bool doc_addCertificate(LibreOfficeKitDocument* pThis, static bool doc_addCertificate(LibreOfficeKitDocument* pThis,
const unsigned char* pCertificateBinary, const int nCertificateBinarySize) const unsigned char* pCertificateBinary, const int nCertificateBinarySize)
{ {
comphelper::ProfileZone aZone("doc_addCertificate");
if (!xContext.is()) if (!xContext.is())
return false; return false;
...@@ -4254,6 +4352,8 @@ static bool doc_addCertificate(LibreOfficeKitDocument* pThis, ...@@ -4254,6 +4352,8 @@ static bool doc_addCertificate(LibreOfficeKitDocument* pThis,
static int doc_getSignatureState(LibreOfficeKitDocument* pThis) static int doc_getSignatureState(LibreOfficeKitDocument* pThis)
{ {
comphelper::ProfileZone aZone("doc_getSignatureState");
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis); LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
if (!pDocument->mxComponent.is()) if (!pDocument->mxComponent.is())
...@@ -4276,6 +4376,8 @@ static int doc_getSignatureState(LibreOfficeKitDocument* pThis) ...@@ -4276,6 +4376,8 @@ static int doc_getSignatureState(LibreOfficeKitDocument* pThis)
static char* lo_getError (LibreOfficeKit *pThis) static char* lo_getError (LibreOfficeKit *pThis)
{ {
comphelper::ProfileZone aZone("lo_getError");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis); LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
...@@ -4332,6 +4434,8 @@ static char* lo_getFilterTypes(LibreOfficeKit* pThis) ...@@ -4332,6 +4434,8 @@ static char* lo_getFilterTypes(LibreOfficeKit* pThis)
static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long const features) static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long const features)
{ {
comphelper::ProfileZone aZone("lo_setOptionalFeatures");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -4351,6 +4455,8 @@ static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long con ...@@ -4351,6 +4455,8 @@ static void lo_setOptionalFeatures(LibreOfficeKit* pThis, unsigned long long con
static void lo_setDocumentPassword(LibreOfficeKit* pThis, static void lo_setDocumentPassword(LibreOfficeKit* pThis,
const char* pURL, const char* pPassword) const char* pURL, const char* pPassword)
{ {
comphelper::ProfileZone aZone("lo_setDocumentPassword");
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
if (gImpl) if (gImpl)
gImpl->maLastExceptionMsg.clear(); gImpl->maLastExceptionMsg.clear();
...@@ -4481,7 +4587,7 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit: ...@@ -4481,7 +4587,7 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit:
/// Used only by LibreOfficeKit when used by Online to pre-initialize /// Used only by LibreOfficeKit when used by Online to pre-initialize
static void preloadData() static void preloadData()
{ {
std::cerr << "Preloading dictionaries: "; comphelper::ProfileZone aZone("preload data");
// Create user profile in the temp directory for loading the dictionaries // Create user profile in the temp directory for loading the dictionaries
OUString sUserPath; OUString sUserPath;
...@@ -4501,6 +4607,7 @@ static void preloadData() ...@@ -4501,6 +4607,7 @@ static void preloadData()
css::linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext()); css::linguistic2::LinguServiceManager::create(comphelper::getProcessComponentContext());
css::uno::Reference<linguistic2::XSpellChecker> xSpellChecker(xLngSvcMgr->getSpellChecker()); css::uno::Reference<linguistic2::XSpellChecker> xSpellChecker(xLngSvcMgr->getSpellChecker());
std::cerr << "Preloading dictionaries: ";
css::uno::Reference<linguistic2::XSupportedLocales> xSpellLocales(xSpellChecker, css::uno::UNO_QUERY_THROW); css::uno::Reference<linguistic2::XSupportedLocales> xSpellLocales(xSpellChecker, css::uno::UNO_QUERY_THROW);
uno::Sequence< css::lang::Locale > aLocales = xSpellLocales->getLocales(); uno::Sequence< css::lang::Locale > aLocales = xSpellLocales->getLocales();
for (auto &it : aLocales) for (auto &it : aLocales)
...@@ -4742,8 +4849,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char ...@@ -4742,8 +4849,11 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
if (eStage == PRE_INIT) if (eStage == PRE_INIT)
{ {
{
comphelper::ProfileZone aInit("Init vcl");
std::cerr << "Init vcl\n"; std::cerr << "Init vcl\n";
InitVCL(); InitVCL();
}
// pre-load all component libraries. // pre-load all component libraries.
if (!xContext.is()) if (!xContext.is())
...@@ -4763,10 +4873,15 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char ...@@ -4763,10 +4873,15 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
// 1) defaultBootstrap_InitialComponentContext() // 1) defaultBootstrap_InitialComponentContext()
// 2) comphelper::setProcessServiceFactory(xSFactory); // 2) comphelper::setProcessServiceFactory(xSFactory);
// 3) InitVCL() // 3) InitVCL()
{
comphelper::ProfileZone aInit("preload");
aService->initialize({css::uno::makeAny<OUString>("preload")}); aService->initialize({css::uno::makeAny<OUString>("preload")});
// Force load some modules }
{ // Force load some modules
comphelper::ProfileZone aInit("preload modules");
VclBuilder::preload(); VclBuilder::preload();
VclAbstractDialogFactory::Create(); VclAbstractDialogFactory::Create();
}
preloadData(); preloadData();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment