<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 7, 2018 at 12:36 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It would be nice if GCI2018 patches are sent to <a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a> for <br>
review before they are committed.<br></blockquote><div><br></div><div>We will do this in the future and I will fix these but it also would have been nice to </div><div>have gotten this feedback when it was on the templates that I posted patches to</div><div>update at least a week ago and no one said a word. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 07/11/2018 01:36, Joel Sherrill wrote:<br>
> Module: rtems<br>
> Branch: master<br>
> Commit: 9bb395167a1cc7d8551d217825313bffcd0d8e1b<br>
> Changeset: <a href="http://git.rtems.org/rtems/commit/?id=9bb395167a1cc7d8551d217825313bffcd0d8e1b" rel="noreferrer" target="_blank">http://git.rtems.org/rtems/commit/?id=9bb395167a1cc7d8551d217825313bffcd0d8e1b</a><br>
><br>
> Author: Himanshu40 <<a href="mailto:himanshuwindows8.1@gmail.com" target="_blank">himanshuwindows8.1@gmail.com</a>><br>
> Date: Wed Nov 7 00:17:10 2018 +0530<br>
><br>
> psxtmonce01: New test written by Himanshu40 as part of GCI2018<br>
><br>
> ---<br>
><br>
> testsuites/psxtmtests/Makefile.am | 11 +++<br>
> testsuites/psxtmtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 1 +<br>
> testsuites/psxtmtests/psxtmonce01/Makefile.am | 27 ++++++++<br>
> testsuites/psxtmtests/psxtmonce01/init.c | 82 +++++++++++++++++++++++<br>
> testsuites/psxtmtests/psxtmonce01/psxtmonce01.doc | 18 +++++<br>
> 5 files changed, 139 insertions(+)<br>
><br>
> diff --git a/testsuites/psxtmtests/Makefile.am b/testsuites/psxtmtests/Makefile.am<br>
> index 2669107..1607ac6 100644<br>
> --- a/testsuites/psxtmtests/Makefile.am<br>
> +++ b/testsuites/psxtmtests/Makefile.am<br>
> @@ -338,6 +338,17 @@ psxtmnanosleep02_CPPFLAGS = $(AM_CPPFLAGS) \<br>
> -DOPERATION_COUNT=$(OPERATION_COUNT)<br>
> endif<br>
> <br>
> +if TEST_psxtmonce01<br>
> +psxtm_tests += psxtmonce01<br>
> +psxtm_docs += psxtmonce01/psxtmonce01.doc<br>
> +psxtmonce01_SOURCES = psxtmonce01/init.c \<br>
> + ../tmtests/include/timesys.h ../support/src/tmtests_empty_function.c \<br>
> + ../support/src/tmtests_support.c<br>
> +psxtmonce01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxtmonce01) \<br>
> + $(support_includes) -I$(top_srcdir)/../tmtests/include \<br>
> + -DOPERATION_COUNT=$(OPERATION_COUNT)<br>
> +endif<br>
> +<br>
> if TEST_psxtmrwlock01<br>
> psxtm_tests += psxtmrwlock01<br>
> psxtm_docs += psxtmrwlock01/psxtmrwlock01.doc<br>
> diff --git a/testsuites/psxtmtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/testsuites/psxtmtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> index 59192d0..0c3b143 100644<br>
> --- a/testsuites/psxtmtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> +++ b/testsuites/psxtmtests/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
> @@ -59,6 +59,7 @@ RTEMS_TEST_CHECK([psxtmmutex06])<br>
> RTEMS_TEST_CHECK([psxtmmutex07])<br>
> RTEMS_TEST_CHECK([psxtmnanosleep01])<br>
> RTEMS_TEST_CHECK([psxtmnanosleep02])<br>
> +RTEMS_TEST_CHECK([psxtmonce01])<br>
> RTEMS_TEST_CHECK([psxtmrwlock01])<br>
> RTEMS_TEST_CHECK([psxtmrwlock02])<br>
> RTEMS_TEST_CHECK([psxtmrwlock03])<br>
> diff --git a/testsuites/psxtmtests/psxtmonce01/Makefile.am b/testsuites/psxtmtests/psxtmonce01/Makefile.am<br>
> new file mode 100644<br>
> index 0000000..242e393<br>
> --- /dev/null<br>
> +++ b/testsuites/psxtmtests/psxtmonce01/Makefile.am<br>
> @@ -0,0 +1,27 @@<br>
> +MANAGERS = all<br>
> +<br>
> +rtems_tests_PROGRAMS = psxtmonce01<br>
> +psxtmonce01_SOURCES = init.c<br>
> +psxtmonce01_SOURCES += ../../tmtests/include/timesys.h<br>
> +psxtmonce01_SOURCES += ../../support/src/tmtests_empty_function.c<br>
> +psxtmonce01_SOURCES += ../../support/src/tmtests_support.c<br>
> +<br>
> +dist_rtems_tests_DATA = psxtmonce01.doc<br>
> +<br>
> +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg<br>
> +include $(top_srcdir)/../automake/<a href="http://compile.am" rel="noreferrer" target="_blank">compile.am</a><br>
> +include $(top_srcdir)/../automake/<a href="http://leaf.am" rel="noreferrer" target="_blank">leaf.am</a><br>
> +<br>
> +OPERATION_COUNT = @OPERATION_COUNT@<br>
> +AM_CPPFLAGS += -I$(top_srcdir)/../tmtests/include<br>
> +AM_CPPFLAGS += -DOPERATION_COUNT=$(OPERATION_COUNT)<br>
> +AM_CPPFLAGS += -I$(top_srcdir)/../support/include<br>
> +<br>
> +LINK_OBJS = $(psxtmonce01_OBJECTS) $(psxtmonce01_LDADD)<br>
> +LINK_LIBS = $(psxtmonce01_LDLIBS)<br>
> +<br>
> +psxtmonce01$(EXEEXT): $(psxtmonce01_OBJECTS) $(psxtmonce01_DEPENDENCIES)<br>
> + @rm -f psxtmonce01$(EXEEXT)<br>
> + $(make-exe)<br>
> +<br>
> +include $(top_srcdir)/../automake/<a href="http://local.am" rel="noreferrer" target="_blank">local.am</a><br>
<br>
This testsuites/psxtmtests/psxtmonce01/Makefile.am is superfluous.<br>
<br>
> diff --git a/testsuites/psxtmtests/psxtmonce01/init.c b/testsuites/psxtmtests/psxtmonce01/init.c<br>
> new file mode 100644<br>
> index 0000000..5f8391a<br>
> --- /dev/null<br>
> +++ b/testsuites/psxtmtests/psxtmonce01/init.c<br>
> @@ -0,0 +1,82 @@<br>
> +/*<br>
> + * COPYRIGHT (c) 2018.<br>
> + * Himanshu Sekhar Nayak GCI 2018<br>
> + *<br>
> + * Permission to use, copy, modify, and/or distribute this software<br>
> + * for any purpose with or without fee is hereby granted.<br>
> + *<br>
> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL<br>
> + * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED<br>
> + * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR<br>
> + * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES<br>
> + * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,<br>
> + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,<br>
> + * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.<br>
> + */<br>
> +<br>
> +#ifdef HAVE_CONFIG_H<br>
> +#include "config.h"<br>
> +#endif<br>
> +<br>
> +#include <pthread.h><br>
> +#include <tmacros.h><br>
> +#include <timesys.h><br>
> +#include <rtems/btimer.h><br>
> +#include "test_support.h"<br>
> +<br>
> +const char rtems_test_name[] = "PSXTMONCE01";<br>
> +<br>
> +/* forward declarations to avoid warnings */<br>
> +void *POSIX_Init(void *argument);<br>
> +void benchmark_first_time(void);<br>
> +void initRoutine(void);<br>
<br>
Why not use static functions?<br>
<br>
> +<br>
> +pthread_once_t once_control = PTHREAD_ONCE_INIT;<br>
> +<br>
> +void initRoutine(void)<br>
> +{<br>
> +}<br>
> +<br>
> +void benchmark_first_time(void)<br>
> +{<br>
> + long end_time;<br>
> + int status;<br>
> +<br>
> + benchmark_timer_initialize();<br>
> + status = pthread_once( &once_control, initRoutine );<br>
> + end_time = benchmark_timer_read();<br>
> + rtems_test_assert( status == 0 );<br>
> +<br>
> + put_time(<br>
> + "pthread_once: first time",<br>
> + end_time,<br>
> + 1, /* Only executed once */<br>
> + 0,<br>
> + 0<br>
> + );<br>
> +}<br>
> +<br>
> +void *POSIX_Init(<br>
> + void *argument<br>
> +)<br>
> +{<br>
> +<br>
> + TEST_BEGIN();<br>
> + benchmark_first_time();<br>
> + TEST_END();<br>
> +<br>
> + rtems_test_exit(0);<br>
> +}<br>
> +<br>
> +/* configuration information */<br>
> +<br>
> +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER<br>
<br>
Tests should use this console driver:<br>
<br>
#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER<br>
<br>
This is particularly important for timing tests.<br>
<br>
> +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER<br>
<br>
Could we please use the <rtems/counter.h> for new timing tests.<br>
<br>
> +<br>
> +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1<br>
> +#define CONFIGURE_POSIX_INIT_THREAD_TABLE<br>
> +<br>
> +#define CONFIGURE_INIT<br>
> +<br>
> +#include <rtems/confdefs.h><br>
> +/* end of file */<br>
> diff --git a/testsuites/psxtmtests/psxtmonce01/psxtmonce01.doc b/testsuites/psxtmtests/psxtmonce01/psxtmonce01.doc<br>
> new file mode 100644<br>
> index 0000000..cd7b2ea<br>
> --- /dev/null<br>
> +++ b/testsuites/psxtmtests/psxtmonce01/psxtmonce01.doc<br>
> @@ -0,0 +1,18 @@<br>
> +# COPYRIGHT (c) 2018.<br>
> +# Himanshu Sekhar Nayak GCI 2018<br>
> +#<br>
> +# Permission to use, copy, modify, and/or distribute this software<br>
> +# for any purpose with or without fee is hereby granted.<br>
> +#<br>
> +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL<br>
> +# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED<br>
> +# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR<br>
> +# BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES<br>
> +# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,<br>
> +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,<br>
> +# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.<br>
> +#<br>
> +<br>
> +This test benchmarks the following operations:<br>
> +<br>
> ++ pthread_once - first time, empty initialization method<br>
><br>
> _______________________________________________<br>
> vc mailing list<br>
> <a href="mailto:vc@rtems.org" target="_blank">vc@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/vc" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/vc</a><br>
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone : +49 89 189 47 41-16<br>
Fax : +49 89 189 47 41-09<br>
E-Mail : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
PGP : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
<br>
</blockquote></div></div>