change log for rtems (2011-07-22)
rtems-vc at rtems.org
rtems-vc at rtems.org
Fri Jul 22 17:10:12 UTC 2011
*joel*:
2011-07-22 Ricardo Aguirre <el.mastin at ymail.com>
PR 1846/tests
* Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
various sem_open(), sem_close(), sem_unlink(), sem_init(), and
sem_destroy() cases.
* psxtmsem01/.cvsignore, psxtmsem01/Makefile.am, psxtmsem01/init.c,
psxtmsem01/psxtmsem01.doc: New files.
M 1.28 testsuites/psxtmtests/ChangeLog
M 1.13 testsuites/psxtmtests/Makefile.am
M 1.16 testsuites/psxtmtests/configure.ac
A 1.1 testsuites/psxtmtests/psxtmsem01/.cvsignore
A 1.1 testsuites/psxtmtests/psxtmsem01/Makefile.am
A 1.1 testsuites/psxtmtests/psxtmsem01/init.c
A 1.1 testsuites/psxtmtests/psxtmsem01/psxtmsem01.doc
M 1.15 testsuites/psxtmtests/psxtmtests_plan.csv
diff -u rtems/testsuites/psxtmtests/ChangeLog:1.27 rtems/testsuites/psxtmtests/ChangeLog:1.28
--- rtems/testsuites/psxtmtests/ChangeLog:1.27 Thu Jul 21 08:48:52 2011
+++ rtems/testsuites/psxtmtests/ChangeLog Fri Jul 22 12:05:46 2011
@@ -1,3 +1,12 @@
+2011-07-22 Ricardo Aguirre <el.mastin at ymail.com>
+
+ PR 1846/tests
+ * Makefile.am, configure.ac, psxtmtests_plan.csv: Add benchmark of
+ various sem_open(), sem_close(), sem_unlink(), sem_init(), and
+ sem_destroy() cases.
+ * psxtmsem01/.cvsignore, psxtmsem01/Makefile.am, psxtmsem01/init.c,
+ psxtmsem01/psxtmsem01.doc: New files.
+
2011-07-21 Ricardo Aguirre <el.mastin at ymail.com>
PR 1835/tests
diff -u rtems/testsuites/psxtmtests/Makefile.am:1.12 rtems/testsuites/psxtmtests/Makefile.am:1.13
--- rtems/testsuites/psxtmtests/Makefile.am:1.12 Thu Jul 21 08:48:52 2011
+++ rtems/testsuites/psxtmtests/Makefile.am Fri Jul 22 12:05:46 2011
@@ -18,6 +18,7 @@
SUBDIRS += psxtmmutex07
SUBDIRS += psxtmnanosleep01
SUBDIRS += psxtmnanosleep02
+SUBDIRS += psxtmsem01
SUBDIRS += psxtmsleep01
SUBDIRS += psxtmsleep02
SUBDIRS += psxtmthread01
diff -u rtems/testsuites/psxtmtests/configure.ac:1.15 rtems/testsuites/psxtmtests/configure.ac:1.16
--- rtems/testsuites/psxtmtests/configure.ac:1.15 Thu Jul 21 08:48:52 2011
+++ rtems/testsuites/psxtmtests/configure.ac Fri Jul 22 12:05:46 2011
@@ -90,6 +90,7 @@
psxtmmutex07/Makefile
psxtmnanosleep01/Makefile
psxtmnanosleep02/Makefile
+psxtmsem01/Makefile
psxtmsleep01/Makefile
psxtmsleep02/Makefile
psxtmthread01/Makefile
diff -u /dev/null rtems/testsuites/psxtmtests/psxtmsem01/.cvsignore:1.1
--- /dev/null Fri Jul 22 12:10:11 2011
+++ rtems/testsuites/psxtmtests/psxtmsem01/.cvsignore Fri Jul 22 12:05:46 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff -u /dev/null rtems/testsuites/psxtmtests/psxtmsem01/Makefile.am:1.1
--- /dev/null Fri Jul 22 12:10:12 2011
+++ rtems/testsuites/psxtmtests/psxtmsem01/Makefile.am Fri Jul 22 12:05:46 2011
@@ -0,0 +1,30 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmsem01
+psxtmsem01_SOURCES = init.c ../../tmtests/include/timesys.h \
+ ../../support/src/tmtests_empty_function.c \
+ ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmsem01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP at .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 = $(psxtmsem01_OBJECTS) $(psxtmsem01_LDADD)
+LINK_LIBS = $(psxtmsem01_LDLIBS)
+
+psxtmsem01$(EXEEXT): $(psxtmsem01_OBJECTS) $(psxtmsem01_DEPENDENCIES)
+ @rm -f psxtmsem01$(EXEEXT)
+ $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
diff -u /dev/null rtems/testsuites/psxtmtests/psxtmsem01/init.c:1.1
--- /dev/null Fri Jul 22 12:10:12 2011
+++ rtems/testsuites/psxtmtests/psxtmsem01/init.c Fri Jul 22 12:05:46 2011
@@ -0,0 +1,206 @@
+/*
+ * 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 <errno.h>
+#include <fcntl.h>
+#include <semaphore.h>
+#include <tmacros.h>
+#include <timesys.h>
+#include <rtems/timerdrv.h>
+#include "test_support.h"
+
+#define MAX_SEMS 2
+
+sem_t sem1;
+sem_t *n_sem1;
+sem_t *n_sem2;
+
+void benchmark_sem_init(void)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ status = sem_init( &sem1, 0, 1 );
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ "sem_init",
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+}
+
+void benchmark_sem_destroy(void)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ status = sem_destroy( &sem1 );
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ "sem_destroy",
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+}
+
+void benchmark_sem_open(bool report_time)
+{
+ long end_time;
+
+ benchmark_timer_initialize();
+ n_sem1 = sem_open( "sem1", O_CREAT, 0777, 1 );
+ end_time = benchmark_timer_read();
+
+ if ( report_time ) {
+ put_time(
+ "sem_open (first open 'O_CREAT')",
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+ }
+}
+
+void benchmark_sem_close(bool report_time)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ status = sem_close( n_sem1 );
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ if ( report_time ) {
+ put_time(
+ "sem_close (named first/nested close)",
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+ }
+}
+
+void benchmark_sem_unlink(const char *message)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ status = sem_unlink( "sem1" );
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ message,
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+}
+
+void benchmark_sem_open_second(void)
+{
+ long end_time;
+
+ benchmark_timer_initialize();
+ n_sem2 = sem_open( "sem1", O_EXCL, 0777, 1 );
+ end_time = benchmark_timer_read();
+
+ put_time(
+ "sem_open (second open 'O_EXCL')",
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+}
+
+void benchmark_sem_close_second(void)
+{
+ long end_time;
+ int status;
+
+ benchmark_timer_initialize();
+ status = sem_close( n_sem2 );
+ end_time = benchmark_timer_read();
+ rtems_test_assert( status == 0 );
+
+ put_time(
+ "sem_close (named second close)",
+ end_time,
+ 1, /* Only executed once */
+ 0,
+ 0
+ );
+}
+
+void *POSIX_Init(void *argument)
+{
+
+ puts( "\n\n*** POSIX TIME TEST PSXTMSEM01 ***" );
+
+ /* creating unnamed semaphore */
+ benchmark_sem_init();
+ /* destroying unnamed semaphore */
+ benchmark_sem_destroy();
+
+ /* opening named semaphore first time o_flag = O_CREAT */
+ benchmark_sem_open(true);
+ /* opening named semaphore second time o_flag = O_EXCL */
+ benchmark_sem_open_second();
+ /* close named semaphore first time -- does not delete */
+ benchmark_sem_close(true);
+ /* unlink named semaphore -- does not delete */
+ benchmark_sem_unlink("sem_unlink (does not delete)");
+ /* close semaphore the second time, this actually deletes it */
+ benchmark_sem_close_second();
+
+ /* recrate named semaphore first time o_flag = O_CREAT */
+ benchmark_sem_open(false);
+ benchmark_sem_close(false);
+ benchmark_sem_unlink("sem_unlink (deletes semaphore)");
+
+ puts( "*** END OF POSIX TIME TEST PSXTMSEM01 ***" );
+
+ rtems_test_exit(0);
+}
+
+/* configuration information */
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
+#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES MAX_SEMS
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
diff -u /dev/null rtems/testsuites/psxtmtests/psxtmsem01/psxtmsem01.doc:1.1
--- /dev/null Fri Jul 22 12:10:12 2011
+++ rtems/testsuites/psxtmtests/psxtmsem01/psxtmsem01.doc Fri Jul 22 12:05:46 2011
@@ -0,0 +1,20 @@
+#
+# $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:
+
++ sem_init
++ sem_open (first 'O_CREAT')
++ sem_close (first)
++ sem_open (second 'O_EXCL')
++ sem_close (second)
++ sem_destroy
+
diff -u rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.14 rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.15
--- rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.14 Wed Jul 20 16:39:25 2011
+++ rtems/testsuites/psxtmtests/psxtmtests_plan.csv Fri Jul 22 12:05:46 2011
@@ -86,7 +86,7 @@
"mq_open (second open)","psxtmsem03","psxtmtest_init_destroy",
"mq_close (close of second)","psxtmsem03","psxtmtest_init_destroy",
"mq_unlink",,,
-"mq_receive – available",,"psxtmtest_single",
+"mq_receive - available",,"psxtmtest_single",
"mq_receive - not available, block",,"psxtmtest_blocking",
"mq_timedreceive - available",,"psxtmtest_single",
"mq_timedreceive - not available, blocks",,"psxtmtest_single",
@@ -98,13 +98,15 @@
"mq_timedsend - thread waiting, preemption",,"psxtmtest_unblocking_preempt",
"mq_notify ",,"psxtmtest_single",
,,,
-"sem_init","psxtmsem01","psxtmtest_init_destroy",
-"sem_destroy","psxtmsem01","psxtmtest_init_destroy",
-"sem_open (first open)","psxtmsem01","psxtmtest_init_destroy",
-"sem_close (close of first)","psxtmsem01","psxtmtest_init_destroy",
-"sem_open (second open)","psxtmsem01","psxtmtest_init_destroy",
-"sem_close (close of second)","psxtmsem01","psxtmtest_init_destroy",
-"sem_wait – available",,"psxtmtest_single",
+"sem_init","psxtmsem01","psxtmtest_single","Yes"
+"sem_destroy","psxtmsem01","psxtmtest_single","Yes"
+"sem_open (first open named)","psxtmsem01","psxtmtest_single","Yes"
+"sem_open (second open named)","psxtmsem01","psxtmtest_single","Yes"
+"sem_close (named first/nested close)","psxtmsem01","psxtmtest_single","Yes"
+"sem_unlink (does not delete)","psxtmsem01","psxtmtest_single","Yes"
+"sem_close (named second close - removes)","psxtmsem01","psxtmtest_single","Yes"
+"sem_unlink (deletes)","psxtmsem01","psxtmtest_single","Yes"
+"sem_wait - available",,"psxtmtest_single",
"sem_wait - not available, block",,"psxtmtest_blocking",
"sem_trywait - available",,"psxtmtest_single",
"sem_trywait - not available",,"psxtmtest_single",
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110722/b1d3f2b3/attachment.html>
More information about the vc
mailing list