<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-07-22)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-07-22 Ricardo Aguirre <el.mastin@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.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/ChangeLog.diff?r1=text&tr1=1.27&r2=text&tr2=1.28&diff_format=h">M</a></td><td width='1%'>1.28</td><td width='100%'>testsuites/psxtmtests/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/Makefile.am.diff?r1=text&tr1=1.12&r2=text&tr2=1.13&diff_format=h">M</a></td><td width='1%'>1.13</td><td width='100%'>testsuites/psxtmtests/Makefile.am</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/configure.ac.diff?r1=text&tr1=1.15&r2=text&tr2=1.16&diff_format=h">M</a></td><td width='1%'>1.16</td><td width='100%'>testsuites/psxtmtests/configure.ac</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem01/.cvsignore?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtmtests/psxtmsem01/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem01/Makefile.am?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtmtests/psxtmsem01/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem01/init.c?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtmtests/psxtmsem01/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmsem01/psxtmsem01.doc?rev=1.1&content-type=text/vnd.viewcvs-markup">A</a></td><td width='1%'><font color="#000088">1.1</font></td><td width='100%'><font color="#000088">testsuites/psxtmtests/psxtmsem01/psxtmsem01.doc</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmtests_plan.csv.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>testsuites/psxtmtests/psxtmtests_plan.csv</td></tr>
</table>
<pre>
<font color='#006600'>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
</font><font color='#997700'>@@ -1,3 +1,12 @@
</font><font color='#000088'>+2011-07-22    Ricardo Aguirre <el.mastin@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.
+
</font> 2011-07-21        Ricardo Aguirre <el.mastin@ymail.com>
 
        PR 1835/tests

<font color='#006600'>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
</font><font color='#997700'>@@ -18,6 +18,7 @@
</font> SUBDIRS += psxtmmutex07
 SUBDIRS += psxtmnanosleep01
 SUBDIRS += psxtmnanosleep02
<font color='#000088'>+SUBDIRS += psxtmsem01
</font> SUBDIRS += psxtmsleep01
 SUBDIRS += psxtmsleep02
 SUBDIRS += psxtmthread01

<font color='#006600'>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
</font><font color='#997700'>@@ -90,6 +90,7 @@
</font> psxtmmutex07/Makefile
 psxtmnanosleep01/Makefile
 psxtmnanosleep02/Makefile
<font color='#000088'>+psxtmsem01/Makefile
</font> psxtmsleep01/Makefile
 psxtmsleep02/Makefile
 psxtmthread01/Makefile

<font color='#006600'>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
</font><font color='#997700'>@@ -0,0 +1,2 @@
</font><font color='#000088'>+Makefile
+Makefile.in
</font>
<font color='#006600'>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
</font><font color='#997700'>@@ -0,0 +1,30 @@
</font><font color='#000088'>+##
+## $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@.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
</font>
<font color='#006600'>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
</font><font color='#997700'>@@ -0,0 +1,206 @@
</font><font color='#000088'>+/*
+ *  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 */
</font>
<font color='#006600'>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
</font><font color='#997700'>@@ -0,0 +1,20 @@
</font><font color='#000088'>+#
+#  $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
+
</font>
<font color='#006600'>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
</font><font color='#997700'>@@ -86,7 +86,7 @@
</font> "mq_open (second open)","psxtmsem03","psxtmtest_init_destroy",
 "mq_close (close of second)","psxtmsem03","psxtmtest_init_destroy",
 "mq_unlink",,,
<font color='#880000'>-"mq_receive – available",,"psxtmtest_single",
</font><font color='#000088'>+"mq_receive - available",,"psxtmtest_single",
</font> "mq_receive - not available, block",,"psxtmtest_blocking",
 "mq_timedreceive - available",,"psxtmtest_single",
 "mq_timedreceive - not available, blocks",,"psxtmtest_single",
<font color='#997700'>@@ -98,13 +98,15 @@
</font> "mq_timedsend - thread waiting, preemption",,"psxtmtest_unblocking_preempt",
 "mq_notify ",,"psxtmtest_single",
 ,,,
<font color='#880000'>-"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",
</font><font color='#000088'>+"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",
</font> "sem_wait - not available, block",,"psxtmtest_blocking",
 "sem_trywait - available",,"psxtmtest_single",
 "sem_trywait - not available",,"psxtmtest_single",
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>