diff --git a/src/queue.c b/src/queue.c index 66429a4c56e5706aa43eb6c4fb383a22425c0700..dba27a663e71fb22698995916b4f79f8d2197a27 100644 --- a/src/queue.c +++ b/src/queue.c @@ -29,33 +29,12 @@ #include "cycle.h" #include "lock.h" #include "task.h" +#include "timers.h" #include "cell.h" #include "queue.h" #include "error.h" #include "inline.h" -/* Define the timer macros. */ -#ifdef TIMER_VERBOSE - #ifndef TIMER - #define TIMER - #endif -#endif -#ifdef TIMER - #define TIMER_TIC ticks tic = getticks(); - #define TIMER_TOC(t) timer_toc( t , tic ) - #define TIMER_TIC2 ticks tic2 = getticks(); - #define TIMER_TOC2(t) timer_toc( t , tic2 ) - INLINE static ticks timer_toc ( int t , ticks tic ) { - ticks d = (getticks() - tic); - __sync_add_and_fetch( &queue_timer[t] , d ); - return d; - } -#else - #define TIMER_TIC - #define TIMER_TOC(t) - #define TIMER_TIC2 - #define TIMER_TOC2(t) -#endif /* Counter macros. */ @@ -66,9 +45,6 @@ #endif -/* The timers. */ -ticks queue_timer[ queue_timer_count ]; - /* The counters. */ int queue_counter[ queue_counter_count ]; @@ -174,7 +150,7 @@ struct task *queue_gettask ( struct queue *q , int qid , int blocking ) { /* If there are no tasks, leave immediately. */ if ( q->count == 0 ) { - TIMER_TOC(queue_timer_gettask); + TIMER_TOC(timer_queue); return NULL; } @@ -288,7 +264,7 @@ struct task *queue_gettask ( struct queue *q , int qid , int blocking ) { } /* while there are tasks. */ /* Take the money and run. */ - TIMER_TOC(queue_timer_gettask); + TIMER_TOC(timer_queue); return res; } diff --git a/src/queue.h b/src/queue.h index f15664be93a4a00516614911b9826cfe41458220..37aa20c4e8ff2130bdd94b84b646ab1b17794c62 100644 --- a/src/queue.h +++ b/src/queue.h @@ -24,16 +24,6 @@ #define queue_sizegrow 2 -/* The queue timers themselves. */ -enum { - queue_timer_none = 0, - queue_timer_gettask, - queue_timer_bubble, - queue_timer_count, - }; -extern ticks queue_timer[ queue_timer_count ]; - - /* Counters. */ enum { queue_counter_swap = 0, diff --git a/src/runner.c b/src/runner.c index d6154f5c4095e0dd18b442c5b404f6b7e7c58c13..03c14350a850b3c3d169e3940bc892abd00cd2bc 100644 --- a/src/runner.c +++ b/src/runner.c @@ -792,7 +792,7 @@ void *runner_main ( void *data ) { /* Get a task, how and from where depends on the policy. */ TIMER_TIC t = scheduler_gettask( sched , qid ); - TIMER_TOC(timer_getpair); + TIMER_TOC(timer_gettask); /* Did I get anything? */ if ( t == NULL ) diff --git a/src/scheduler.c b/src/scheduler.c index 4ae16f236589331d2041b1c7b9d3d0efa4131d50..18515ff1da2ce5982f8cd681ad0b064a1840d328 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -741,7 +741,7 @@ struct task *scheduler_gettask ( struct scheduler *s , int qid ) { struct task *res = NULL; int k, nr_queues = s->nr_queues; - + /* Loop as long as there are tasks... */ while ( s->waiting > 0 && res == NULL ) { diff --git a/src/timers.h b/src/timers.h index eb83b6f43a0f95605a507530b42c83abb4551a43..071ee6a7220135e7cd39e8353334d176407d78e9 100644 --- a/src/timers.h +++ b/src/timers.h @@ -34,8 +34,8 @@ enum { timer_dosub_force, timer_dopair_subset, timer_doghost, - timer_getpair, - timer_steal, + timer_gettask, + timer_queue, timer_stalled, timer_runners, timer_step,