change log for rtems (2011-07-12)

rtems-vc at rtems.org rtems-vc at rtems.org
Tue Jul 12 14:10:22 UTC 2011


 *joel*:
2011-07-12	Ricardo Aguirre <el.mastin at ymail.com>

	* Makefile.am, configure.ac, psxtmtests_plan.csv: Add psxtmmutex03.
	* psxtmmutex03/.cvsignore, psxtmmutex03/Makefile.am,
	psxtmmutex03/init.c, psxtmmutex03/psxtmmutex03.doc: New files.

M   1.15  testsuites/psxtmtests/ChangeLog
M    1.5  testsuites/psxtmtests/Makefile.am
M    1.7  testsuites/psxtmtests/configure.ac
A    1.1  testsuites/psxtmtests/psxtmmutex03/.cvsignore
A    1.1  testsuites/psxtmtests/psxtmmutex03/Makefile.am
A    1.1  testsuites/psxtmtests/psxtmmutex03/init.c
A    1.1  testsuites/psxtmtests/psxtmmutex03/psxtmmutex03.doc
M    1.8  testsuites/psxtmtests/psxtmtests_plan.csv

diff -u rtems/testsuites/psxtmtests/ChangeLog:1.14 rtems/testsuites/psxtmtests/ChangeLog:1.15
--- rtems/testsuites/psxtmtests/ChangeLog:1.14	Thu Jun 30 07:49:17 2011
+++ rtems/testsuites/psxtmtests/ChangeLog	Tue Jul 12 08:22:24 2011
@@ -1,3 +1,9 @@
+2011-07-12	Ricardo Aguirre <el.mastin at ymail.com>
+
+	* Makefile.am, configure.ac, psxtmtests_plan.csv: Add psxtmmutex03.
+	* psxtmmutex03/.cvsignore, psxtmmutex03/Makefile.am,
+	psxtmmutex03/init.c, psxtmmutex03/psxtmmutex03.doc: New files.
+
 2011-06-29	Ricardo Aguirre <el.mastin at ymail.com>
 
 	* psxtmtests/Makefile.am, psxtmtests/configure.ac,

diff -u rtems/testsuites/psxtmtests/Makefile.am:1.4 rtems/testsuites/psxtmtests/Makefile.am:1.5
--- rtems/testsuites/psxtmtests/Makefile.am:1.4	Wed Jun 29 14:09:11 2011
+++ rtems/testsuites/psxtmtests/Makefile.am	Tue Jul 12 08:22:24 2011
@@ -12,6 +12,7 @@
 SUBDIRS += psxtmthread03
 SUBDIRS += psxtmnanosleep01
 SUBDIRS += psxtmnanosleep02
+SUBDIRS += psxtmmutex03
 endif
 
 DIST_SUBDIRS = $(SUBDIRS)

diff -u rtems/testsuites/psxtmtests/configure.ac:1.6 rtems/testsuites/psxtmtests/configure.ac:1.7
--- rtems/testsuites/psxtmtests/configure.ac:1.6	Wed Jun 29 14:09:11 2011
+++ rtems/testsuites/psxtmtests/configure.ac	Tue Jul 12 08:22:24 2011
@@ -80,6 +80,7 @@
 # Explicitly list all Makefiles here
 AC_CONFIG_FILES([Makefile
 psxtmmutex02/Makefile
+psxtmmutex03/Makefile
 psxtmsleep01/Makefile
 psxtmsleep02/Makefile
 psxtmthread01/Makefile

diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmutex03/.cvsignore:1.1
--- /dev/null	Tue Jul 12 09:10:21 2011
+++ rtems/testsuites/psxtmtests/psxtmmutex03/.cvsignore	Tue Jul 12 08:22:24 2011
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in

diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmutex03/Makefile.am:1.1
--- /dev/null	Tue Jul 12 09:10:21 2011
+++ rtems/testsuites/psxtmtests/psxtmmutex03/Makefile.am	Tue Jul 12 08:22:24 2011
@@ -0,0 +1,30 @@
+##
+## $Id$
+##
+
+MANAGERS = all
+
+rtems_tests_PROGRAMS = psxtmmutex03
+psxtmmutex03_SOURCES = init.c ../../tmtests/include/timesys.h \
+    ../../support/src/tmtests_empty_function.c \
+    ../../support/src/tmtests_support.c
+
+dist_rtems_tests_DATA = psxtmmutex03.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 = $(psxtmmutex03_OBJECTS) $(psxtmmutex03_LDADD)
+LINK_LIBS = $(psxtmmutex03_LDLIBS)
+
+psxtmmutex03$(EXEEXT): $(psxtmmutex03_OBJECTS) $(psxtmmutex03_DEPENDENCIES)
+	@rm -f psxtmmutex03$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am

diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmutex03/init.c:1.1
--- /dev/null	Tue Jul 12 09:10:21 2011
+++ rtems/testsuites/psxtmtests/psxtmmutex03/init.c	Tue Jul 12 08:22:24 2011
@@ -0,0 +1,175 @@
+/*
+ *  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_mutex_t MutexId;
+
+void benchmark_mutex_lock_available(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_lock( &MutexId );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( !status );
+
+  put_time(
+    "pthread_mutex_lock - available",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+void benchmark_mutex_unlock_no_threads_waiting(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_unlock( &MutexId );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( !status );
+
+  put_time(
+    "pthread_mutex_unlock - no threads waiting",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+void benchmark_mutex_trylock_available(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_trylock( &MutexId );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( !status );
+
+  put_time(
+    "pthread_mutex_trylock - available",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+
+void benchmark_mutex_trylock_not_available(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_trylock( &MutexId );
+    /* 
+     * it has to return a negative value 
+     * because it try to lock a not available mutex    
+     * so the assert call is make with status instead !status 
+     */
+  end_time = benchmark_timer_read();
+  rtems_test_assert( status );
+
+  put_time(
+    "pthread_mutex_trylock - not available",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+void benchmark_mutex_timedlock_available(void)
+{
+  long end_time;
+  int  status;
+
+  benchmark_timer_initialize();
+    status = pthread_mutex_timedlock( &MutexId, 0 );
+  end_time = benchmark_timer_read();
+  rtems_test_assert( !status );
+
+  put_time(
+    "pthread_mutex_timedlock - available",
+    end_time,
+    1,
+    0,
+    0
+  );
+}
+
+void *POSIX_Init(
+  void *argument
+)
+{
+  int  status;
+
+  puts( "\n\n*** POSIX TIME TEST PSXTMMUTEX03 ***" );
+  
+  /*
+   * Create the single Mutex used in all the test case
+   */
+  status = pthread_mutex_init( &MutexId, NULL );
+  rtems_test_assert( !status );
+
+  /*
+   * Now invoke subroutines to time each test case 
+   * get the goal depends of its order
+   */
+  benchmark_mutex_lock_available();
+  benchmark_mutex_unlock_no_threads_waiting();
+  benchmark_mutex_trylock_available();
+  benchmark_mutex_trylock_not_available();
+  benchmark_mutex_unlock_no_threads_waiting();
+  benchmark_mutex_timedlock_available();
+  benchmark_mutex_unlock_no_threads_waiting();
+  
+
+  /*
+   *  Destroy the mutex used in the tests
+   */
+  status = pthread_mutex_destroy( &MutexId );
+  rtems_test_assert( !status );
+
+  puts( "*** END OF POSIX TIME TEST PSXTMMUTEX03 ***" );
+
+  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_MUTEXES     1
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
+/* end of file */

diff -u /dev/null rtems/testsuites/psxtmtests/psxtmmutex03/psxtmmutex03.doc:1.1
--- /dev/null	Tue Jul 12 09:10:21 2011
+++ rtems/testsuites/psxtmtests/psxtmmutex03/psxtmmutex03.doc	Tue Jul 12 08:22:24 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:
+
++ pthread_mutex_lock - available 
++ pthread_mutex_unlock - no threads waiting 
++ pthread_mutex_trylock - available 
++ pthread_mutex_trylock - not available 
++ pthread_mutex_unlock - no threads waiting 
++ pthread_mutex_timedlock - available 
++ pthread_mutex_unlock - no threads waiting 

diff -u rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.7 rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.8
--- rtems/testsuites/psxtmtests/psxtmtests_plan.csv:1.7	Wed Jun 29 14:09:11 2011
+++ rtems/testsuites/psxtmtests/psxtmtests_plan.csv	Tue Jul 12 08:22:24 2011
@@ -2,13 +2,13 @@
 "pthread_mutex_init","psxtmmutex01","psxtmtest_init_destroy",
 "pthread_mutex_destroy","psxtmmutex01","psxtmtest_init_destroy",
 "pthread_mutex_lock - not available, block","psxtmmutex02","psxtmtest_blocking","Yes"
-"pthread_mutex_lock - available","psxtmmutex03","psxtmtest_single",
-"pthread_mutex_trylock - available","psxtmmutex04","psxtmtest_single",
-"pthread_mutex_trylock - not available","psxtmmutex05","psxtmtest_single",
-"pthread_mutex_unlock - no threads waiting","psxtmmutex06","psxtmtest_single",
+"pthread_mutex_lock - available","psxtmmutex03","psxtmtest_single","Yes"
+"pthread_mutex_trylock - available","psxtmmutex03","psxtmtest_single","Yes"
+"pthread_mutex_trylock - not available","psxtmmutex03","psxtmtest_single","Yes"
+"pthread_mutex_unlock - no threads waiting","psxtmmutex03","psxtmtest_single","Yes"
 "pthread_mutex_unlock - thread waiting, no preempt","psxtmmutex07","psxtmtest_unblocking_nopreempt",
 "pthread_mutex_unlock - thread waiting, preempt","psxtmmutex08","psxtmtest_unblocking_preempt",
-"pthread_mutex_timedlock - available","psxtmmutex09","psxtmtest_single",
+"pthread_mutex_timedlock - available","psxtmmutex03","psxtmtest_single","Yes"
 "pthread_mutex_timedlock - not available, block","psxtmmutex10","psxtmtest_blocking",
 "pthread_mutex_setprioceiling","psxtmmutex11","psxtmtest_single",
 "pthread_mutex_getprioceiling","psxtmmutex12","psxtmtest_single",


 *joel*:
2011-07-12	Joel Sherrill <joel.sherrill at oarcorp.com>

	* psxtmnanosleep01/init.c, psxtmsleep01/init.c: Do not divide by
	OPERATION_COUNT on single shot times.

M   1.16  testsuites/psxtmtests/ChangeLog
M    1.2  testsuites/psxtmtests/psxtmnanosleep01/init.c
M    1.2  testsuites/psxtmtests/psxtmsleep01/init.c

diff -u rtems/testsuites/psxtmtests/ChangeLog:1.15 rtems/testsuites/psxtmtests/ChangeLog:1.16
--- rtems/testsuites/psxtmtests/ChangeLog:1.15	Tue Jul 12 08:22:24 2011
+++ rtems/testsuites/psxtmtests/ChangeLog	Tue Jul 12 08:25:18 2011
@@ -1,3 +1,8 @@
+2011-07-12	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* psxtmnanosleep01/init.c, psxtmsleep01/init.c: Do not divide by
+	OPERATION_COUNT on single shot times.
+
 2011-07-12	Ricardo Aguirre <el.mastin at ymail.com>
 
 	* Makefile.am, configure.ac, psxtmtests_plan.csv: Add psxtmmutex03.

diff -u rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c:1.1 rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c:1.2
--- rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c:1.1	Wed Jun 29 14:09:11 2011
+++ rtems/testsuites/psxtmtests/psxtmnanosleep01/init.c	Tue Jul 12 08:25:18 2011
@@ -23,18 +23,17 @@
 {
   long end_time;
   struct timespec sleepTime;
+
   sleepTime.tv_sec = 0;
   sleepTime.tv_nsec = 0;
 
   puts( "\n\n*** POSIX TIME TEST PSXTMNANOSLEEP01 ***" );
 
   benchmark_timer_initialize();    
-
-  nanosleep(&sleepTime, (struct  timespec *) NULL);
-
+    nanosleep( &sleepTime, (struct  timespec *) NULL );
   end_time = benchmark_timer_read();  
 
-  put_time("nanosleep - yield X ",end_time,OPERATION_COUNT,0,0);
+  put_time( "nanosleep - yield", end_time, 1, 0, 0 );
 
   puts( "*** END OF POSIX TIME TEST PSXTMNANOSLEEP01 ***" );
 

diff -u rtems/testsuites/psxtmtests/psxtmsleep01/init.c:1.1 rtems/testsuites/psxtmtests/psxtmsleep01/init.c:1.2
--- rtems/testsuites/psxtmtests/psxtmsleep01/init.c:1.1	Mon Jun 13 14:28:57 2011
+++ rtems/testsuites/psxtmtests/psxtmsleep01/init.c	Tue Jul 12 08:25:18 2011
@@ -28,15 +28,13 @@
   puts( "\n\n*** POSIX TIME TEST PSXTMSLEEP01 ***" );
 
   benchmark_timer_initialize();
-
     sleep(0);
-
   end_time = benchmark_timer_read();
 
   put_time(
-    "sleep - yield X ",
+    "sleep - yield",
     end_time,
-    OPERATION_COUNT,
+    1,
     0,
     0
   );



--

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/20110712/c68dd2bb/attachment.html>


More information about the vc mailing list