kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #27060
[PATCH 3/4] Switch profiled code to uppercase PROF_COUNTER
---
common/gal/opengl/cached_container.cpp | 15 ++++++---------
common/gal/opengl/gpu_manager.cpp | 10 ++++------
common/gal/opengl/opengl_gal.cpp | 10 ++++------
common/view/view.cpp | 5 ++---
4 files changed, 16 insertions(+), 24 deletions(-)
diff --git a/common/gal/opengl/cached_container.cpp b/common/gal/opengl/cached_container.cpp
index bea0dec3f..84fbe5137 100644
--- a/common/gal/opengl/cached_container.cpp
+++ b/common/gal/opengl/cached_container.cpp
@@ -342,8 +342,7 @@ void CACHED_CONTAINER::mergeFreeChunks()
return;
#ifdef __WXDEBUG__
- prof_counter totalTime;
- prof_start( &totalTime );
+ PROF_COUNTER totalTime( "CACHED_CONTAINER::mergeFreeChunks()", true );
#endif /* __WXDEBUG__ */
// Reversed free chunks map - this one stores chunk size with its offset as the key
@@ -387,7 +386,7 @@ void CACHED_CONTAINER::mergeFreeChunks()
m_freeChunks.insert( std::make_pair( size, offset ) );
#ifdef __WXDEBUG__
- prof_end( &totalTime );
+ totalTime.stop();
wxLogDebug( wxT( "Merged free chunks / %.1f ms" ), totalTime.msecs() );
#endif /* __WXDEBUG__ */
@@ -412,8 +411,7 @@ bool CACHED_CONTAINER::defragmentResize( unsigned int aNewSize )
return false;
#ifdef __WXDEBUG__
- prof_counter totalTime;
- prof_start( &totalTime );
+ PROF_COUNTER totalTime( "CACHED_CONTAINER::defragmentResize()", true );
#endif /* __WXDEBUG__ */
GLuint newBuffer;
@@ -481,7 +479,7 @@ bool CACHED_CONTAINER::defragmentResize( unsigned int aNewSize )
checkGlError( "switching buffers during defragmentation" );
#ifdef __WXDEBUG__
- prof_end( &totalTime );
+ totalTime.stop();
wxLogTrace( "GAL_CACHED_CONTAINER",
wxT( "Defragmented container storing %d vertices / %.1f ms" ),
@@ -512,8 +510,7 @@ bool CACHED_CONTAINER::defragmentResizeMemcpy( unsigned int aNewSize )
return false;
#ifdef __WXDEBUG__
- prof_counter totalTime;
- prof_start( &totalTime );
+ PROF_COUNTER totalTime( "CACHED_CONTAINER::defragmentResizeMemcpy()", true );
#endif /* __WXDEBUG__ */
GLuint newBuffer;
@@ -575,7 +572,7 @@ bool CACHED_CONTAINER::defragmentResizeMemcpy( unsigned int aNewSize )
checkGlError( "switching buffers during defragmentation" );
#ifdef __WXDEBUG__
- prof_end( &totalTime );
+ totalTime.stop();
wxLogTrace( "GAL_CACHED_CONTAINER",
wxT( "Defragmented container storing %d vertices / %.1f ms" ),
diff --git a/common/gal/opengl/gpu_manager.cpp b/common/gal/opengl/gpu_manager.cpp
index dc4f21009..0ee32d10f 100644
--- a/common/gal/opengl/gpu_manager.cpp
+++ b/common/gal/opengl/gpu_manager.cpp
@@ -145,8 +145,7 @@ void GPU_CACHED_MANAGER::DrawAll()
void GPU_CACHED_MANAGER::EndDrawing()
{
#ifdef __WXDEBUG__
- prof_counter totalRealTime;
- prof_start( &totalRealTime );
+ PROF_COUNTER totalRealTime( "GPU_CACHED_MANAGER::EndDrawing()", true );
#endif /* __WXDEBUG__ */
wxASSERT( m_isDrawing );
@@ -205,7 +204,7 @@ void GPU_CACHED_MANAGER::EndDrawing()
m_isDrawing = false;
#ifdef __WXDEBUG__
- prof_end( &totalRealTime );
+ totalRealTime.stop();
wxLogTrace( "GAL_PROFILE",
wxT( "GPU_CACHED_MANAGER::EndDrawing(): %.1f ms" ), totalRealTime.msecs() );
#endif /* __WXDEBUG__ */
@@ -251,8 +250,7 @@ void GPU_NONCACHED_MANAGER::DrawAll()
void GPU_NONCACHED_MANAGER::EndDrawing()
{
#ifdef __WXDEBUG__
- prof_counter totalRealTime;
- prof_start( &totalRealTime );
+ PROF_COUNTER totalRealTime( "GPU_NONCACHED_MANAGER::EndDrawing()", true );
#endif /* __WXDEBUG__ */
if( m_container->GetSize() == 0 )
@@ -296,7 +294,7 @@ void GPU_NONCACHED_MANAGER::EndDrawing()
}
#ifdef __WXDEBUG__
- prof_end( &totalRealTime );
+ totalRealTime.stop();
wxLogTrace( "GAL_PROFILE",
wxT( "GPU_NONCACHED_MANAGER::EndDrawing(): %.1f ms" ), totalRealTime.msecs() );
#endif /* __WXDEBUG__ */
diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp
index 3c4cfe2c5..c24e28b34 100644
--- a/common/gal/opengl/opengl_gal.cpp
+++ b/common/gal/opengl/opengl_gal.cpp
@@ -193,8 +193,7 @@ void OPENGL_GAL::BeginDrawing()
return;
#ifdef __WXDEBUG__
- prof_counter totalRealTime;
- prof_start( &totalRealTime );
+ PROF_COUNTER totalRealTime( "OPENGL_GAL::BeginDrawing()", true );
#endif /* __WXDEBUG__ */
GL_CONTEXT_MANAGER::Get().LockCtx( glPrivContext, this );
@@ -308,7 +307,7 @@ void OPENGL_GAL::BeginDrawing()
compositor->SetBuffer( OPENGL_COMPOSITOR::DIRECT_RENDERING );
#ifdef __WXDEBUG__
- prof_end( &totalRealTime );
+ totalRealTime.stop();
wxLogTrace( "GAL_PROFILE",
wxT( "OPENGL_GAL::BeginDrawing(): %.1f ms" ), totalRealTime.msecs() );
#endif /* __WXDEBUG__ */
@@ -318,8 +317,7 @@ void OPENGL_GAL::BeginDrawing()
void OPENGL_GAL::EndDrawing()
{
#ifdef __WXDEBUG__
- prof_counter totalRealTime;
- prof_start( &totalRealTime );
+ PROF_COUNTER totalRealTime( "OPENGL_GAL::EndDrawing()", true );
#endif /* __WXDEBUG__ */
// Cached & non-cached containers are rendered to the same buffer
@@ -343,7 +341,7 @@ void OPENGL_GAL::EndDrawing()
GL_CONTEXT_MANAGER::Get().UnlockCtx( glPrivContext );
#ifdef __WXDEBUG__
- prof_end( &totalRealTime );
+ totalRealTime.stop();
wxLogTrace( "GAL_PROFILE", wxT( "OPENGL_GAL::EndDrawing(): %.1f ms" ), totalRealTime.msecs() );
#endif /* __WXDEBUG__ */
}
diff --git a/common/view/view.cpp b/common/view/view.cpp
index 2f09553fa..fae66d394 100644
--- a/common/view/view.cpp
+++ b/common/view/view.cpp
@@ -999,8 +999,7 @@ void VIEW::ClearTargets()
void VIEW::Redraw()
{
#ifdef __WXDEBUG__
- prof_counter totalRealTime;
- prof_start( &totalRealTime );
+ PROF_COUNTER totalRealTime( "VIEW::Redraw()", true );
#endif /* __WXDEBUG__ */
VECTOR2D screenSize = m_gal->GetScreenPixelSize();
@@ -1016,7 +1015,7 @@ void VIEW::Redraw()
markTargetClean( TARGET_OVERLAY );
#ifdef __WXDEBUG__
- prof_end( &totalRealTime );
+ totalRealTime.stop();
wxLogTrace( "GAL_PROFILE", wxT( "VIEW::Redraw(): %.1f ms" ), totalRealTime.msecs() );
#endif /* __WXDEBUG__ */
}
Follow ups
References