diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-07-19 13:04:20 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-07-19 13:04:20 +0000 |
commit | 43469aff7c49b1ecd8cae2e78f32287152e749eb (patch) | |
tree | b0830790dd9ea53e4685fc304d0342a18f9ca6b3 /testsuites/psxtmtests | |
parent | 2011-07-19 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-43469aff7c49b1ecd8cae2e78f32287152e749eb.tar.bz2 |
2011-07-19 Ricardo Aguirre <el.mastin@ymail.com>
PR 1840/tests
* Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of key
set and get.
* psxtmkey02/.cvsignore, psxtmkey02/Makefile.am, psxtmkey02/init.c,
psxtmkey02/psxtmkey02.doc: New files.
Diffstat (limited to 'testsuites/psxtmtests')
-rw-r--r-- | testsuites/psxtmtests/ChangeLog | 8 | ||||
-rw-r--r-- | testsuites/psxtmtests/Makefile.am | 1 | ||||
-rw-r--r-- | testsuites/psxtmtests/configure.ac | 1 | ||||
-rw-r--r-- | testsuites/psxtmtests/psxtmkey02/.cvsignore | 2 | ||||
-rw-r--r-- | testsuites/psxtmtests/psxtmkey02/Makefile.am | 30 | ||||
-rw-r--r-- | testsuites/psxtmtests/psxtmkey02/init.c | 99 | ||||
-rw-r--r-- | testsuites/psxtmtests/psxtmkey02/psxtmkey02.doc | 16 | ||||
-rw-r--r-- | testsuites/psxtmtests/psxtmtests_plan.csv | 4 |
8 files changed, 159 insertions, 2 deletions
diff --git a/testsuites/psxtmtests/ChangeLog b/testsuites/psxtmtests/ChangeLog index d69e1983b2..c81578e0d2 100644 --- a/testsuites/psxtmtests/ChangeLog +++ b/testsuites/psxtmtests/ChangeLog @@ -1,3 +1,11 @@ +2011-07-19 Ricardo Aguirre <el.mastin@ymail.com> + + PR 1840/tests + * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of key + set and get. + * psxtmkey02/.cvsignore, psxtmkey02/Makefile.am, psxtmkey02/init.c, + psxtmkey02/psxtmkey02.doc: New files. + 2011-07-18 Jennifer Averett <Jennifer.Averett@OARcorp.com> * configure.ac: Remove psxtmmutex04 until PR 1836 is processed. diff --git a/testsuites/psxtmtests/Makefile.am b/testsuites/psxtmtests/Makefile.am index 38a0f14e6e..64e5b7d914 100644 --- a/testsuites/psxtmtests/Makefile.am +++ b/testsuites/psxtmtests/Makefile.am @@ -7,6 +7,7 @@ ACLOCAL_AMFLAGS = -I ../aclocal SUBDIRS = if HAS_POSIX +SUBDIRS += psxtmkey02 SUBDIRS += psxtmmutex01 SUBDIRS += psxtmmutex02 SUBDIRS += psxtmmutex03 diff --git a/testsuites/psxtmtests/configure.ac b/testsuites/psxtmtests/configure.ac index 0cf0e6c5ed..b2cab57d69 100644 --- a/testsuites/psxtmtests/configure.ac +++ b/testsuites/psxtmtests/configure.ac @@ -79,6 +79,7 @@ AC_SUBST(OPERATION_COUNT) # Explicitly list all Makefiles here AC_CONFIG_FILES([Makefile +psxtmkey02/Makefile psxtmmutex01/Makefile psxtmmutex02/Makefile psxtmmutex03/Makefile diff --git a/testsuites/psxtmtests/psxtmkey02/.cvsignore b/testsuites/psxtmtests/psxtmkey02/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/testsuites/psxtmtests/psxtmkey02/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/testsuites/psxtmtests/psxtmkey02/Makefile.am b/testsuites/psxtmtests/psxtmkey02/Makefile.am new file mode 100644 index 0000000000..f54ff6af39 --- /dev/null +++ b/testsuites/psxtmtests/psxtmkey02/Makefile.am @@ -0,0 +1,30 @@ +## +## $Id$ +## + +MANAGERS = all + +rtems_tests_PROGRAMS = psxtmkey02 +psxtmkey02_SOURCES = init.c ../../tmtests/include/timesys.h \ + ../../support/src/tmtests_empty_function.c \ + ../../support/src/tmtests_support.c + +dist_rtems_tests_DATA = psxtmkey02.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +OPERATION_COUNT = @OPERATION_COUNT@ +AM_CPPFLAGS += -I$(top_srcdir)/../tmtests/include +AM_CPPFLAGS += -DOPERATION_COUNT=$(OPERATION_COUNT) +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(psxtmkey02_OBJECTS) $(psxtmkey02_LDADD) +LINK_LIBS = $(psxtmkey02_LDLIBS) + +psxtmkey02$(EXEEXT): $(psxtmkey02_OBJECTS) $(psxtmkey02_DEPENDENCIES) + @rm -f psxtmkey02$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/psxtmtests/psxtmkey02/init.c b/testsuites/psxtmtests/psxtmkey02/init.c new file mode 100644 index 0000000000..fb6c27778d --- /dev/null +++ b/testsuites/psxtmtests/psxtmkey02/init.c @@ -0,0 +1,99 @@ +/* + * COPYRIGHT (c) 1989-2011. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http:www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <timesys.h> +#include <rtems/timerdrv.h> +#include <errno.h> +#include <pthread.h> +#include "test_support.h" + +pthread_key_t Key; +int Value1; + +void benchmark_pthread_setspecific( void *value_p ) +{ + long end_time; + int status; + + benchmark_timer_initialize(); + status = pthread_setspecific( Key, value_p ); + end_time = benchmark_timer_read(); + rtems_test_assert( status == 0 ); + + put_time( + "pthread_setspecific", + end_time, + 1, /* Only executed once */ + 0, + 0 + ); + +} + +void benchmark_pthread_getspecific( void *expected ) +{ + long end_time; + void *value_p; + + benchmark_timer_initialize(); + value_p = pthread_getspecific( Key ); + end_time = benchmark_timer_read(); + rtems_test_assert( value_p == expected ); + + put_time( + "pthread_getspecific", + end_time, + 1, /* Only executed once */ + 0, + 0 + ); +} + +void *POSIX_Init( + void *argument +) +{ + int status; + + puts( "\n\n*** POSIX TIME TEST PSXTMKEY02 ***" ); + + /* create the key */ + status = pthread_key_create( &Key, NULL ); + rtems_test_assert( status == 0 ); + + benchmark_pthread_getspecific( NULL ); + benchmark_pthread_setspecific( &Value1 ); + benchmark_pthread_getspecific( &Value1 ); + + /* destroy the key */ + status = pthread_key_delete( Key ); + rtems_test_assert( status == 0 ); + + puts( "*** END OF POSIX TIME TEST PSXTMKEY02 ***" ); + rtems_test_exit(0); +} + +/* configuration information */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 1 +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_INIT +#include <rtems/confdefs.h> +/* end of file */ diff --git a/testsuites/psxtmtests/psxtmkey02/psxtmkey02.doc b/testsuites/psxtmtests/psxtmkey02/psxtmkey02.doc new file mode 100644 index 0000000000..1f30e34c1c --- /dev/null +++ b/testsuites/psxtmtests/psxtmkey02/psxtmkey02.doc @@ -0,0 +1,16 @@ +# +# $Id$ +# +# COPYRIGHT (c) 1989-2011. +# On-Line Applications Research Corporation (OAR). +# +# The license and distribution terms for this file may be +# found in the file LICENSE in this distribution or at +# http://www.rtems.com/license/LICENSE. +# + +This test benchmarks the following operations: + ++ pthread_setspecific ++ pthread_getspecific + diff --git a/testsuites/psxtmtests/psxtmtests_plan.csv b/testsuites/psxtmtests/psxtmtests_plan.csv index 8c20627eb5..9ddf404543 100644 --- a/testsuites/psxtmtests/psxtmtests_plan.csv +++ b/testsuites/psxtmtests/psxtmtests_plan.csv @@ -37,8 +37,8 @@ "pthread_once",,, ,,, "pthread_key_create","psxtmkey01","psxtmtest_init_destroy", -"pthread_setspecific","psxtmkey02","psxtmtest_single", -"pthread_getspecific","psxtmkey02","psxtmtest_single", +"pthread_setspecific","psxtmkey02","psxtmtest_single","Yes" +"pthread_getspecific","psxtmkey02","psxtmtest_single","Yes" "pthread_key_delete","psxtmkey01","psxtmtest_init_destroy", ,,, "pthread_cancel",,, |