mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:22:18 +08:00
examples/ostest can be executed in a loop
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@763 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -366,3 +366,4 @@
|
|||||||
verified).
|
verified).
|
||||||
* Host simulator no longer uses Linux system calls directly; Now works with Cygwin.
|
* Host simulator no longer uses Linux system calls directly; Now works with Cygwin.
|
||||||
* Fix an error that occurs when a POSIX timer is deleted by the timer signal handler.
|
* Fix an error that occurs when a POSIX timer is deleted by the timer signal handler.
|
||||||
|
* Add logic to allow the examples/ostest to be run repetitively as an endurance test.
|
||||||
|
|||||||
@@ -1016,6 +1016,7 @@ nuttx-0.3.11 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
|||||||
verified).
|
verified).
|
||||||
* Host simulator no longer uses Linux system calls directly; Now works with Cygwin.
|
* Host simulator no longer uses Linux system calls directly; Now works with Cygwin.
|
||||||
* Fix an error that occurs when a POSIX timer is deleted by the timer signal handler.
|
* Fix an error that occurs when a POSIX timer is deleted by the timer signal handler.
|
||||||
|
* Add logic to allow the examples/ostest to be run repetitively as an endurance test.
|
||||||
|
|
||||||
pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ nuttx$(EXEEXT): nuttx.rel $(HOSTOBJS)
|
|||||||
@$(NM) $(TOPDIR)/$@ | \
|
@$(NM) $(TOPDIR)/$@ | \
|
||||||
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||||
sort > $(TOPDIR)/System.map
|
sort > $(TOPDIR)/System.map
|
||||||
|
@rm -f nuttx.rel
|
||||||
|
|
||||||
.depend: Makefile $(SRCS)
|
.depend: Makefile $(SRCS)
|
||||||
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
@$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
|
||||||
|
|||||||
@@ -311,7 +311,8 @@ CONFIG_NET_RESOLV_ENTRIES=4
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Settings for examples/ostest
|
# Settings for examples/ostest
|
||||||
CONFIG_OSTEST_STACKSIZE=256
|
CONFIG_EXAMPLES_OSTEST_LOOPS=1
|
||||||
|
CONFIG_EXAMPLES_OSTEST_STACKSIZE=256
|
||||||
|
|
||||||
#
|
#
|
||||||
# Settings for examples/nsh
|
# Settings for examples/nsh
|
||||||
|
|||||||
@@ -281,6 +281,11 @@ CONFIG_EXAMPLE_NETTEST_DRIPADDR=(192<<24|168<<16|0<<8|1)
|
|||||||
CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
|
CONFIG_EXAMPLE_NETTEST_NETMASK=(255<<24|255<<16|255<<8|0)
|
||||||
CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
|
CONFIG_EXAMPLE_NETTEST_CLIENTIP=(192<<24|168<<16|0<<8|106)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Settings for examples/ostest
|
||||||
|
CONFIG_EXAMPLES_OSTEST_LOOPS=100
|
||||||
|
CONFIG_EXAMPLES_OSTEST_STACKSIZE=8192
|
||||||
|
|
||||||
#
|
#
|
||||||
# Settings for examples/nsh
|
# Settings for examples/nsh
|
||||||
CONFIG_EXAMPLES_NSH_TELNET=n
|
CONFIG_EXAMPLES_NSH_TELNET=n
|
||||||
|
|||||||
@@ -312,7 +312,8 @@ CONFIG_NET_RESOLV_ENTRIES=4
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Settings for examples/ostest
|
# Settings for examples/ostest
|
||||||
CONFIG_OSTEST_STACKSIZE=256
|
CONFIG_EXAMPLES_OSTEST_LOOPS=1
|
||||||
|
CONFIG_EXAMPLES_OSTEST_STACKSIZE=256
|
||||||
|
|
||||||
#
|
#
|
||||||
# Settings for examples/nsh
|
# Settings for examples/nsh
|
||||||
|
|||||||
@@ -312,7 +312,8 @@ CONFIG_NET_RESOLV_ENTRIES=4
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Settings for examples/ostest
|
# Settings for examples/ostest
|
||||||
CONFIG_OSTEST_STACKSIZE=256
|
CONFIG_EXAMPLES_OSTEST_LOOPS=1
|
||||||
|
CONFIG_EXAMPLES_OSTEST_STACKSIZE=256
|
||||||
|
|
||||||
#
|
#
|
||||||
# Settings for examples/nsh
|
# Settings for examples/nsh
|
||||||
|
|||||||
+5
-1
@@ -20,7 +20,11 @@ examples/ostest
|
|||||||
The behavior of the ostest can be modified with the following
|
The behavior of the ostest can be modified with the following
|
||||||
settings in the configs/<board-name>/defconfig file:
|
settings in the configs/<board-name>/defconfig file:
|
||||||
|
|
||||||
* CONFIG_OSTEST_STACKSIZE
|
* CONFIG_EXAMPLES_OSTEST_LOOPS
|
||||||
|
Used to control the number of executions of the test. If
|
||||||
|
undefined, the test executes one time. If defined to be
|
||||||
|
zero, the test runs forever.
|
||||||
|
* CONFIG_EXAMPLES_OSTEST_STACKSIZE
|
||||||
Used to create the ostest task. Default is 8192.
|
Used to create the ostest task. Default is 8192.
|
||||||
|
|
||||||
examples/nsh
|
examples/nsh
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ static void *barrier_func(void *parameter)
|
|||||||
usleep(500*1000);
|
usleep(500*1000);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Take the semaphore */
|
/* Wait at the barrier until all threads are synchronized. */
|
||||||
|
|
||||||
printf("barrier_func: Thread %d calling pthread_barrier_wait()\n", id);
|
printf("barrier_func: Thread %d calling pthread_barrier_wait()\n", id);
|
||||||
status = pthread_barrier_wait(&barrier);
|
status = pthread_barrier_wait(&barrier);
|
||||||
@@ -99,6 +99,7 @@ void barrier_test(void)
|
|||||||
{
|
{
|
||||||
printf("barrier_test: pthread_barrierattr_init failed, status=%d\n", status);
|
printf("barrier_test: pthread_barrierattr_init failed, status=%d\n", status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the barrier */
|
/* Create the barrier */
|
||||||
|
|
||||||
status = pthread_barrierattr_init(&barrierattr);
|
status = pthread_barrierattr_init(&barrierattr);
|
||||||
|
|||||||
+21
-4
@@ -58,12 +58,21 @@
|
|||||||
#define NARGS 4
|
#define NARGS 4
|
||||||
|
|
||||||
/* The task_create task size can be specified in the defconfig file */
|
/* The task_create task size can be specified in the defconfig file */
|
||||||
#ifdef CONFIG_OSTEST_STACKSIZE
|
|
||||||
# define STACKSIZE CONFIG_OSTEST_STACKSIZE
|
#ifdef CONFIG_EXAMPLES_OSTEST_STACKSIZE
|
||||||
|
# define STACKSIZE CONFIG_EXAMPLES_OSTEST_STACKSIZE
|
||||||
#else
|
#else
|
||||||
# define STACKSIZE 8192
|
# define STACKSIZE 8192
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* The number of times to execute the test can be specified in the defconfig
|
||||||
|
* file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_EXAMPLES_OSTEST_LOOPS
|
||||||
|
# define CONFIG_EXAMPLES_OSTEST_LOOPS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -280,6 +289,14 @@ static int user_main(int argc, char *argv[])
|
|||||||
check_test_memory_usage();
|
check_test_memory_usage();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Top of test loop */
|
||||||
|
|
||||||
|
#if CONFIG_EXAMPLES_OSTEST_LOOPS > 1
|
||||||
|
for (i = 0; i < CONFIG_EXAMPLES_OSTEST_LOOPS; i++)
|
||||||
|
#elif CONFIG_EXAMPLES_OSTEST_LOOPS == 0
|
||||||
|
for (;;)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||||
/* Checkout /dev/null */
|
/* Checkout /dev/null */
|
||||||
|
|
||||||
@@ -394,7 +411,7 @@ static int user_main(int argc, char *argv[])
|
|||||||
printf("\nFinal memory usage:\n");
|
printf("\nFinal memory usage:\n");
|
||||||
show_memory_usage(&g_mmbefore, &g_mmafter);
|
show_memory_usage(&g_mmbefore, &g_mmafter);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
printf("user_main: Exitting\n");
|
printf("user_main: Exitting\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -446,7 +463,7 @@ int user_start(int argc, char *argv[])
|
|||||||
stdio_test();
|
stdio_test();
|
||||||
|
|
||||||
#ifdef SDCC
|
#ifdef SDCC
|
||||||
/* I am not yet certain why SDCC does not like the initilizer.
|
/* I am not yet certain why SDCC does not like the following initilizers.
|
||||||
* It involves some issues with 2- vs 3-byte pointer types.
|
* It involves some issues with 2- vs 3-byte pointer types.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user