On Thursday 10 January 2008 03:12:36 Sebastien Dugue wrote:
> Perform some cleanups on pi_perf:
>
> - remove low_hist and low_quantiles calculations, those are never
> used. - move stats recording in low_prio_thread() past the mutex
> unlock. - ditto in high_prio_thread().
>
> Signed-off-by: Sebastien Dugue <[EMAIL PROTECTED]>
Acked-by: Darren Hart <[EMAIL PROTECTED]>
> Cc: Darren Hart <[EMAIL PROTECTED]>
> Cc: Tim Chavez <[EMAIL PROTECTED]>
> ---
> testcases/realtime/func/pi_perf/pi_perf.c | 19 ++++++++-----------
> 1 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/testcases/realtime/func/pi_perf/pi_perf.c
> b/testcases/realtime/func/pi_perf/pi_perf.c index 47fc0a7..d89fa62
> 100644
> --- a/testcases/realtime/func/pi_perf/pi_perf.c
> +++ b/testcases/realtime/func/pi_perf/pi_perf.c
> @@ -75,8 +75,8 @@ static unsigned int busy_work_time;
> static int num_busy = -1;
>
> stats_container_t high_dat, low_dat, wait_dat;
> -stats_container_t wait_hist, low_hist;
> -stats_quantiles_t wait_quantiles, low_quantiles;
> +stats_container_t wait_hist;
> +stats_quantiles_t wait_quantiles;
>
> void usage(void)
> {
> @@ -132,8 +132,6 @@ void * low_prio_thread(void *arg)
> unsigned int i;
>
> stats_container_init(&low_dat, iterations);
> - stats_container_init(&low_hist, HIST_BUCKETS);
> - stats_quantiles_init(&low_quantiles, log10(iterations));
>
> printf("Low prio thread started\n");
>
> @@ -149,19 +147,18 @@ void * low_prio_thread(void *arg)
> busy_work_ms(low_work_time);
> low_hold = rt_gettime() - low_start;
>
> + pthread_mutex_unlock(&lock);
> +
> low_dat.records[i].x = i;
> low_dat.records[i].y = low_hold / NS_PER_US;
>
> - pthread_mutex_unlock(&lock);
> -
> if (i == iterations-1)
> end = 1;
>
> /* Wait for all threads to finish this iteration */
> pthread_barrier_wait(&bar2);
> }
> - stats_quantiles_calc(&low_dat, &low_quantiles);
> - stats_hist(&low_hist, &low_dat);
> +
> return NULL;
> }
>
> @@ -188,14 +185,14 @@ void * high_prio_thread(void *arg)
> pthread_mutex_lock(&lock);
> high_spent = rt_gettime() - high_start;
>
> + busy_work_ms(high_work_time);
> + pthread_mutex_unlock(&lock);
> +
> high_dat.records[i].x = i;
> high_dat.records[i].y = high_spent / NS_PER_US;
> wait_dat.records[i].x = i;
> wait_dat.records[i].y = high_dat.records[i].y -
> low_dat.records[i].y;
>
> - busy_work_ms(high_work_time);
> - pthread_mutex_unlock(&lock);
> -
> /* Wait for all threads to finish this iteration */
> pthread_barrier_wait(&bar2);
> }
--
Darren Hart
IBM Linux Technology Center
Real-Time Linux Team
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list