include/tools/debug.hxx | 37 ----- include/tools/tools.h | 1 sfx2/source/control/bindings.cxx | 53 ------- sfx2/source/control/dispatch.cxx | 11 - sfx2/source/control/statcach.cxx | 11 - sw/source/core/uibase/docvw/edtwin.cxx | 5 sw/source/core/uibase/uiview/view.cxx | 6 sw/source/core/view/viewsh.cxx | 5 sw/source/ui/frmdlg/column.cxx | 4 tools/source/debug/debug.cxx | 220 --------------------------------- tools/source/generic/toolsin.cxx | 5 vcl/source/app/dbggui.cxx | 21 --- vcl/source/app/svapp.cxx | 1 13 files changed, 5 insertions(+), 375 deletions(-)
New commits: commit cdb473b00a7d56c43df568708c069fa31a07f0a6 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Mar 25 18:48:45 2014 +0100 Remove now unused tools/debug.hxx profiling functionality Change-Id: I13adca8c2f929c8a9226b26ef57b26363dfdf0b3 diff --git a/include/tools/debug.hxx b/include/tools/debug.hxx index 12b9ad4..5574d0d 100644 --- a/include/tools/debug.hxx +++ b/include/tools/debug.hxx @@ -54,7 +54,6 @@ typedef void (*DbgTestSolarMutexProc)(); #define DBG_TEST_XTOR_REPORT (0x00000008) #define DBG_TEST_XTOR_TRACE (0x00000010) -#define DBG_TEST_PROFILING (0x01000000) #define DBG_TEST_RESOURCE (0x02000000) #define DBG_TEST_DIALOG (0x04000000) #define DBG_TEST_BOLDAPPFONT (0x08000000) @@ -96,7 +95,6 @@ struct DbgDataType // Dbg prototypes #define DBG_FUNC_DEBUGSTART 1 #define DBG_FUNC_DEBUGEND 2 -#define DBG_FUNC_GLOBALDEBUGEND 3 #define DBG_FUNC_GETDATA 4 #define DBG_FUNC_SAVEDATA 5 #define DBG_FUNC_SETPRINTMSGBOX 6 @@ -121,11 +119,6 @@ inline void DbgDebugEnd() DbgFunc( DBG_FUNC_DEBUGEND ); } -inline void DbgGlobalDebugEnd() -{ - DbgFunc( DBG_FUNC_GLOBALDEBUGEND ); -} - inline void DbgSetPrintMsgBox( DbgPrintLine pProc ) { DbgFunc( DBG_FUNC_SETPRINTMSGBOX, (void*)(long)pProc ); @@ -246,13 +239,6 @@ TOOLS_DLLPUBLIC void DbgOutTypef( sal_uInt16 nOutType, const sal_Char* pFStr, .. // Dbg test functions -#define DBG_PROF_START 1 -#define DBG_PROF_STOP 2 -#define DBG_PROF_CONTINUE 3 -#define DBG_PROF_PAUSE 4 - -TOOLS_DLLPUBLIC void DbgProf( sal_uInt16 nAction, DbgDataType* ); - #define DBG_XTOR_CTOR 1 #define DBG_XTOR_DTOR 2 #define DBG_XTOR_CHKTHIS 3 @@ -300,19 +286,6 @@ public: #define DBG_DEBUGSTART() DbgDebugStart() #define DBG_DEBUGEND() DbgDebugEnd() -#define DBG_GLOBALDEBUGEND() DbgGlobalDebugEnd() - -#define DBG_PROFSTART( aName ) \ - DbgProf( DBG_PROF_START, DBG_FUNC( aName ) ) - -#define DBG_PROFSTOP( aName ) \ - DbgProf( DBG_PROF_STOP, DBG_FUNC( aName ) ) - -#define DBG_PROFCONTINUE( aName ) \ - DbgProf( DBG_PROF_CONTINUE, DBG_FUNC( aName ) ) - -#define DBG_PROFPAUSE( aName ) \ - DbgProf( DBG_PROF_PAUSE, DBG_FUNC( aName ) ) #define DBG_CTOR( aName, fTest ) \ DbgXtorObj aDbgXtorObj( DBG_FUNC( aName ), \ @@ -385,17 +358,11 @@ typedef const sal_Char* (*DbgUsr)(const void* pThis ); #define DBG_DEBUGSTART() ((void)0) #define DBG_DEBUGEND() ((void)0) -#define DBG_GLOBALDEBUGEND() ((void)0) #define DBG_NAME( aName ) #define DBG_NAMEEX( aName ) #define DBG_NAMEEX_VISIBILITY( aName, vis ) -#define DBG_PROFSTART( aName ) ((void)0) -#define DBG_PROFSTOP( aName ) ((void)0) -#define DBG_PROFCONTINUE( aName ) ((void)0) -#define DBG_PROFPAUSE( aName ) ((void)0) - #define DBG_CTOR( aName, fTest ) ((void)0) #define DBG_DTOR( aName, fTest ) ((void)0) #define DBG_CHKTHIS( aName, fTest ) ((void)0) diff --git a/include/tools/tools.h b/include/tools/tools.h index 342a606..bf0eb32 100644 --- a/include/tools/tools.h +++ b/include/tools/tools.h @@ -25,7 +25,6 @@ // Methoden, die von VCL gerufen werden muessen TOOLS_DLLPUBLIC void InitTools(); TOOLS_DLLPUBLIC void DeInitTools(); -TOOLS_DLLPUBLIC void GlobalDeInitTools(); #endif diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index 1797ab8..0836459 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -84,18 +84,6 @@ public: #define DBG_MAXNAME 28 -struct ProfType -{ - sal_uIntPtr nCount; - sal_uIntPtr nTime; - sal_uIntPtr nMinTime; - sal_uIntPtr nMaxTime; - sal_uIntPtr nStart; - sal_uIntPtr nContinueTime; - sal_uIntPtr nContinueStart; - sal_Char aName[DBG_MAXNAME+1]; -}; - struct XtorType { sal_uIntPtr nCtorCalls; @@ -116,7 +104,6 @@ struct DebugData DbgPrintLine pDbgAbort; ::std::vector< DbgPrintLine > aDbgPrintUserChannels; - PointerList* pProfList; PointerList* pXtorList; DbgTestSolarMutexProc pDbgTestSolarMutex; @@ -125,7 +112,6 @@ struct DebugData ,pDbgPrintMsgBox( NULL ) ,pDbgPrintWindow( NULL ) ,pDbgAbort( NULL ) - ,pProfList( NULL ) ,pXtorList( NULL ) ,pDbgTestSolarMutex( NULL ) { @@ -225,28 +211,6 @@ static bool ImplCoreDump() return true; } -static sal_uIntPtr ImplGetPerfTime() -{ -#if defined( WNT ) - return (sal_uIntPtr)GetTickCount(); -#else - static sal_uIntPtr nImplTicksPerSecond = 0; - static double dImplTicksPerSecond; - sal_uIntPtr nTicks = (sal_uIntPtr)clock(); - - if ( !nImplTicksPerSecond ) - { - nImplTicksPerSecond = CLOCKS_PER_SEC; - dImplTicksPerSecond = nImplTicksPerSecond; - } - - double fTicks = nTicks; - fTicks *= 1000; - fTicks /= dImplTicksPerSecond; - return (sal_uIntPtr)fTicks; -#endif -} - typedef FILE* FILETYPE; #define FileOpen fopen #define FileRead fread @@ -648,7 +612,6 @@ static DebugData* GetDebugData() // elements of the [test] section if ( eCurrentSection == eTest ) { - lcl_tryReadConfigFlag( pLine, nLineLength, "profiling", &aDebugData.aDbgData.nTestFlags, DBG_TEST_PROFILING ); lcl_tryReadConfigFlag( pLine, nLineLength, "resources", &aDebugData.aDbgData.nTestFlags, DBG_TEST_RESOURCE ); lcl_tryReadConfigFlag( pLine, nLineLength, "dialog", &aDebugData.aDbgData.nTestFlags, DBG_TEST_DIALOG ); lcl_tryReadConfigFlag( pLine, nLineLength, "bold_app_font", &aDebugData.aDbgData.nTestFlags, DBG_TEST_BOLDAPPFONT ); @@ -675,8 +638,6 @@ static DebugData* GetDebugData() // initialize debug data if ( aDebugData.aDbgData.nTestFlags & DBG_TEST_XTOR ) aDebugData.pXtorList = new PointerList; - if ( aDebugData.aDbgData.nTestFlags & DBG_TEST_PROFILING ) - aDebugData.pProfList = new PointerList; } return &aDebugData; @@ -868,61 +829,12 @@ static void DebugDeInit() // for global variables will crash, // as pointer alignment won't work then. pData->aDbgData.nTraceOut = nOldOut; - pData->aDbgData.nTestFlags &= DBG_TEST_PROFILING; + pData->aDbgData.nTestFlags = 0; pData->aDbgPrintUserChannels.clear(); pData->pDbgPrintWindow = NULL; ImplDbgDeInitLock(); } -static void DebugGlobalDeInit() -{ - DebugData* pData = GetDebugData(); - sal_uIntPtr i; - sal_uIntPtr nCount; - sal_uIntPtr nOldOut; - - // Output statistics trace data to file - nOldOut = pData->aDbgData.nTraceOut; - pData->aDbgData.nTraceOut = DBG_OUT_FILE; - - // output profile liste - if ( pData->pProfList && pData->pProfList->Count() ) - { - DbgOutf( "------------------------------------------------------------------------------" ); - DbgOutf( "Profiling Report" ); - DbgOutf( "------------------------------------------------------------------------------" ); - DbgOutf( "%-25s : %-9s : %-6s : %-6s : %-6s : %-9s :", - "Prof-List (ms)", "Time", "Min", "Max", "Ave", "Count" ); - DbgOutf( "--------------------------:-----------:--------:--------:--------:-----------:" ); - for( i = 0, nCount = pData->pProfList->Count(); i < nCount; i++ ) - { - ProfType* pProfData = (ProfType*)pData->pProfList->Get( i ); - sal_uIntPtr nAve = pProfData->nTime / pProfData->nCount; - DbgOutf( "%-25s : %9lu : %6lu : %6lu : %6lu : %9lu :", - pProfData->aName, pProfData->nTime, - pProfData->nMinTime, pProfData->nMaxTime, nAve, - pProfData->nCount ); - } - DbgOutf( "==============================================================================" ); - } - - // free profile list - if ( pData->pProfList ) - { - for( i = 0, nCount = pData->pProfList->Count(); i < nCount; i++ ) - { - ProfType* pProfData = (ProfType*)pData->pProfList->Get( i ); - delete pProfData; - } - delete pData->pProfList; - pData->pProfList = NULL; - } - - // disable profiling flags - pData->aDbgData.nTraceOut = nOldOut; - pData->aDbgData.nTestFlags &= ~DBG_TEST_PROFILING; -} - void ImpDbgOutfBuf( sal_Char* pBuf, const sal_Char* pFStr, ... ) { va_list pList; @@ -996,10 +908,6 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam ) DebugDeInit(); break; - case DBG_FUNC_GLOBALDEBUGEND: - DebugGlobalDeInit(); - break; - case DBG_FUNC_SETPRINTMSGBOX: pDebugData->pDbgPrintMsgBox = (DbgPrintLine)(long)pParam; break; @@ -1046,7 +954,6 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam ) lcl_lineFeed( pIniFile ); lcl_startSection( pIniFile, eTest ); - lcl_writeConfigFlag( pIniFile, "profiling", pData->nTestFlags, DBG_TEST_PROFILING ); lcl_writeConfigFlag( pIniFile, "resources", pData->nTestFlags, DBG_TEST_RESOURCE ); lcl_writeConfigFlag( pIniFile, "dialog", pData->nTestFlags, DBG_TEST_DIALOG ); lcl_writeConfigFlag( pIniFile, "bold_app_font", pData->nTestFlags, DBG_TEST_BOLDAPPFONT ); @@ -1094,96 +1001,6 @@ DbgChannelId DbgRegisterUserChannel( DbgPrintLine pProc ) return (DbgChannelId)( pData->aDbgPrintUserChannels.size() - 1 + DBG_OUT_USER_CHANNEL_0 ); } -void DbgProf( sal_uInt16 nAction, DbgDataType* pDbgData ) -{ - DebugData* pData = ImplGetDebugData(); - - if ( !(pData->aDbgData.nTestFlags & DBG_TEST_PROFILING) ) - return; - - ProfType* pProfData = (ProfType*)pDbgData->pData; - sal_uIntPtr nTime; - if ( (nAction != DBG_PROF_START) && !pProfData ) - { - SAL_WARN( - "tools.debug", - "DBG_PROF...() without DBG_PROFSTART(): " << pDbgData->pName); - return; - } - - switch ( nAction ) - { - case DBG_PROF_START: - if ( !pDbgData->pData ) - { - pDbgData->pData = (void*)new ProfType; - pProfData = (ProfType*)pDbgData->pData; - strncpy( pProfData->aName, pDbgData->pName, DBG_MAXNAME ); - pProfData->aName[DBG_MAXNAME] = '\0'; - pProfData->nCount = 0; - pProfData->nTime = 0; - pProfData->nMinTime = 0xFFFFFFFF; - pProfData->nMaxTime = 0; - pProfData->nStart = 0xFFFFFFFF; - pProfData->nContinueTime = 0; - pProfData->nContinueStart = 0xFFFFFFFF; - pData->pProfList->Add( (void*)pProfData ); - } - - if ( pProfData->nStart == 0xFFFFFFFF ) - { - pProfData->nStart = ImplGetPerfTime(); - pProfData->nCount++; - } - break; - - case DBG_PROF_STOP: - nTime = ImplGetPerfTime(); - - if ( pProfData->nStart == 0xFFFFFFFF ) - { - SAL_WARN( - "tools.debug", "DBG_PROF...() without DBG_PROFSTART()"); - return; - } - - if ( pProfData->nContinueStart != 0xFFFFFFFF ) - { - pProfData->nContinueTime += ImplGetPerfTime() - pProfData->nContinueStart; - pProfData->nContinueStart = 0xFFFFFFFF; - } - - nTime -= pProfData->nStart; - nTime -= pProfData->nContinueTime; - - if ( nTime < pProfData->nMinTime ) - pProfData->nMinTime = nTime; - - if ( nTime > pProfData->nMaxTime ) - pProfData->nMaxTime = nTime; - - pProfData->nTime += nTime; - - pProfData->nStart = 0xFFFFFFFF; - pProfData->nContinueTime = 0; - pProfData->nContinueStart = 0xFFFFFFFF; - break; - - case DBG_PROF_CONTINUE: - if ( pProfData->nContinueStart != 0xFFFFFFFF ) - { - pProfData->nContinueTime += ImplGetPerfTime() - pProfData->nContinueStart; - pProfData->nContinueStart = 0xFFFFFFFF; - } - break; - - case DBG_PROF_PAUSE: - if ( pProfData->nContinueStart == 0xFFFFFFFF ) - pProfData->nContinueStart = ImplGetPerfTime(); - break; - } -} - void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis, DbgUsr fDbgUsr ) { @@ -1486,7 +1303,6 @@ void DbgOutf( const sal_Char* pFStr, ... ) void* DbgFunc( sal_uInt16, void* ) { return NULL; } -void DbgProf( sal_uInt16, DbgDataType* ) {} void DbgXtor( DbgDataType*, sal_uInt16, const void*, DbgUsr ) {} void DbgOutTypef( sal_uInt16, const sal_Char*, ... ) {} diff --git a/tools/source/generic/toolsin.cxx b/tools/source/generic/toolsin.cxx index eb549d8..e2bdf91 100644 --- a/tools/source/generic/toolsin.cxx +++ b/tools/source/generic/toolsin.cxx @@ -31,9 +31,4 @@ void DeInitTools() DBG_DEBUGEND(); } -void GlobalDeInitTools() -{ - DBG_GLOBALDEBUGEND(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index 26010b5..614b6c7 100644 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -80,13 +80,6 @@ static const sal_Char* pDbgHelpText[] = "\nOther tests and macros\n", "------------------------------------------\n", "\n", -"Profiling\n", -"DBG_PROFSTART() / DBG_PROFSTOP() / DBG_PROFCONTINUE() / DBG_PROFPAUSE() " -"are evaluated and at the end of the program the number of run throughs " -"and the time this took (including calls to children) in milliseconds is " -"output. These macros can be used to check the same function runs over the " -"entire development period, for example the startup speed. The registered name " -"\n", "Resources\n", "In case of resource errors an error dialog is produced before the " "exception handler is called.\n", @@ -370,7 +363,6 @@ private: CheckBox maXtorTrace; GroupBox maBox1; - CheckBox maProf; CheckBox maRes; CheckBox maDialog; CheckBox maBoldAppFont; @@ -554,7 +546,6 @@ DbgDialog::DbgDialog() : maXtorReport( this ), maXtorTrace( this ), maBox1( this ), - maProf( this ), maRes( this ), maDialog( this ), maBoldAppFont( this ), @@ -636,15 +627,6 @@ DbgDialog::DbgDialog() : } { - maProf.Show(); - maProf.SetText("~Profiling"); - if ( pData->nTestFlags & DBG_TEST_PROFILING ) - maProf.Check( true ); - maProf.SetPosSizePixel( LogicToPixel( Point( 10, 95 ), aAppMap ), - aButtonSize ); - } - - { maRes.Show(); maRes.SetText("~Resourcen"); if ( pData->nTestFlags & DBG_TEST_RESOURCE ) @@ -885,9 +867,6 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton ) if ( maXtorTrace.IsChecked() ) aData.nTestFlags |= DBG_TEST_XTOR_TRACE; - if ( maProf.IsChecked() ) - aData.nTestFlags |= DBG_TEST_PROFILING; - if ( maRes.IsChecked() ) aData.nTestFlags |= DBG_TEST_RESOURCE; diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 6d449df..110e7d4 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -205,7 +205,6 @@ Application::~Application() DeInitSalData(); ImplGetSVData()->mpApp = NULL; ImplDestroySVData(); - GlobalDeInitTools(); } bool Application::QueryExit() commit 62a8fa8fce9c7446a8ec95375b2001058d686619 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Mar 25 18:44:09 2014 +0100 Remove legacy DBG_PROFSART/STOP calls ...probably better done with callgrind, if still relevant at all. Change-Id: I2be614c953d41625f7e11ee7881c2f897ee703d0 diff --git a/sw/source/core/uibase/docvw/edtwin.cxx b/sw/source/core/uibase/docvw/edtwin.cxx index e1947e3..7553024 100644 --- a/sw/source/core/uibase/docvw/edtwin.cxx +++ b/sw/source/core/uibase/docvw/edtwin.cxx @@ -189,8 +189,6 @@ extern bool bExecuteDrag; static SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType ); -DBG_NAME(edithdl) - class SwAnchorMarker { SdrHdl* pHdl; @@ -576,8 +574,6 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) */ IMPL_LINK_NOARG(SwEditWin, TimerHandler) { - DBG_PROFSTART(edithdl); - SwWrtShell &rSh = m_rView.GetWrtShell(); Point aModPt( m_aMovePos ); const SwRect aOldVis( rSh.VisArea() ); @@ -625,7 +621,6 @@ IMPL_LINK_NOARG(SwEditWin, TimerHandler) m_aMovePos += rSh.VisArea().Pos() - aOldVis.Pos(); JustifyAreaTimer(); - DBG_PROFSTOP(edithdl); return 0; } diff --git a/sw/source/core/uibase/uiview/view.cxx b/sw/source/core/uibase/uiview/view.cxx index 75f11e4..fdb8b5d 100644 --- a/sw/source/core/uibase/uiview/view.cxx +++ b/sw/source/core/uibase/uiview/view.cxx @@ -135,8 +135,6 @@ SvxSearchDialog* SwView::m_pSrchDlg = 0; SearchAttrItemList* SwView::m_pSrchList = 0; SearchAttrItemList* SwView::m_pReplList = 0; -DBG_NAME(viewhdl) - inline SfxDispatcher &SwView::GetDispatcher() { return *GetViewFrame()->GetDispatcher(); @@ -517,12 +515,9 @@ IMPL_LINK_NOARG(SwView, AttrChangedNotify) IMPL_LINK_NOARG(SwView, TimeoutHdl) { - DBG_PROFSTART(viewhdl); - if( m_pWrtShell->BasicActionPend() || bNoInterrupt ) { m_aTimer.Start(); - DBG_PROFSTOP(viewhdl); return 0; } @@ -542,7 +537,6 @@ IMPL_LINK_NOARG(SwView, TimeoutHdl) m_bAttrChgNotified = sal_False; GetViewImpl()->GetUNOObject_Impl()->NotifySelChanged(); - DBG_PROFSTOP(viewhdl); return 0; } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 8c144f9..998b5b0 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -80,8 +80,6 @@ BitmapEx* SwViewShell::mpReplaceBmp = NULL; bool bInSizeNotify = false; -DBG_NAME(LayoutIdle) - TYPEINIT0(SwViewShell); using namespace ::com::sun::star; @@ -654,8 +652,6 @@ void SwViewShell::LayoutIdle() #endif { - DBG_PROFSTART( LayoutIdle ); - //Prepare and recover cache, so that it will not get fouled. SwSaveSetLRUOfst aSave( *SwTxtFrm::GetTxtCache(), SwTxtFrm::GetTxtCache()->GetCurMax() - 50 ); @@ -666,7 +662,6 @@ void SwViewShell::LayoutIdle() if(!Imp()) return; SwLayIdle aIdle( GetLayout(), Imp() ); - DBG_PROFSTOP( LayoutIdle ); } } diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 2ffe526..53d4cb0 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -384,8 +384,6 @@ static sal_uInt16 aPageRg[] = { 0 }; -DBG_NAME(columnhdl) - void SwColumnPage::ResetColWidth() { if( nCols ) @@ -1133,7 +1131,6 @@ IMPL_LINK_NOARG(SwColumnPage, Down) ------------------------------------------------------------------------*/ void SwColumnPage::Timeout() { - DBG_PROFSTART(columnhdl) ; if(pModifiedField) { // find the changed column @@ -1171,7 +1168,6 @@ void SwColumnPage::Timeout() pModifiedField = 0; } Update(); - DBG_PROFSTOP(columnhdl) ; } /*------------------------------------------------------------------------ commit 671f7130a34743322d9467a81c9d757333850244 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Mar 25 18:44:03 2014 +0100 Remove legacy DBG_PROFSART/STOP calls ...probably better done with callgrind, if still relevant at all. Change-Id: I15069df4e2f271b0c240231f35af2e664a02c296 diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 9954f9e..037e06c 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -71,18 +71,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; -DBG_NAME(SfxBindingsMsgPos) -DBG_NAME(SfxBindingsUpdateServers) -DBG_NAME(SfxBindingsCreateSet) -DBG_NAME(SfxBindingsUpdateCtrl1) -DBG_NAME(SfxBindingsUpdateCtrl2) -DBG_NAME(SfxBindingsNextJob_Impl0) -DBG_NAME(SfxBindingsNextJob_Impl) -DBG_NAME(SfxBindingsUpdate_Impl) -DBG_NAME(SfxBindingsInvalidateAll) - - - static sal_uInt16 nTimeOut = 300; #define TIMEOUT_FIRST nTimeOut @@ -392,7 +380,6 @@ void SfxBindings::Update_Impl if ( !pDispatcher ) return; - DBG_PROFSTART(SfxBindingsUpdate_Impl); // gather together all with the same status method which are dirty SfxDispatcher &rDispat = *pDispatcher; @@ -435,8 +422,6 @@ void SfxBindings::Update_Impl pRealSlot, pCache ); UpdateControllers_Impl( 0, &aFoundCache, 0, SFX_ITEM_DISABLED); } - - DBG_PROFSTOP(SfxBindingsUpdate_Impl); } @@ -676,7 +661,6 @@ void SfxBindings::InvalidateAll false Slot Server remains valid */ ) { - DBG_PROFSTART(SfxBindingsInvalidateAll); DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" ); if ( pImp->pSubBindings ) @@ -687,7 +671,6 @@ void SfxBindings::InvalidateAll ( pImp->bAllDirty && ( !bWithMsg || pImp->bAllMsgDirty ) ) || SFX_APP()->IsDowning() ) { - DBG_PROFSTOP(SfxBindingsInvalidateAll); return; } @@ -705,8 +688,6 @@ void SfxBindings::InvalidateAll pImp->aTimer.SetTimeout(TIMEOUT_FIRST); pImp->aTimer.Start(); } - - DBG_PROFSTOP(SfxBindingsInvalidateAll); } @@ -717,8 +698,6 @@ void SfxBindings::Invalidate slot IDs (individual, not as a couple!) */ ) { - DBG_PROFSTART(SfxBindingsInvalidateAll); - if ( pImp->bInUpdate ) { sal_Int32 i = 0; @@ -761,8 +740,6 @@ void SfxBindings::Invalidate pImp->aTimer.SetTimeout(TIMEOUT_FIRST); pImp->aTimer.Start(); } - - DBG_PROFSTOP(SfxBindingsInvalidateAll); } @@ -788,8 +765,6 @@ void SfxBindings::InvalidateShell if ( !pDispatcher || pImp->bAllDirty || SFX_APP()->IsDowning() ) return; - DBG_PROFSTART(SfxBindingsInvalidateAll); - // flush now already, it is done in GetShellLevel (rsh) anyway, // important so that is set correctly: pimp-> ball(Msg)Dirty pDispatcher->Flush(); @@ -824,8 +799,6 @@ void SfxBindings::InvalidateShell pImp->nFirstShell = nLevel; } } - - DBG_PROFSTOP(SfxBindingsInvalidateAll); } @@ -913,13 +886,11 @@ bool SfxBindings::IsBound( sal_uInt16 nSlotId, sal_uInt16 nStartSearchAt ) sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt ) { DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); - DBG_PROFSTART(SfxBindingsMsgPos); // answer immediately if a function-seek comes repeated if ( pImp->nCachedFunc1 < pImp->pCaches->size() && (*pImp->pCaches)[pImp->nCachedFunc1]->GetId() == nId ) { - DBG_PROFSTOP(SfxBindingsMsgPos); return pImp->nCachedFunc1; } if ( pImp->nCachedFunc2 < pImp->pCaches->size() && @@ -929,19 +900,16 @@ sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt ) sal_uInt16 nTemp = pImp->nCachedFunc1; pImp->nCachedFunc1 = pImp->nCachedFunc2; pImp->nCachedFunc2 = nTemp; - DBG_PROFSTOP(SfxBindingsMsgPos); return pImp->nCachedFunc1; } // binary search, if not found, seek to target-position if ( pImp->pCaches->size() <= nStartSearchAt ) { - DBG_PROFSTOP(SfxBindingsMsgPos); return 0; } if ( (sal_uInt16) pImp->pCaches->size() == (nStartSearchAt+1) ) { - DBG_PROFSTOP(SfxBindingsMsgPos); return (*pImp->pCaches)[nStartSearchAt]->GetId() >= nId ? 0 : 1; } sal_uInt16 nLow = nStartSearchAt; @@ -977,7 +945,6 @@ sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt ) nId < (*pImp->pCaches)[nPos+1]->GetId(), "" ); pImp->nCachedFunc2 = pImp->nCachedFunc1; pImp->nCachedFunc1 = nPos; - DBG_PROFSTOP(SfxBindingsMsgPos); return nPos; } @@ -1297,7 +1264,6 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell void SfxBindings::UpdateSlotServer_Impl() { - DBG_PROFSTART(SfxBindingsUpdateServers); DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); // synchronize @@ -1324,8 +1290,6 @@ void SfxBindings::UpdateSlotServer_Impl() pImp->bMsgDirty = pImp->bAllMsgDirty = sal_False; Broadcast( SfxSimpleHint(SFX_HINT_DOCCHANGED) ); - - DBG_PROFSTOP(SfxBindingsUpdateServers); } @@ -1346,7 +1310,6 @@ SfxItemSet* SfxBindings::CreateSet_Impl if(!pMsgSvr || !pDispatcher) return 0; - DBG_PROFSTART(SfxBindingsCreateSet); pRealSlot = 0; *pMsgServer = pMsgSvr; @@ -1466,7 +1429,6 @@ SfxItemSet* SfxBindings::CreateSet_Impl pRanges[j] = 0; // terminating NULL SfxItemSet *pSet = new SfxItemSet(rPool, pRanges.get()); pRanges.reset(); - DBG_PROFSTOP(SfxBindingsCreateSet); return pSet; } @@ -1482,7 +1444,6 @@ void SfxBindings::UpdateControllers_Impl { DBG_ASSERT( !pFound->pSlot || SFX_KIND_ENUM != pFound->pSlot->GetKind(), "direct update of enum slot isn't allowed" ); - DBG_PROFSTART(SfxBindingsUpdateCtrl1); SfxStateCache* pCache = pFound->pCache; const SfxSlot* pSlot = pFound->pSlot; @@ -1509,11 +1470,8 @@ void SfxBindings::UpdateControllers_Impl pCache->SetState(SFX_ITEM_AVAILABLE, pItem); } - DBG_PROFSTOP(SfxBindingsUpdateCtrl1); - // Update the slots for so far available and bound Controllers for // Slave-Slots (Enum-value) - DBG_PROFSTART(SfxBindingsUpdateCtrl2); DBG_ASSERT( !pSlot || 0 == pSlot->GetLinkedSlot() || !pItem || pItem->ISA(SfxEnumItemInterface), "master slot with non-enum-type found" ); @@ -1576,8 +1534,6 @@ void SfxBindings::UpdateControllers_Impl break; } } - - DBG_PROFSTOP(SfxBindingsUpdateCtrl2); } @@ -1595,8 +1551,6 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" ); - DBG_PROFSTART(SfxBindingsNextJob_Impl0); - if ( Application::GetLastInputInterval() < MAX_INPUT_DELAY && pTimer ) { pImp->aTimer.SetTimeout(TIMEOUT_UPDATING); @@ -1612,12 +1566,10 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) SfxViewFrame* pFrame = pDispatcher ? pDispatcher->GetFrame() : NULL; if ( (pFrame && !pFrame->GetObjectShell()->AcceptStateUpdate()) || pSfxApp->IsDowning() || pImp->pCaches->empty() ) { - DBG_PROFSTOP(SfxBindingsNextJob_Impl0); return sal_True; } if ( !pDispatcher || !pDispatcher->IsFlushed() ) { - DBG_PROFSTOP(SfxBindingsNextJob_Impl0); return sal_True; } @@ -1625,12 +1577,9 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) if ( pImp->bMsgDirty ) { UpdateSlotServer_Impl(); - DBG_PROFSTOP(SfxBindingsNextJob_Impl0); return sal_False; } - DBG_PROFSTOP(SfxBindingsNextJob_Impl0); - DBG_PROFSTART(SfxBindingsNextJob_Impl); pImp->bAllDirty = sal_False; pImp->aTimer.SetTimeout(TIMEOUT_UPDATING); @@ -1672,7 +1621,6 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) if ( bWasDirty && !bJobDone && bPreEmptive && (--nLoops == 0) ) { - DBG_PROFSTOP(SfxBindingsNextJob_Impl); pImp->bInNextJob = sal_False; return sal_False; } @@ -1702,7 +1650,6 @@ IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer ) // Update round is finished pImp->bInNextJob = sal_False; Broadcast(SfxSimpleHint(SFX_HINT_UPDATEDONE)); - DBG_PROFSTOP(SfxBindingsNextJob_Impl); return sal_True; #ifdef DBG_UTIL } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 1f8da2e..691166c 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -64,9 +64,6 @@ #include <slotserv.hxx> #include <workwin.hxx> -DBG_NAME(SfxDispatcherFlush) -DBG_NAME(SfxDispatcherFillState) - typedef std::vector<SfxShell*> SfxShellStack_Impl; typedef std::vector<SfxRequest*> SfxRequestPtrArray; @@ -1601,7 +1598,6 @@ void SfxDispatcher::FlushImpl() */ { - DBG_PROFSTART(SfxDispatcherFlush); SFX_STACK(SfxDispatcher::FlushImpl); OSL_TRACE("Flushing dispatcher!"); @@ -1615,7 +1611,6 @@ void SfxDispatcher::FlushImpl() if ( !pImp->bFlushing ) { pImp->bFlushing = true; - DBG_PROFSTOP(SfxDispatcherFlush); return; } @@ -1734,7 +1729,6 @@ void SfxDispatcher::FlushImpl() if( bAwakeBindings && GetBindings() ) GetBindings()->DLEAVEREGISTRATIONS(); - DBG_PROFSTOP(SfxDispatcherFlush); for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++) pImp->aFixedObjBars[n].nResId = 0; @@ -2068,13 +2062,10 @@ bool SfxDispatcher::_FillState { SFX_STACK(SfxDispatcher::_FillState); - DBG_PROFSTART(SfxDispatcherFillState); - const SfxSlot *pSlot = rSvr.GetSlot(); if ( pSlot && IsLocked( pSlot->GetSlotId() ) ) { pImp->bInvalidateOnUnlock = true; - DBG_PROFSTOP(SfxDispatcherFillState); return false; } @@ -2120,11 +2111,9 @@ bool SfxDispatcher::_FillState } #endif - DBG_PROFSTOP(SfxDispatcherFillState); return true; } - DBG_PROFSTOP(SfxDispatcherFillState); return false; } diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx index 82203b2..b7efaed 100644 --- a/sfx2/source/control/statcach.cxx +++ b/sfx2/source/control/statcach.cxx @@ -53,12 +53,6 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; - - -DBG_NAME(SfxStateCache) -DBG_NAME(SfxStateCacheSetState) - - BindDispatch_Impl::BindDispatch_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > & rDisp, const ::com::sun::star::util::URL& rURL, SfxStateCache *pStateCache, const SfxSlot* pS ) : xDisp( rDisp ) , aURL( rURL ) @@ -412,7 +406,6 @@ void SfxStateCache::SetState_Impl DBG_ASSERT( bMaybeDirty || !bSlotDirty, "setting state of dirty message" ); DBG_ASSERT( SfxControllerItem::GetItemState(pState) == eState, "invalid SfxItemState" ); - DBG_PROFSTART(SfxStateCacheSetState); // does the controller have to be notified at all? bool bNotify = bItemDirty; @@ -454,7 +447,6 @@ void SfxStateCache::SetState_Impl } bCtrlDirty = sal_False; - DBG_PROFSTOP(SfxStateCacheSetState); } @@ -464,7 +456,6 @@ void SfxStateCache::SetState_Impl void SfxStateCache::SetCachedState( sal_Bool bAlways ) { DBG_ASSERT(pController==NULL||pController->GetId()==nId, "Cache with wrong ControllerItem" ); - DBG_PROFSTART(SfxStateCacheSetState); // Only update if cached item exists and also able to process. // (If the State is sent, it must be ensured that a SlotServer is present, @@ -486,8 +477,6 @@ void SfxStateCache::SetCachedState( sal_Bool bAlways ) // Controller is now ok bCtrlDirty = sal_True; } - - DBG_PROFSTOP(SfxStateCacheSetState); } commit 2ab3bae2cff8a51ba11e68539d75d21f826d9481 Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Mar 25 16:42:43 2014 +0100 Reduce some functions to local Change-Id: Ia2d7eaaa1381fe46839b0d52a91bdc3a439fa418 diff --git a/include/tools/debug.hxx b/include/tools/debug.hxx index be726bb..12b9ad4 100644 --- a/include/tools/debug.hxx +++ b/include/tools/debug.hxx @@ -241,12 +241,8 @@ inline void DbgPrintFile( const sal_Char* pLine ) #define DBG_OUT_TRACE 1 #define DBG_OUT_ERROR 2 -TOOLS_DLLPUBLIC void DbgOut( const sal_Char* pMsg, sal_uInt16 nOutType = DBG_OUT_TRACE, - const sal_Char* pFile = NULL, sal_uInt16 nLine = 0 ); TOOLS_DLLPUBLIC void DbgPrintShell(char const * message); TOOLS_DLLPUBLIC void DbgOutTypef( sal_uInt16 nOutType, const sal_Char* pFStr, ... ); -TOOLS_DLLPUBLIC void DbgOutf( const sal_Char* pFStr, ... ); -TOOLS_DLLPUBLIC void ImpDbgOutfBuf( sal_Char* pBuf, const sal_Char* pFStr, ... ); // Dbg test functions diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index a52f1e4..1797ab8 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -47,6 +47,8 @@ #ifdef DBG_UTIL +void DbgOutf( const sal_Char* pFStr, ... ); + // PointerList #define PBLOCKCOUNT 1024 @@ -1335,7 +1337,7 @@ void DbgXtor( DbgDataType* pDbgData, sal_uInt16 nAction, const void* pThis, : "Leave method from class ") << pDbgData->pName); } -void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sal_uInt16 nLine ) +void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut ) { static bool bIn = false; if ( bIn ) @@ -1391,32 +1393,6 @@ void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sa else strcpy( &(aBufOut[nBufLen]), pMsg ); - if ( pFile && nLine && (nBufLen+nMsgLen < DBG_BUF_MAXLEN) ) - { - if ( nOut == DBG_OUT_MSGBOX ) - strcat( aBufOut, "\n" ); - else - strcat( aBufOut, " " ); - strcat( aBufOut, "From File " ); - strcat( aBufOut, pFile ); - strcat( aBufOut, " at Line " ); - - // Convert line to String and append - sal_Char aLine[9]; - sal_Char* pLine = &aLine[7]; - sal_uInt16 i; - memset( aLine, 0, sizeof( aLine ) ); - do - { - i = nLine % 10; - pLine--; - *(pLine) = (sal_Char)i + 48; - nLine /= 10; - } - while ( nLine ); - strcat( aBufOut, pLine ); - } - if ( ( nOut >= DBG_OUT_USER_CHANNEL_0 ) && ( nOut - DBG_OUT_USER_CHANNEL_0 < pData->aDbgPrintUserChannels.size() ) ) { DbgPrintLine pPrinter = pData->aDbgPrintUserChannels[ nOut - DBG_OUT_USER_CHANNEL_0 ]; @@ -1503,7 +1479,7 @@ void DbgOutf( const sal_Char* pFStr, ... ) vsprintf( aBuf, pFStr, pList ); va_end( pList ); - DbgOut( aBuf ); + DbgOut( aBuf, DBG_OUT_TRACE ); } #else @@ -1513,9 +1489,7 @@ void* DbgFunc( sal_uInt16, void* ) { return NULL; } void DbgProf( sal_uInt16, DbgDataType* ) {} void DbgXtor( DbgDataType*, sal_uInt16, const void*, DbgUsr ) {} -void DbgOut( const sal_Char*, sal_uInt16, const sal_Char*, sal_uInt16 ) {} void DbgOutTypef( sal_uInt16, const sal_Char*, ... ) {} -void DbgOutf( const sal_Char*, ... ) {} #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits