diff --git a/libvips/colour/colour.c b/libvips/colour/colour.c index 686b08af..f313851d 100644 --- a/libvips/colour/colour.c +++ b/libvips/colour/colour.c @@ -248,13 +248,11 @@ vips_colour_gen( VipsRegion *or, VipsRegion **ir = (VipsRegion **) seq; VipsColour *colour = VIPS_COLOUR( b ); VipsColourClass *class = VIPS_COLOUR_GET_CLASS( colour ); - Rect *r = &or->valid; + VipsRect *r = &or->valid; - VipsPel *p[MAX_INPUT_IMAGES], *q; int i, y; + VipsPel *p[MAX_INPUT_IMAGES], *q; - /* Prepare all input regions and make buffer pointers. - */ for( i = 0; ir[i]; i++ ) if( vips_region_prepare( ir[i], r ) ) return( -1 ); diff --git a/libvips/iofuncs/gate.c b/libvips/iofuncs/gate.c index eadf10a0..9b150b39 100644 --- a/libvips/iofuncs/gate.c +++ b/libvips/iofuncs/gate.c @@ -191,7 +191,7 @@ vips__thread_profile_attach( const char *thread_name ) profile = g_new( VipsThreadProfile, 1 ); profile->name = thread_name; profile->gates = g_hash_table_new_full( - g_str_hash, g_str_equal, + g_direct_hash, g_str_equal, NULL, (GDestroyNotify) vips_thread_gate_free ); g_private_set( vips_thread_profile_key, profile ); } diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c index a923aba1..a8b38926 100644 --- a/libvips/iofuncs/init.c +++ b/libvips/iofuncs/init.c @@ -225,7 +225,7 @@ vips__init( const char *argv0 ) * happens, since vips__thread_profile may not be set yet. Call * directly. */ - vips__thread_gate_start( "main" ); + vips__thread_gate_start( "init: main" ); /* Try to discover our prefix. */ @@ -382,13 +382,14 @@ vips_shutdown( void ) im_close_plugins(); - /* Mustn't run this more than once. + /* Mustn't run this more than once. Don't use the VIPS_GATE macro, + * since we don't for gate start. */ { static gboolean done = FALSE; if( !done ) - VIPS_GATE_STOP( "main" ); + vips__thread_gate_stop( "init: main" ); } vips__thread_profile_detach(); diff --git a/libvips/iofuncs/sinkdisc.c b/libvips/iofuncs/sinkdisc.c index 64b7545c..443b7128 100644 --- a/libvips/iofuncs/sinkdisc.c +++ b/libvips/iofuncs/sinkdisc.c @@ -168,12 +168,12 @@ wbuffer_write( WriteBuffer *wbuffer ) VIPS_DEBUG_MSG( "wbuffer_write: %d bytes from wbuffer %p\n", wbuffer->region->bpl * wbuffer->area.height, wbuffer ); - VIPS_GATE_START( "wbuffer_write: " ); + VIPS_GATE_START( "wbuffer_write: work" ); wbuffer->write_errno = write->write_fn( wbuffer->region, &wbuffer->area, write->a ); - VIPS_GATE_STOP( "wbuffer_write: " ); + VIPS_GATE_STOP( "wbuffer_write: work" ); } /* Run this as a thread to do a BG write. diff --git a/libvips/iofuncs/threadpool.c b/libvips/iofuncs/threadpool.c index a39b07c2..1f0d883c 100644 --- a/libvips/iofuncs/threadpool.c +++ b/libvips/iofuncs/threadpool.c @@ -593,13 +593,15 @@ vips_thread_main_loop( void *a ) g_assert( pool == thr->pool ); - VIPS_GATE_START( "vips_thread_main_loop:" ); + VIPS_GATE_START( "vips_thread_main_loop: thread" ); /* Process work units! Always tick, even if we are stopping, so the * main thread will wake up for exit. */ for(;;) { + VIPS_GATE_START( "vips_thread_work_unit: u" ); vips_thread_work_unit( thr ); + VIPS_GATE_STOP( "vips_thread_work_unit: u" ); vips_semaphore_up( &pool->tick ); if( pool->stop || pool->error ) @@ -610,7 +612,7 @@ vips_thread_main_loop( void *a ) */ vips_semaphore_up( &pool->finish ); - VIPS_GATE_STOP( "vips_thread_main_loop:" ); + VIPS_GATE_STOP( "vips_thread_main_loop: thread" ); return( NULL ); } diff --git a/tools/vipsprofile b/tools/vipsprofile index 94f92d5c..b6c99d05 100755 --- a/tools/vipsprofile +++ b/tools/vipsprofile @@ -54,9 +54,9 @@ class Event: self.work = False self.wait = False - if re.match('.*?: .*work.*', gate_name): + if re.match('.*work.*', gate_name): self.work = True - if re.match('.*?: .*wait.*', gate_name): + if re.match('.*wait.*', gate_name): self.wait = True thread.events.append(self) @@ -79,6 +79,7 @@ with ReadFile(input_filename) as rf: match = re.match('thread: (.*)', rf.line) if not match: print 'parse error line %d, expected "thread"' % rf.lineno + print rf.line thread_name = match.group(1) + " " + str(thread_id) thread_id += 1 thread = Thread(thread_name) @@ -86,13 +87,10 @@ with ReadFile(input_filename) as rf: rf.getnext() while True: - match = re.match('gate: (.*)', rf.line) + match = re.match('gate: (.*?): (.*)', rf.line) if not match: break - gate_name = match.group(1) - match = re.match('vips_(.*)', gate_name) - if match: - gate_name = match.group(1) + gate_name = match.group(2) rf.getnext() match = re.match('start:', rf.line)