add VIPS_PROFILE env var to enable profiling

This commit is contained in:
John Cupitt 2019-07-19 16:04:07 +01:00
parent 64a6a27326
commit 67ad303d43

View File

@ -109,6 +109,10 @@ int vips__fatal = 0;
*/
GMutex *vips__global_lock = NULL;
/* A debugging timer, zero at library init.
*/
GTimer *vips__global_timer = NULL;
/* Keep a copy of the argv0 here.
*/
static char *vips__argv0 = NULL;
@ -371,7 +375,7 @@ vips_init( const char *argv0 )
#ifndef HAVE_THREAD_NEW
if( !g_thread_supported() )
g_thread_init( NULL );
#endif
#endif /*HAVE_THREAD_NEW*/
vips__threadpool_init();
vips__buffer_init();
@ -385,6 +389,9 @@ vips_init( const char *argv0 )
if( !vips__global_lock )
vips__global_lock = vips_g_mutex_new();
if( !vips__global_timer )
vips__global_timer = g_timer_new();
VIPS_SETSTR( vips__argv0, argv0 );
prgname = g_path_get_basename( argv0 );
@ -419,6 +426,9 @@ vips_init( const char *argv0 )
g_getenv( "IM_INFO" ) )
vips_info_set( TRUE );
if( g_getenv( "VIPS_PROFILE" ) )
vips_profile_set( TRUE );
/* Default various settings from env.
*/
if( g_getenv( "VIPS_TRACE" ) )