<!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-08-24)</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-08-24 Ricardo Aguirre <el.mastin@ymail.com>

        PR 1903/testing
        * Makefile.am, configure.ac, psxtmtests_plan.csv: Add test for message
        queues which covers most open, close, unlink cases as well as
        send/receive which do not involve task state changes.
        * psxtmmq01/.cvsignore, psxtmmq01/Makefile.am, psxtmmq01/init.c,
        psxtmmq01/psxtmmq01.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.47&r2=text&tr2=1.48&diff_format=h">M</a></td><td width='1%'>1.48</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.27&r2=text&tr2=1.28&diff_format=h">M</a></td><td width='1%'>1.28</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.30&r2=text&tr2=1.31&diff_format=h">M</a></td><td width='1%'>1.31</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/psxtmmq01/.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/psxtmmq01/.cvsignore</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmmq01/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/psxtmmq01/Makefile.am</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmmq01/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/psxtmmq01/init.c</font></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/testsuites/psxtmtests/psxtmmq01/psxtmmq01.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/psxtmmq01/psxtmmq01.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.30&r2=text&tr2=1.31&diff_format=h">M</a></td><td width='1%'>1.31</td><td width='100%'>testsuites/psxtmtests/psxtmtests_plan.csv</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/ChangeLog:1.47 rtems/testsuites/psxtmtests/ChangeLog:1.48
--- rtems/testsuites/psxtmtests/ChangeLog:1.47  Thu Aug  4 12:24:28 2011
+++ rtems/testsuites/psxtmtests/ChangeLog       Wed Aug 24 16:15:57 2011
</font><font color='#997700'>@@ -1,3 +1,12 @@
</font><font color='#000088'>+2011-08-24    Ricardo Aguirre <el.mastin@ymail.com>
+
+       PR 1903/testing
+       * Makefile.am, configure.ac, psxtmtests_plan.csv: Add test for message
+       queues which covers most open, close, unlink cases as well as
+       send/receive which do not involve task state changes.
+       * psxtmmq01/.cvsignore, psxtmmq01/Makefile.am, psxtmmq01/init.c,
+       psxtmmq01/psxtmmq01.doc: New files.
+
</font> 2011-08-04        Joel Sherrill <joel.sherrill@oarcorp.com>
 
        * psxtmtests_plan.csv: update.

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/Makefile.am:1.27 rtems/testsuites/psxtmtests/Makefile.am:1.28
--- rtems/testsuites/psxtmtests/Makefile.am:1.27        Thu Aug  4 10:20:06 2011
+++ rtems/testsuites/psxtmtests/Makefile.am     Wed Aug 24 16:15:57 2011
</font><font color='#997700'>@@ -12,6 +12,7 @@
</font> SUBDIRS += psxtmbarrier03
 SUBDIRS += psxtmkey01
 SUBDIRS += psxtmkey02
<font color='#000088'>+SUBDIRS += psxtmmq01
</font> SUBDIRS += psxtmmutex01
 SUBDIRS += psxtmmutex02
 SUBDIRS += psxtmmutex03

<font color='#006600'>diff -u rtems/testsuites/psxtmtests/configure.ac:1.30 rtems/testsuites/psxtmtests/configure.ac:1.31
--- rtems/testsuites/psxtmtests/configure.ac:1.30       Thu Aug  4 10:20:06 2011
+++ rtems/testsuites/psxtmtests/configure.ac    Wed Aug 24 16:15:57 2011
</font><font color='#997700'>@@ -84,6 +84,7 @@
</font> psxtmbarrier03/Makefile
 psxtmkey01/Makefile
 psxtmkey02/Makefile
<font color='#000088'>+psxtmmq01/Makefile
</font> psxtmmutex01/Makefile
 psxtmmutex02/Makefile
 psxtmmutex03/Makefile

<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmq01/.cvsignore:1.1
--- /dev/null   Wed Aug 24 17:10:25 2011
+++ rtems/testsuites/psxtmtests/psxtmmq01/.cvsignore    Wed Aug 24 16:15:57 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/psxtmmq01/Makefile.am:1.1
--- /dev/null   Wed Aug 24 17:10:25 2011
+++ rtems/testsuites/psxtmtests/psxtmmq01/Makefile.am   Wed Aug 24 16:15:58 2011
</font><font color='#997700'>@@ -0,0 +1,31 @@
</font><font color='#000088'>+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmmq01
+psxtmmq01_SOURCES  = init.c
+psxtmmq01_SOURCES += ../../tmtests/include/timesys.h
+psxtmmq01_SOURCES += ../../support/src/tmtests_empty_function.c
+psxtmmq01_SOURCES += ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmmq01.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 = $(psxtmmq01_OBJECTS) $(psxtmmq01_LDADD)
+LINK_LIBS = $(psxtmmq01_LDLIBS)
+
+psxtmmq01$(EXEEXT): $(psxtmmq01_OBJECTS) $(psxtmmq01_DEPENDENCIES)
+       @rm -f psxtmmq01$(EXEEXT)
+       $(make-exe)
+
+include $(top_srcdir)/../automake/local.am
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmq01/init.c:1.1
--- /dev/null   Wed Aug 24 17:10:25 2011
+++ rtems/testsuites/psxtmtests/psxtmmq01/init.c        Wed Aug 24 16:15:58 2011
</font><font color='#997700'>@@ -0,0 +1,306 @@
</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 <fcntl.h>
+#include <timesys.h>
+#include <errno.h>
+#include <rtems/timerdrv.h>
+#include "test_support.h"
+#include <tmacros.h>
+#include <mqueue.h>
+#include <signal.h>   /* signal facilities */
+
+#define MQ_MAXMSG     1
+#define MQ_MSGSIZE    sizeof(int)
+
+mqd_t       queue;
+mqd_t       queue2;
+const char *q_name;
+
+void benchmark_mq_open(int printable)
+{
+  long            end_time;
+  struct mq_attr  attr;
+
+  attr.mq_maxmsg  = MQ_MAXMSG;
+  attr.mq_msgsize = MQ_MSGSIZE;
+  q_name= "queue";
+
+  benchmark_timer_initialize();
+    queue = mq_open( q_name, O_CREAT | O_RDWR , 0x777, &attr );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( queue != (-1) );
+
+  if (printable == 1)
+    put_time(
+      "mq_open (first open)",
+      end_time,
+      1,        /* Only executed once */
+      0,
+      0
+    );
+}
+
+void benchmark_mq_open_second(int printable)
+{
+  long            end_time;
+  struct mq_attr  attr;
+
+  attr.mq_maxmsg  = MQ_MAXMSG;
+  attr.mq_msgsize = MQ_MSGSIZE;
+
+  benchmark_timer_initialize();
+    queue2 =mq_open( q_name, O_RDONLY | O_CREAT , 0x777, &attr);
+  end_time = benchmark_timer_read();
+  rtems_test_assert( queue2 != (-1) );
+
+  if (printable == 1)
+    put_time(
+      "mq_open (second open)",
+      end_time,
+      1,        /* Only executed once */
+      0,
+      0
+    );
+
+}
+
+void benchmark_mq_close(int printable)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = mq_close(queue);
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status == 0 );
+
+  if (printable == 1)
+    put_time(
+      "mq_close (close of first)",
+      end_time,
+      1,        /* Only executed once */
+      0,
+      0
+    );
+}
+
+void benchmark_mq_close_second(int printable)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = mq_close(queue2);
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status == 0 );
+
+  if (printable == 1)
+    put_time(
+      "mq_close (close of second)",
+      end_time,
+      1,        /* Only executed once */
+      0,
+      0
+    );
+}
+
+void benchmark_mq_unlink(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = mq_unlink(q_name);
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status == 0 );
+
+  put_time(
+    "mq_unlink",
+    end_time,
+    1,        /* Only executed once */
+    0,
+    0
+  );
+}
+
+void benchmark_mq_notify(void)
+{
+  long            end_time;
+  int             status;
+  struct sigevent event;
+
+  event.sigev_notify = SIGEV_SIGNAL;
+  event.sigev_signo  = SIGUSR1;
+
+  benchmark_timer_initialize();
+    status = mq_notify( queue2, &event );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status == 0 );
+
+  put_time(
+    "mq_notify",
+    end_time,
+    1,        /* Only executed once */
+    0,
+    0
+  );
+}
+
+void benchmark_mq_send(void)
+{
+  long end_time;
+  int  status;
+
+  status = 9;
+  benchmark_timer_initialize();
+    status = mq_send( queue, (const char *)&status, MQ_MSGSIZE, 1 );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status != (-1) );
+
+  put_time(
+    "mq_send - no threads waiting",
+    end_time,
+    1,        /* Only executed once */
+    0,
+    0
+  );
+}
+
+void benchmark_mq_receive(void)
+{
+  long           end_time;
+  int           status;
+  unsigned int  priority;
+  int           message[MQ_MAXMSG];
+  priority = 1;       /*priority low*/
+
+  benchmark_timer_initialize();
+    status = mq_receive( queue2, ( char *)message, MQ_MSGSIZE, &priority );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status != (-1) );
+
+  put_time(
+    "mq_receive - available",
+    end_time,
+    1,        /* Only executed once */
+    0,
+    0
+  );
+}
+
+void benchmark_mq_timedsend(void)
+{
+  long             end_time;
+  int              status;
+  struct timespec  timeout;
+
+  status = 5;
+  timeout.tv_sec  = 0;
+  timeout.tv_nsec = 1;
+  benchmark_timer_initialize();
+    status = mq_timedsend(
+            queue, (const char *)&status, MQ_MSGSIZE, 1, &timeout);
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status != (-1) );
+
+  put_time(
+    "mq_timedsend - no threads waiting",
+    end_time,
+    1,        /* Only executed once */
+    0,
+    0
+  );
+}
+
+void benchmark_mq_timedreceive(void)
+{
+  long             end_time;
+  int              status;
+  unsigned int     priority;
+  struct timespec  timeout;
+  int              message[MQ_MAXMSG];
+
+  priority = 1;       /*priority low*/
+  timeout.tv_sec  = 0;
+  timeout.tv_nsec = 0;
+  benchmark_timer_initialize();
+    status = mq_timedreceive(
+                 queue2, ( char *)message, MQ_MSGSIZE, &priority, &timeout);
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status != (-1) );
+
+  put_time(
+    "mq_timedreceive - available",
+    end_time,
+    1,        /* Only executed once */
+    0,
+    0
+  );
+}
+
+
+void *POSIX_Init(
+  void *argument
+)
+{
+  puts( "\n\n*** POSIX TIME TEST PSXTMMQ01 ***" );
+  /* create the first message queue READWRITE */
+  benchmark_mq_open(1);
+  /* send message using first queue */
+  benchmark_mq_send();
+  /* open a second message queue READ ONLY */
+  benchmark_mq_open_second(1);
+  /* receiving message using the seconde queue */
+  benchmark_mq_receive();
+  /* closing the second message queue */
+  benchmark_mq_close_second(0);
+  /* unlinking the first queue */
+  benchmark_mq_unlink();
+  /* closing the first queue */
+  benchmark_mq_close(0);
+  /* now repeat basically the same, but for the timed-send/recive */
+  /* open the first queue */
+  benchmark_mq_open(0);
+  /* send message using the first queue */
+  benchmark_mq_timedsend();
+  /* open a second message queue READ ONLY */
+  benchmark_mq_open_second(0);
+  /* receiving message using the seconde queue */
+  benchmark_mq_timedreceive();
+  /* calling notify */
+  benchmark_mq_notify();
+  /* closing the second message queue */
+  benchmark_mq_close_second(1);
+  /* closing the first queue */
+  benchmark_mq_close(1);
+
+  puts( "*** END OF POSIX TIME TEST PSXTMMQ01 ***" );
+  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_POSIX_INIT_THREAD_TABLE
+#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES  2
+#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS 2
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */
</font>
<font color='#006600'>diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmq01/psxtmmq01.doc:1.1
--- /dev/null   Wed Aug 24 17:10:25 2011
+++ rtems/testsuites/psxtmtests/psxtmmq01/psxtmmq01.doc Wed Aug 24 16:15:58 2011
</font><font color='#997700'>@@ -0,0 +1,23 @@
</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:
+
++ mq_close (close of first)
++ mq_close (close of second)
++ mq_notify
++ mq_open (first open)
++ mq_open (second open)
++ mq_receive - available
++ mq_send - no threads waiting
++ mq_timedreceive - available
++ mq_timedsend - no threads waiting
++ mq_unlink
</font>
<font color='#006600'>diff -u rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.30 rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.31
--- rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.30        Thu Aug  4 12:24:29 2011
+++ rtems/testsuites/psxtmtests/psxtmtests_plan.csv     Wed Aug 24 16:15:57 2011
</font><font color='#997700'>@@ -83,22 +83,22 @@
</font> "pthread_rwlock_timedwrlock - available","psxtmrwlock01","psxtmtest_single","Yes"
 "pthread_rwlock_timedwrlock - not available, blocks","psxtmrwlock05","psxtmtest_blocking","Yes"
 ,,,
<font color='#880000'>-"mq_open (first open)","psxtmmq01","psxtmtest_init_destroy",
-"mq_close (close of first)","psxtmmq01","psxtmtest_init_destroy",
-"mq_open (second open)","psxtmmq01","psxtmtest_init_destroy",
-"mq_close (close of second)","psxtmmq01","psxtmtest_init_destroy",
-"mq_unlink","psxtmmq01","psxtmtest_init_destroy",
-"mq_receive - available",,"psxtmtest_single",
</font><font color='#000088'>+"mq_open (first open)","psxtmmq01","psxtmtest_init_destroy","Yes"
+"mq_close (close of first)","psxtmmq01","psxtmtest_init_destroy","Yes"
+"mq_open (second open)","psxtmmq01","psxtmtest_init_destroy","Yes"
+"mq_close (close of second)","psxtmmq01","psxtmtest_init_destroy","Yes"
+"mq_unlink","psxtmmq01","psxtmtest_init_destroy","Yes"
+"mq_receive - available",,"psxtmtest_single","Yes"
</font> "mq_receive - not available, block",,"psxtmtest_blocking",
<font color='#880000'>-"mq_timedreceive - available",,"psxtmtest_single",
</font><font color='#000088'>+"mq_timedreceive - available",,"psxtmtest_single","Yes"
</font> "mq_timedreceive - not available, blocks",,"psxtmtest_single",
<font color='#880000'>-"mq_send - no threads waiting",,"psxtmtest_single",
</font><font color='#000088'>+"mq_send - no threads waiting",,"psxtmtest_single","Yes"
</font> "mq_send - thread waiting, no preempt",,"psxtmtest_unblocking_nopreempt",
 "mq_send - thread waiting, preempt",,"psxtmtest_unblocking_preempt",
<font color='#880000'>-"mq_timedsend - no threads waiting",,"psxtmtest_single",
</font><font color='#000088'>+"mq_timedsend - no threads waiting",,"psxtmtest_single","Yes"
</font> "mq_timedsend - thread waiting, no preempt",,"psxtmtest_unblocking_nopreempt",
 "mq_timedsend - thread waiting, preemption",,"psxtmtest_unblocking_preempt",
<font color='#880000'>-"mq_notify ",,"psxtmtest_single",
</font><font color='#000088'>+"mq_notify ",,"psxtmtest_single","Yes"
</font> ,,,
 "sem_init","psxtmsem01","psxtmtest_single","Yes"
 "sem_destroy","psxtmsem01","psxtmtest_single","Yes"
</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>