From: Subrata <ris...@li...> - 2010-07-01 17:00:53
|
The branch, master, has been updated via 0591a5dcc4c5d8b1cb282e4afd163f70b62350ce (commit) via 66c15baaa8be08c5baae5a0c819df3b6a8c834dd (commit) from 95e8b61433efcefb83699aaf859e92ad2b576373 (commit) - Log ----------------------------------------------------------------- commit 0591a5dcc4c5d8b1cb282e4afd163f70b62350ce Author: Subrata Modak <sub...@su...> Date: Thu Jul 1 22:29:20 2010 +0530 [PATCH] realtime: rearrange the pthread attr functions order in librttest, From: gowrishankar <gow...@li...> In the recent pthread libraries, order of calling pthread_attr_setschedpolicy and pthread_attr_setschedparam plays important role in a way that, former should always be called followed by later. Otherwise, pthread_attr_setschedparam always ends with error 22 (EINVAL). This patch fixes the create_thread() in librttest library. Signed-off-by: Gowrishankar <gow...@in...>, Tested-by: Gowrishankar <gow...@in...>, Acked-by: Will Schmidt <wil...@vn...>, Acked-by: Darren Hart <dv...@us...>, commit 66c15baaa8be08c5baae5a0c819df3b6a8c834dd Author: Subrata Modak <sub...@su...> Date: Thu Jul 1 22:27:54 2010 +0530 [PATCH] realtime: fix min and max calculations in matrix multiplication test. From: gowrishankar <gow...@li...> In matrix multiplication test, the min and max calculations are done on stats_container_t data with its index field never set to the last element position. Due to this min and max are always shown with the first record value (as index was initiated with -1). Signed-off-by: Gowrishankar <gow...@in...>, Tested-by: Gowrishankar <gow...@in...>, Acked-by: Will Schmidt <wil...@vn...>, Acked-by: Darren Hart <dv...@us...>, ----------------------------------------------------------------------- Summary of changes: testcases/realtime/func/matrix_mult/matrix_mult.c | 2 ++ testcases/realtime/lib/librttest.c | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c b/testcases/realtime/func/matrix_mult/matrix_mult.c index 419f697..fa0e352 100644 --- a/testcases/realtime/func/matrix_mult/matrix_mult.c +++ b/testcases/realtime/func/matrix_mult/matrix_mult.c @@ -222,6 +222,7 @@ void main_thread(void) /* run matrix mult operation sequentially */ curdat = &sdat; + curdat->index = iterations-1; printf("\nRunning sequential operations\n"); start = rt_gettime(); for (i = 0; i < iterations; i++) @@ -252,6 +253,7 @@ void main_thread(void) pthread_barrier_init(&mult_start, NULL, numcpus+1); set_priority(PRIO); curdat = &cdat; + curdat->index = iterations-1; online_cpu_id = -1; /* Redispatch cpus */ /* Create numcpus-1 concurrent threads */ for (j = 0; j < numcpus; j++) { diff --git a/testcases/realtime/lib/librttest.c b/testcases/realtime/lib/librttest.c index e092f35..49fec29 100644 --- a/testcases/realtime/lib/librttest.c +++ b/testcases/realtime/lib/librttest.c @@ -295,8 +295,8 @@ int create_thread(void*(*func)(void*), void *arg, int prio, int policy) pthread_attr_init(&thread->attr); pthread_attr_setinheritsched(&thread->attr, PTHREAD_EXPLICIT_SCHED); - pthread_attr_setschedparam(&thread->attr, ¶m); pthread_attr_setschedpolicy(&thread->attr, thread->policy); + pthread_attr_setschedparam(&thread->attr, ¶m); if ((ret = pthread_create(&thread->pthread, &thread->attr, func, (void*)thread))) { printf("pthread_create failed: %d (%s)\n", ret, strerror(ret)); hooks/post-receive -- ltp |