From dc07ab9df1908a8273a02a096931d019fee5e658 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 17 Sep 2022 21:43:46 +0300 Subject: [PATCH] Replace PROF_COUNTER with PROF_TIMER in some conditional places. --- common/gal/opengl/cached_container.cpp | 2 +- common/gal/opengl/cached_container_gpu.cpp | 4 ++-- common/gal/opengl/cached_container_ram.cpp | 2 +- common/gal/opengl/gpu_manager.cpp | 2 +- common/gal/opengl/opengl_gal.cpp | 2 +- common/view/view.cpp | 2 +- eeschema/files-io.cpp | 2 +- eeschema/sch_edit_frame.cpp | 2 +- pcb_calculator/eserie.cpp | 2 +- pcbnew/connectivity/connectivity_algo.cpp | 4 ++-- pcbnew/connectivity/connectivity_data.cpp | 2 +- pcbnew/ratsnest/ratsnest_data.cpp | 4 ++-- .../tools/polygon_triangulation/polygon_triangulation.cpp | 4 ++-- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/common/gal/opengl/cached_container.cpp b/common/gal/opengl/cached_container.cpp index e14fdee491..c27a8f3a9a 100644 --- a/common/gal/opengl/cached_container.cpp +++ b/common/gal/opengl/cached_container.cpp @@ -309,7 +309,7 @@ void CACHED_CONTAINER::mergeFreeChunks() return; #ifdef KICAD_GAL_PROFILE - PROF_COUNTER totalTime; + PROF_TIMER totalTime; #endif /* KICAD_GAL_PROFILE */ // Reversed free chunks map - this one stores chunk size with its offset as the key diff --git a/common/gal/opengl/cached_container_gpu.cpp b/common/gal/opengl/cached_container_gpu.cpp index 96f0a61547..4ba514f853 100644 --- a/common/gal/opengl/cached_container_gpu.cpp +++ b/common/gal/opengl/cached_container_gpu.cpp @@ -142,7 +142,7 @@ bool CACHED_CONTAINER_GPU::defragmentResize( unsigned int aNewSize ) return false; #ifdef KICAD_GAL_PROFILE - PROF_COUNTER totalTime; + PROF_TIMER totalTime; #endif /* KICAD_GAL_PROFILE */ GLuint newBuffer; @@ -243,7 +243,7 @@ bool CACHED_CONTAINER_GPU::defragmentResizeMemcpy( unsigned int aNewSize ) return false; #ifdef KICAD_GAL_PROFILE - PROF_COUNTER totalTime; + PROF_TIMER totalTime; #endif /* KICAD_GAL_PROFILE */ GLuint newBuffer; diff --git a/common/gal/opengl/cached_container_ram.cpp b/common/gal/opengl/cached_container_ram.cpp index 74528ad7ea..cda553a71f 100644 --- a/common/gal/opengl/cached_container_ram.cpp +++ b/common/gal/opengl/cached_container_ram.cpp @@ -101,7 +101,7 @@ bool CACHED_CONTAINER_RAM::defragmentResize( unsigned int aNewSize ) return false; #ifdef KICAD_GAL_PROFILE - PROF_COUNTER totalTime; + PROF_TIMER totalTime; #endif /* KICAD_GAL_PROFILE */ VERTEX* newBufferMem = static_cast( malloc( aNewSize * VERTEX_SIZE ) ); diff --git a/common/gal/opengl/gpu_manager.cpp b/common/gal/opengl/gpu_manager.cpp index b8e74453cc..259b4f5e48 100644 --- a/common/gal/opengl/gpu_manager.cpp +++ b/common/gal/opengl/gpu_manager.cpp @@ -272,7 +272,7 @@ void GPU_NONCACHED_MANAGER::DrawIndices( const VERTEX_ITEM* aItem ) void GPU_NONCACHED_MANAGER::EndDrawing() { #ifdef KICAD_GAL_PROFILE - PROF_COUNTER totalRealTime; + PROF_TIMER totalRealTime; #endif /* KICAD_GAL_PROFILE */ if( m_container->GetSize() == 0 ) diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index a661c5f428..21010c2521 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -444,7 +444,7 @@ VECTOR2D OPENGL_GAL::getScreenPixelSize() const void OPENGL_GAL::BeginDrawing() { #ifdef KICAD_GAL_PROFILE - PROF_COUNTER totalRealTime( "OPENGL_GAL::beginDrawing()", true ); + PROF_TIMER totalRealTime( "OPENGL_GAL::beginDrawing()", true ); #endif /* KICAD_GAL_PROFILE */ wxASSERT_MSG( m_isContextLocked, "GAL_DRAWING_CONTEXT RAII object should have locked context. " diff --git a/common/view/view.cpp b/common/view/view.cpp index f9cba3ab45..d5e3bc1508 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -1130,7 +1130,7 @@ void VIEW::ClearTargets() void VIEW::Redraw() { #ifdef KICAD_GAL_PROFILE - PROF_COUNTER totalRealTime; + PROF_TIMER totalRealTime; #endif /* KICAD_GAL_PROFILE */ VECTOR2D screenSize = m_gal->GetScreenPixelSize(); diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 8ef3e83fb7..504803b5c9 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -108,7 +108,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in return false; #ifdef PROFILE - PROF_COUNTER openFiles( "OpenProjectFile" ); + PROF_TIMER openFiles( "OpenProjectFile" ); #endif wxFileName pro = fullFileName; diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 4b53c2c4af..83557a2e97 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1478,7 +1478,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags ) SCHEMATIC_SETTINGS& settings = Schematic().Settings(); SCH_SHEET_LIST list = Schematic().GetSheets(); #ifdef PROFILE - PROF_COUNTER timer; + PROF_TIMER timer; #endif // Ensure schematic graph is accurate diff --git a/pcb_calculator/eserie.cpp b/pcb_calculator/eserie.cpp index 2bc0f41ced..63c77104d1 100644 --- a/pcb_calculator/eserie.cpp +++ b/pcb_calculator/eserie.cpp @@ -187,7 +187,7 @@ void E_SERIE::combine4( uint32_t aSize ) m_results.at( S4R ).e_value = m_results.at( S3R ).e_value; // 4R becomes better than 3R solution #ifdef BENCHMARK - PROF_COUNTER timer; // start timer to count execution time + PROF_TIMER timer; // start timer to count execution time #endif for( i = 0; i < aSize; i++ ) // 4R search outer loop diff --git a/pcbnew/connectivity/connectivity_algo.cpp b/pcbnew/connectivity/connectivity_algo.cpp index 6d6c346d53..eb93375468 100644 --- a/pcbnew/connectivity/connectivity_algo.cpp +++ b/pcbnew/connectivity/connectivity_algo.cpp @@ -207,7 +207,7 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem ) void CN_CONNECTIVITY_ALGO::searchConnections() { #ifdef PROFILE - PROF_COUNTER garbage_collection( "garbage-collection" ); + PROF_TIMER garbage_collection( "garbage-collection" ); #endif std::vector garbage; garbage.reserve( 1024 ); @@ -219,7 +219,7 @@ void CN_CONNECTIVITY_ALGO::searchConnections() #ifdef PROFILE garbage_collection.Show(); - PROF_COUNTER search_basic( "search-basic" ); + PROF_TIMER search_basic( "search-basic" ); #endif thread_pool& tp = GetKiCadThreadPool(); diff --git a/pcbnew/connectivity/connectivity_data.cpp b/pcbnew/connectivity/connectivity_data.cpp index de4c2e5c67..a5fc257ecd 100644 --- a/pcbnew/connectivity/connectivity_data.cpp +++ b/pcbnew/connectivity/connectivity_data.cpp @@ -161,7 +161,7 @@ void CONNECTIVITY_DATA::Move( const VECTOR2I& aDelta ) void CONNECTIVITY_DATA::updateRatsnest() { #ifdef PROFILE - PROF_COUNTER rnUpdate( "update-ratsnest" ); + PROF_TIMER rnUpdate( "update-ratsnest" ); #endif std::vector dirty_nets; diff --git a/pcbnew/ratsnest/ratsnest_data.cpp b/pcbnew/ratsnest/ratsnest_data.cpp index 3319dcf2cc..92ef152864 100644 --- a/pcbnew/ratsnest/ratsnest_data.cpp +++ b/pcbnew/ratsnest/ratsnest_data.cpp @@ -317,7 +317,7 @@ void RN_NET::compute( const std::set< std::pair >& aExclusions ) triangEdges.reserve( m_nodes.size() + m_boardEdges.size() ); #ifdef PROFILE - PROF_COUNTER cnt("triangulate"); + PROF_TIMER cnt( "triangulate" ); #endif m_triangulator->Triangulate( triangEdges ); #ifdef PROFILE @@ -331,7 +331,7 @@ void RN_NET::compute( const std::set< std::pair >& aExclusions ) // Get the minimal spanning tree #ifdef PROFILE - PROF_COUNTER cnt2("mst"); + PROF_TIMER cnt2( "mst" ); #endif kruskalMST( triangEdges, aExclusions ); #ifdef PROFILE diff --git a/qa/tools/pcbnew_tools/tools/polygon_triangulation/polygon_triangulation.cpp b/qa/tools/pcbnew_tools/tools/polygon_triangulation/polygon_triangulation.cpp index ac577ffe7d..52c759fde1 100644 --- a/qa/tools/pcbnew_tools/tools/polygon_triangulation/polygon_triangulation.cpp +++ b/qa/tools/pcbnew_tools/tools/polygon_triangulation/polygon_triangulation.cpp @@ -245,11 +245,11 @@ int polygon_triangulation_main( int argc, char *argv[] ) ignore_unused( poly ); #if 0 - PROF_COUNTER unfrac("unfrac"); + PROF_TIMER unfrac("unfrac"); poly.Unfracture( SHAPE_POLY_SET::PM_FAST ); unfrac.Show(); - PROF_COUNTER triangulate("triangulate"); + PROF_TIMER triangulate("triangulate"); for(int i =0; i< poly.OutlineCount(); i++) {