summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtmtests
diff options
context:
space:
mode:
authorDaniel Ramirez <javamonn@gmail.com>2013-11-30 15:42:38 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2013-11-30 15:50:25 -0600
commit115e0591317481cb622913d46f4164d7db34fa1b (patch)
tree95fa331add37a01d187a80b57bdddba9844b0aea /testsuites/psxtmtests
parentpsxtmtests_plan.csv: Replace comma with colon (diff)
downloadrtems-115e0591317481cb622913d46f4164d7db34fa1b.tar.bz2
fixed psxtmthread02 test, updated .csv to be in sync and added test .docs
Diffstat (limited to 'testsuites/psxtmtests')
-rw-r--r--testsuites/psxtmtests/psxtmbarrier03/init.c2
-rw-r--r--testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc14
-rw-r--r--testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc19
-rw-r--r--testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc14
-rw-r--r--testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc20
-rw-r--r--testsuites/psxtmtests/psxtmtests_plan.csv29
-rw-r--r--testsuites/psxtmtests/psxtmthread02/init.c34
-rw-r--r--testsuites/psxtmtests/psxtmthread02/psxtmthread02.doc14
8 files changed, 105 insertions, 41 deletions
diff --git a/testsuites/psxtmtests/psxtmbarrier03/init.c b/testsuites/psxtmtests/psxtmbarrier03/init.c
index 4b924c8ccb..0ec7c63e4e 100644
--- a/testsuites/psxtmtests/psxtmbarrier03/init.c
+++ b/testsuites/psxtmtests/psxtmbarrier03/init.c
@@ -68,7 +68,7 @@ void *POSIX_Init(
* unblocking operation.
*/
benchmark_timer_initialize();
- status = pthread_barrier_wait( &barrier );
+ status = pthread_barrier_wait( &barrier );
end_time = benchmark_timer_read();
/*
* Upon successful completion return value, the status should be
diff --git a/testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc b/testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc
index 865fc07091..72ea1bb15c 100644
--- a/testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc
+++ b/testsuites/psxtmtests/psxtmcond02/psxtmcond02.doc
@@ -1,4 +1,4 @@
-# COPYRIGHT (c) 1989-2011.
+# COPYRIGHT (c) 2013
# On-Line Applications Research Corporation (OAR).
#
# The license and distribution terms for this file may be
@@ -8,4 +8,14 @@
This test benchmarks the following operations:
-+
++ pthread_cond_signal - no threads waiting
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmcond
+
+directives:
++ pthread_cond_signal
+
+concepts:
++ Benchmark the call pthread_cond_signal with no threads waiting.
diff --git a/testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc b/testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc
index 865fc07091..4f0a474098 100644
--- a/testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc
+++ b/testsuites/psxtmtests/psxtmcond03/psxtmcond03.doc
@@ -1,4 +1,4 @@
-# COPYRIGHT (c) 1989-2011.
+# COPYRIGHT (c) 2013
# On-Line Applications Research Corporation (OAR).
#
# The license and distribution terms for this file may be
@@ -8,4 +8,19 @@
This test benchmarks the following operations:
-+
++ pthread_cond_signal - thread waiting: no preempt
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmcond
+
+directives:
++ pthread_cond_signal
++ pthread_mutex_lock
++ pthread_mutex_init
++ pthread_cond_init
++ pthread_create
+
+concepts:
++ Benchmark the call pthread_cond_signal to unlock a mutex, with no resulting
+ preempt.
diff --git a/testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc b/testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc
index 865fc07091..ab6bcd1628 100644
--- a/testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc
+++ b/testsuites/psxtmtests/psxtmcond05/psxtmcond05.doc
@@ -1,4 +1,4 @@
-# COPYRIGHT (c) 1989-2011.
+# COPYRIGHT (c) 2013
# On-Line Applications Research Corporation (OAR).
#
# The license and distribution terms for this file may be
@@ -8,4 +8,14 @@
This test benchmarks the following operations:
-+
++ pthread_cond_broadcast - no threads waiting
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmcond
+
+directives:
++ pthread_cond_broadcast
+
+concepts:
++ Benchmark the call pthread_cond_broadcast with no threads waiting.
diff --git a/testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc b/testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc
index 865fc07091..9925b957d3 100644
--- a/testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc
+++ b/testsuites/psxtmtests/psxtmcond08/psxtmcond08.doc
@@ -1,4 +1,4 @@
-# COPYRIGHT (c) 1989-2011.
+# COPYRIGHT (c) 2013
# On-Line Applications Research Corporation (OAR).
#
# The license and distribution terms for this file may be
@@ -8,4 +8,20 @@
This test benchmarks the following operations:
-+
++ pthread_cond_wait - blocks (mutex+condvar pattern)
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmcond
+
+directives:
++ pthread_cond_signal
++ pthread_mutex_lock
++ pthread_mutex_init
++ pthread_cond_init
++ pthread_create
++ pthread_cond_timedwait
+
+concepts:
++ Benchmark the call pthread_cond_wait blocking threads and using a mutex and
+ condvar pattern.
diff --git a/testsuites/psxtmtests/psxtmtests_plan.csv b/testsuites/psxtmtests/psxtmtests_plan.csv
index afc0763d57..c89fbcc69f 100644
--- a/testsuites/psxtmtests/psxtmtests_plan.csv
+++ b/testsuites/psxtmtests/psxtmtests_plan.csv
@@ -13,26 +13,25 @@
"pthread_mutex_setprioceiling","psxtmmutex07","psxtmtest_single","Yes"
"pthread_mutex_getprioceiling","psxtmmutex07","psxtmtest_single","Yes"
,,,
-"pthread_cond_init","psxtmcond01","psxtmtest_init_destroy","No"
-"pthread_cond_destroy","psxtmcond01","psxtmtest_init_destroy","No"
-"pthread_cond_signal - no threads waiting","psxtmcond02","psxtmtest_single","No"
-"pthread_cond_signal - thread waiting: no preempt","psxtmcond03","psxtmtest_unblocking_nopreempt","No"
+"pthread_cond_init","psxtmcond01","psxtmtest_init_destroy","Yes"
+"pthread_cond_destroy","psxtmcond01","psxtmtest_init_destroy","Yes"
+"pthread_cond_signal - no threads waiting","psxtmcond02","psxtmtest_single","Yes"
+"pthread_cond_signal - thread waiting: no preempt","psxtmcond03","psxtmtest_unblocking_nopreempt","Yes"
"pthread_cond_signal - thread waiting: preempt","psxtmcond04","psxtmtest_unblocking_preempt","No"
-"pthread_cond_broadcast - no threads waiting","psxtmcond05","psxtmtest_single","No"
+"pthread_cond_broadcast - no threads waiting","psxtmcond05","psxtmtest_single","Yes"
"pthread_cond_broadcast - threads waiting: no preempt","psxtmcond06","psxtmtest_unblocking_nopreempt","No"
"pthread_cond_broadcast - threads waiting: preempt","psxtmcond07","psxtmtest_unblocking_preempt","No"
-"pthread_cond_wait - blocks (mutex+condvar pattern)","psxtmcond08","psxtmtest_blocking","No"
+"pthread_cond_wait - blocks (mutex+condvar pattern)","psxtmcond08","psxtmtest_blocking","Yes"
"pthread_cond_timedwait(&time) - blocks (mutex+condvar pattern)","psxtmcond09","psxtmtest_blocking","No"
"pthread_cond_timedwait(&time) - time in past error","psxtmcond10","psxtmtest_blocking","No"
,,,
"pthread_create - no preempt","psxtmthread01","psxtmtest_single","Yes"
-"pthread_create - preempt","psxtmthread02","psxtmtest_single","No"
+"pthread_create - preempt","psxtmthread02","psxtmtest_single","Yes"
"pthread_join",,,
"pthread_detach",,,
"pthread_exit",,,
-"pthread_self","psxtmthread03","psxtmtest_single w/multiple timings","No"
-"pthread_equal","psxtmthread03","psxtmtest_single w/multiple timings","No"
+"pthread_exit","psxtmthread03","psxtmtest_single","Yes"
"pthread_getschedparam","psxtmthread04","psxtmtest_single w/multiple timings","No"
"pthread_setschedparam - no thread switch","psxtmthread04","psxtmtest_single w/multiple timings","No"
"pthread_setschedparam - lower own priority: preempt","psxtmthread05","psxtmtest_single","Yes"
@@ -61,12 +60,12 @@
"pthread_barrier_wait - releasing: no preempt","psxtmbarrier03","psxtmtest_unblocking_nopreempt","Yes"
"pthread_barrier_wait - releasing: preempt","psxtmbarrier04","psxtmtest_unblocking_preempt","Yes"
,,,
-"pthread_spin_init","psxspin01","psxtmtest_init_destroy","No"
-"pthread_spin_destroy","psxspin01","psxtmtest_init_destroy","No"
-"pthread_spin_lock - available","psxspin02","psxtmtest_single w/multiple timings","No"
-"pthread_spin_trylock - available","psxspin02","psxtmtest_single w/multiple timings","No"
-"pthread_spin_trylock - not available","psxspin02","psxtmtest_single w/multiple timings","No"
-"pthread_spin_unlock","psxspin02","psxtmtest_single w/multiple timings","No"
+"pthread_spin_init","psxspin01","psxtmtest_init_destroy","Yes"
+"pthread_spin_destroy","psxspin01","psxtmtest_init_destroy","Yes"
+"pthread_spin_lock - available","psxspin02","psxtmtest_single w/multiple timings","Yes"
+"pthread_spin_trylock - available","psxspin02","psxtmtest_single w/multiple timings","Yes"
+"pthread_spin_trylock - not available","psxspin02","psxtmtest_single w/multiple timings","Yes"
+"pthread_spin_unlock","psxspin02","psxtmtest_single w/multiple timings","Yes"
,,,
"pthread_rwlock_init","psxtmrwlock01","psxtmtest_init_destroy","Yes"
"pthread_rwlock_destroy","psxtmrwlock01","psxtmtest_init_destroy","Yes"
diff --git a/testsuites/psxtmtests/psxtmthread02/init.c b/testsuites/psxtmtests/psxtmthread02/init.c
index 9e44873937..bfa3ab8c9a 100644
--- a/testsuites/psxtmtests/psxtmthread02/init.c
+++ b/testsuites/psxtmtests/psxtmthread02/init.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-2012.
+ * COPYRIGHT (c) 1989-2013.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -23,19 +23,29 @@ void *thread(void *argument);
void benchmark_pthread_create(void)
{
- long end_time;
int status;
pthread_t thread_ID;
+ pthread_attr_t attr;
+ struct sched_param param;
+
+ pthread_attr_init(&attr);
+ pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
+ pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
+ param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1;
+ pthread_attr_setschedparam(&attr, &param);
+ /* create second thread with max priority and get preempted on creation */
benchmark_timer_initialize();
-
- status = pthread_create(&thread_ID, NULL, thread, NULL);
- rtems_test_assert( status == 0 );
-
- end_time = benchmark_timer_read();
+ status = pthread_create(&thread_ID, &attr, thread, NULL);
+}
- rtems_test_assert( status == 0 );
+void *thread(
+ void *argument
+)
+{
+ long end_time;
+ end_time = benchmark_timer_read();
put_time(
"pthread_create - preempt",
end_time,
@@ -43,14 +53,6 @@ void benchmark_pthread_create(void)
0,
0
);
-
-}
-
-void *thread(
- void *argument
-)
-{
- //Empty thread used in pthread_create().
return NULL;
}
diff --git a/testsuites/psxtmtests/psxtmthread02/psxtmthread02.doc b/testsuites/psxtmtests/psxtmthread02/psxtmthread02.doc
index 865fc07091..0e2e18c936 100644
--- a/testsuites/psxtmtests/psxtmthread02/psxtmthread02.doc
+++ b/testsuites/psxtmtests/psxtmthread02/psxtmthread02.doc
@@ -1,5 +1,6 @@
# COPYRIGHT (c) 1989-2011.
# On-Line Applications Research Corporation (OAR).
+# COPYRIGHT (c) 2013.
#
# The license and distribution terms for this file may be
# found in the file LICENSE in this distribution or at
@@ -8,4 +9,15 @@
This test benchmarks the following operations:
-+
++ pthread_create - preempt
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: psxtmthread
+
+directives:
++ pthread_create
+
+concepts:
++ Benchmark the call pthread_create for creating a thread with a higher priority
+ and the resulting preempt.