diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-03-31 11:32:22 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-03-31 11:32:22 -0600 |
commit | ceaab68ab85dbb6e92dbbfdb7bd09260bb28b43b (patch) | |
tree | 5991e7491a65b1eadc51bd1e5c3fd723d468f0b9 /nuttx/sched/Kconfig | |
parent | e782d4d4fb8f0ab8c353fc57bbb6cf8296f079f7 (diff) | |
download | px4-nuttx-ceaab68ab85dbb6e92dbbfdb7bd09260bb28b43b.tar.gz px4-nuttx-ceaab68ab85dbb6e92dbbfdb7bd09260bb28b43b.tar.bz2 px4-nuttx-ceaab68ab85dbb6e92dbbfdb7bd09260bb28b43b.zip |
sched/Kconfig: Add another layer of menuing to simply this level
Diffstat (limited to 'nuttx/sched/Kconfig')
-rw-r--r-- | nuttx/sched/Kconfig | 555 |
1 files changed, 294 insertions, 261 deletions
diff --git a/nuttx/sched/Kconfig b/nuttx/sched/Kconfig index eb98f2f15..c944819b1 100644 --- a/nuttx/sched/Kconfig +++ b/nuttx/sched/Kconfig @@ -3,33 +3,55 @@ # see misc/tools/kconfig-language.txt. # -config BOARD_INITIALIZE - bool "Custom board/driver initialization" - default n +menuconfig DISABLE_OS_API + bool "Disable NuttX interfaces" + default y ---help--- - By default, there are three points in time where you can insert - custom initialization logic: + The following can be used to disable categories of + APIs supported by the OS. If the compiler supports + weak functions, then it should not be necessary to + disable functions unless you want to restrict usage + of those APIs. - 1) <arch>_boardinitialize(): This function is used only for - initialization of very low-level things like configuration of - GPIO pins, power setting. The OS has not been initialized - at this point, so you cannot allocate memory or initialize - device drivers at this phase. + There are certain dependency relationships in these + features. - 2) The next level of initialization is performed by a call to - up_initialize() (in arch/<arch>/src/common/up_initialize.c). - The OS has been initialized at this point and it is okay to - initialize drivers in this phase. + 1) mq_notify logic depends on signals to awaken tasks + waiting for queues to become full or empty. + 2) pthread_condtimedwait() depends on signals to wake + up waiting tasks. - 3) And, finally, when the user application code starts. +if DISABLE_OS_API - If BOARD_INITIALIZE is selected, then an additional initialization - call will be performed in the boot-up sequence to a function - called board_initialize(). board_initialize() will be - call between phases 2) and 3) above, immediately after - up_initialize() is called. This additional initialization - phase may be used, for example, to initialize board-specific - device drivers. +config DISABLE_CLOCK + bool "Disable clock interfaces" + default n + +config DISABLE_POSIX_TIMERS + bool "Disable POSIX timers" + default y if DEFAULT_SMALL + default n if !DEFAULT_SMALL + +config DISABLE_PTHREAD + bool "Disable pthread support" + default n + +config DISABLE_SIGNALS + bool "Disable signal support" + default n + +config DISABLE_MQUEUE + bool "Disable POSIX message queue support" + default n + +config DISABLE_ENVIRON + bool "Disable environment variable support" + default y if DEFAULT_SMALL + default n if !DEFAULT_SMALL + +endif # DISABLE_OS_API + +menu "Clocks and Timers" config MSEC_PER_TICK int "Milliseconds per system timer tick" @@ -67,87 +89,63 @@ config CLOCK_MONOTONIC The value of the CLOCK_MONOTONIC clock cannot be set via clock_settime(). -config RR_INTERVAL - int "Round robin timeslice (MSEC)" - default 0 - ---help--- - The round robin timeslice will be set this number of milliseconds; - Round robin scheduling can be disabled by setting this value to zero. - -config SCHED_CPULOAD - bool "Enable CPU load monitoring" +config JULIAN_TIME + bool "Enables Julian time conversions" default n ---help--- - If this option is selected, the timer interrupt handler will monitor - if the system is IDLE or busy at the time of that the timer interrupt - occurs. This is a very coarse measurement, but over a period of time, - it can very accurately determined the percentage of the time that the - CPU is IDLE. - - The statistics collected in this could be used, for example in the - PROCFS file system to provide CPU load measurements when read. + Enables Julian time conversions -if SCHED_CPULOAD +config START_YEAR + int "Start year" + default 2014 -config SCHED_CPULOAD_EXTCLK - bool "Use external clock" - default n - ---help--- - The CPU load measurements are determined by sampling the active - tasks periodically at the occurrence to a timer expiration. By - default, the system clock is used to do that sampling. +config START_MONTH + int "Start month" + default 1 - There is a serious issue for the accuracy of measurements if the - system clock is used, however. NuttX threads are often started at - the time of the system timer expiration. Others may be stopped at - the time of the system timer expiration (if round-robin time-slicing - is enabled). Such thread behavior occurs synchronously with the - system timer and, hence, is not randomly sampled. As a consequence, - the CPU load attributed to these threads that run synchronously with - they system timer may be grossly in error. +config START_DAY + int "Start day" + default 1 - The solution is to use some other clock that runs at a different - rate and has timer expirations that are asynchronous with the - system timer. Then truly accurate load measurements can be - achieved. This option enables use of such an "external" clock. The - implementation of the clock must be provided by platform-specific - logic; that platform-specific logic must call the system function - sched_process_cpuload() at each timer expiration with interrupts - disabled. +config MAX_WDOGPARMS + int "Maximum number of watchdog parameters" + default 4 + ---help--- + Maximum number of parameters that can be passed to a watchdog handler -config SCHED_CPULOAD_TICKSPERSEC - int "External clock rate" - default 100 - depends on SCHED_CPULOAD_EXTCLK +config PREALLOC_WDOGS + int "Number of pre-allocated watchdog timers" + default 32 ---help--- - If an external clock is used to drive the sampling for the CPU load - calculations, then this value must be provided. This value provides - the rate of the external clock in units of ticks per second. The - default value of 100 corresponds to 100Hz clock. NOTE: that 100Hz - is the default frequency of the system time and, hence, the worst - possible choice in most cases. + The number of pre-allocated watchdog structures. The system manages a + pool of preallocated watchdog structures to minimize dynamic allocations -config SCHED_CPULOAD_TIMECONSTANT - int "CPU load time constant" - default 2 +config PREALLOC_TIMERS + int "Number of pre-allocated POSIX timers" + default 8 ---help--- - The accumulated CPU count is divided by two when the accumulated - tick count exceeds this time constant. This time constant is in - units of seconds. + The number of pre-allocated POSIX timer structures. The system manages a + pool of preallocated timer structures to minimize dynamic allocations. Set to + zero for all dynamic allocations. -endif # SCHED_CPULOAD +endmenu # Clocks and Timers -config SCHED_INSTRUMENTATION - bool "Monitor system performance" - default n +menu "Tasks and Scheduling" + +config USER_ENTRYPOINT + string "Application entry point" + default "user_start" ---help--- - Enables instrumentation in scheduler to monitor system performance. - If enabled, then the board-specific logic must provide the following - functions (see include/sched.h): + The name of the entry point for user applications. For the example + applications this is of the form 'app_main' where 'app' is the application + name. If not defined, USER_ENTRYPOINT defaults to "user_start." - void sched_note_start(FAR struct tcb_s *tcb); - void sched_note_stop(FAR struct tcb_s *tcb); - void sched_note_switch(FAR struct tcb_s *pFromTcb, FAR struct tcb_s *pToTcb); +config RR_INTERVAL + int "Round robin timeslice (MSEC)" + default 0 + ---help--- + The round robin timeslice will be set this number of milliseconds; + Round robin scheduling can be disabled by setting this value to zero. config TASK_NAME_SIZE int "Maximum task name size" @@ -157,6 +155,20 @@ config TASK_NAME_SIZE Useful if scheduler instrumentation is selected. Set to zero to disable. +config MAX_TASK_ARGS + int "Maximum number of task arguments" + default 4 + ---help--- + This controls the maximum number of of parameters that a task may + receive (i.e., maxmum value of 'argc') + +config MAX_TASKS + int "Max number of tasks" + default 32 + ---help--- + The maximum number of simultaneously active tasks. This value must be + a power of two. + config SCHED_HAVE_PARENT bool "Support parent/child task relationships" default n @@ -209,10 +221,11 @@ config SCHED_CHILD_STATUS sa.sa_flags = SA_NOCLDWAIT; int ret = sigaction(SIGCHLD, &sa, NULL); +if SCHED_CHILD_STATUS + config PREALLOC_CHILDSTATUS int "Number of pre-allocated child status" default 0 - depends on SCHED_CHILD_STATUS ---help--- To prevent runaway child status allocations and to improve allocation performance, child task exit status structures are pre- @@ -250,30 +263,23 @@ config DEBUG_CHILDSTATUS ---help--- Very detailed... I am sure that you do not want this. -config JULIAN_TIME - bool "Enables Julian time conversions" +endif # SCHED_CHILD_STATUS + +config SCHED_WAITPID + bool "Enable waitpid() API" default n ---help--- - Enables Julian time conversions + Enables the waitpid() interface in a default, non-standard mode + (non-standard in the sense that the waited for PID need not be child + of the caller). If SCHED_HAVE_PARENT is also defined, then this + setting will modify the behavior or waitpid() (making more spec + compliant) and will enable the waitid() and wait() interfaces as + well. -config START_YEAR - int "Start year" - default 2014 +endmenu # Tasks and Scheduling -config START_MONTH - int "Start month" - default 1 - -config START_DAY - int "Start day" - default 1 - -config DEV_CONSOLE - bool "Enable /dev/console" - default y - ---help--- - Set if architecture-specific logic provides /dev/console. Enables - stdout, stderr, stdin. +menu "Pthread Options" + depends on !DISABLE_PTHREAD config MUTEX_TYPES: bool "Enable mutex types" @@ -282,34 +288,102 @@ config MUTEX_TYPES: Set to enable support for recursive and errorcheck mutexes. Enables pthread_mutexattr_settype(). -config PRIORITY_INHERITANCE - bool "Enable priority inheritance " +config NPTHREAD_KEYS + int "Maximum number of pthread keys" + default 4 + ---help--- + The number of items of thread- + specific data that can be retained + +endmenu # Pthread Options + +menu "Performance Monitoring" + +config SCHED_CPULOAD + bool "Enable CPU load monitoring" default n ---help--- - Set to enable support for priority inheritance on mutexes and semaphores. + If this option is selected, the timer interrupt handler will monitor + if the system is IDLE or busy at the time of that the timer interrupt + occurs. This is a very coarse measurement, but over a period of time, + it can very accurately determined the percentage of the time that the + CPU is IDLE. -config SEM_PREALLOCHOLDERS - int "Number of pre-allocated holders" - default 16 - depends on PRIORITY_INHERITANCE + The statistics collected in this could be used, for example in the + PROCFS file system to provide CPU load measurements when read. + +if SCHED_CPULOAD + +config SCHED_CPULOAD_EXTCLK + bool "Use external clock" + default n ---help--- - This setting is only used if priority inheritance is enabled. - It defines the maximum number of different threads (minus one) that - can take counts on a semaphore with priority inheritance support. - This may be set to zero if priority inheritance is disabled OR if you - are only using semaphores as mutexes (only one holder) OR if no more - than two threads participate using a counting semaphore. + The CPU load measurements are determined by sampling the active + tasks periodically at the occurrence to a timer expiration. By + default, the system clock is used to do that sampling. -config SEM_NNESTPRIO - int "Maximum number of higher priority threads" - default 16 - depends on PRIORITY_INHERITANCE + There is a serious issue for the accuracy of measurements if the + system clock is used, however. NuttX threads are often started at + the time of the system timer expiration. Others may be stopped at + the time of the system timer expiration (if round-robin time-slicing + is enabled). Such thread behavior occurs synchronously with the + system timer and, hence, is not randomly sampled. As a consequence, + the CPU load attributed to these threads that run synchronously with + they system timer may be grossly in error. + + The solution is to use some other clock that runs at a different + rate and has timer expirations that are asynchronous with the + system timer. Then truly accurate load measurements can be + achieved. This option enables use of such an "external" clock. The + implementation of the clock must be provided by platform-specific + logic; that platform-specific logic must call the system function + sched_process_cpuload() at each timer expiration with interrupts + disabled. + +config SCHED_CPULOAD_TICKSPERSEC + int "External clock rate" + default 100 + depends on SCHED_CPULOAD_EXTCLK ---help--- - If priority inheritance is enabled, then this setting is the - maximum number of higher priority threads (minus 1) than can be - waiting for another thread to release a count on a semaphore. - This value may be set to zero if no more than one thread is - expected to wait for a semaphore. + If an external clock is used to drive the sampling for the CPU load + calculations, then this value must be provided. This value provides + the rate of the external clock in units of ticks per second. The + default value of 100 corresponds to 100Hz clock. NOTE: that 100Hz + is the default frequency of the system time and, hence, the worst + possible choice in most cases. + +config SCHED_CPULOAD_TIMECONSTANT + int "CPU load time constant" + default 2 + ---help--- + The accumulated CPU count is divided by two when the accumulated + tick count exceeds this time constant. This time constant is in + units of seconds. + +endif # SCHED_CPULOAD + +config SCHED_INSTRUMENTATION + bool "System performance monitor hooks" + default n + ---help--- + Enables instrumentation in scheduler to monitor system performance. + If enabled, then the board-specific logic must provide the following + functions (see include/sched.h): + + void sched_note_start(FAR struct tcb_s *tcb); + void sched_note_stop(FAR struct tcb_s *tcb); + void sched_note_switch(FAR struct tcb_s *pFromTcb, FAR struct tcb_s *pToTcb); + +endmenu # Performance Monitoring + +menu "Files and I/O" + +config DEV_CONSOLE + bool "Enable /dev/console" + default y + ---help--- + Set if architecture-specific logic provides /dev/console. Enables + stdout, stderr, stdin. config FDCLONE_DISABLE bool "Disable cloning of file descriptors" @@ -336,16 +410,86 @@ config SDCLONE_DISABLE desciptors by task_create() when a new task is started. If set, all sockets will appear to be closed in the new task. -config SCHED_WAITPID - bool "Enable waitpid() API" +config NFILE_DESCRIPTORS + int "Maximum number of file descriptors per task" + default 16 + ---help--- + The maximum number of file descriptors per task (one for each open) + +config NFILE_STREAMS + int "Maximum number of FILE streams" + default 16 + ---help--- + The maximum number of streams that can be fopen'ed + +config NAME_MAX + int "Maximum size of a file name" + default 32 + ---help--- + The maximum size of a file name. + +endmenu # Files and I/O + +menuconfig PRIORITY_INHERITANCE + bool "Enable priority inheritance " default n ---help--- - Enables the waitpid() interface in a default, non-standard mode - (non-standard in the sense that the waited for PID need not be child - of the caller). If SCHED_HAVE_PARENT is also defined, then this - setting will modify the behavior or waitpid() (making more spec - compliant) and will enable the waitid() and wait() interfaces as - well. + Set to enable support for priority inheritance on mutexes and semaphores. + +if PRIORITY_INHERITANCE + +config SEM_PREALLOCHOLDERS + int "Number of pre-allocated holders" + default 16 + ---help--- + This setting is only used if priority inheritance is enabled. + It defines the maximum number of different threads (minus one) that + can take counts on a semaphore with priority inheritance support. + This may be set to zero if priority inheritance is disabled OR if you + are only using semaphores as mutexes (only one holder) OR if no more + than two threads participate using a counting semaphore. + +config SEM_NNESTPRIO + int "Maximum number of higher priority threads" + default 16 + ---help--- + If priority inheritance is enabled, then this setting is the + maximum number of higher priority threads (minus 1) than can be + waiting for another thread to release a count on a semaphore. + This value may be set to zero if no more than one thread is + expected to wait for a semaphore. + +endif # PRIORITY_INHERITANCE + +menu "RTOS hooks" + +config BOARD_INITIALIZE + bool "Custom board/driver initialization" + default n + ---help--- + By default, there are three points in time where you can insert + custom initialization logic: + + 1) <arch>_boardinitialize(): This function is used only for + initialization of very low-level things like configuration of + GPIO pins, power setting. The OS has not been initialized + at this point, so you cannot allocate memory or initialize + device drivers at this phase. + + 2) The next level of initialization is performed by a call to + up_initialize() (in arch/<arch>/src/common/up_initialize.c). + The OS has been initialized at this point and it is okay to + initialize drivers in this phase. + + 3) And, finally, when the user application code starts. + + If BOARD_INITIALIZE is selected, then an additional initialization + call will be performed in the boot-up sequence to a function + called board_initialize(). board_initialize() will be + call between phases 2) and 3) above, immediately after + up_initialize() is called. This additional initialization + phase may be used, for example, to initialize board-specific + device drivers. config SCHED_STARTHOOK bool "Enable startup hook" @@ -396,66 +540,10 @@ config SCHED_ONEXIT_MAX on top of the on_exit() implementation. In that case, SCHED_ONEXIT_MAX determines the size of the combined number of atexit(0) and on_exit calls. -config USER_ENTRYPOINT - string "Application entry point" - default "user_start" - ---help--- - The name of the entry point for user applications. For the example - applications this is of the form 'app_main' where 'app' is the application - name. If not defined, USER_ENTRYPOINT defaults to "user_start." +endmenu # RTOS hooks -config DISABLE_OS_API - bool "Disable NuttX interfaces" - default y - ---help--- - The following can be used to disable categories of - APIs supported by the OS. If the compiler supports - weak functions, then it should not be necessary to - disable functions unless you want to restrict usage - of those APIs. - - There are certain dependency relationships in these - features. - - 1) mq_notify logic depends on signals to awaken tasks - waiting for queues to become full or empty. - 2) pthread_condtimedwait() depends on signals to wake - up waiting tasks. - -config DISABLE_CLOCK - bool "Disable clock interfaces" - depends on DISABLE_OS_API - default n - -config DISABLE_POSIX_TIMERS - bool "Disable POSIX timers" - depends on DISABLE_OS_API - default y if DEFAULT_SMALL - default n if !DEFAULT_SMALL - -config DISABLE_PTHREAD - bool "Disable pthread support" - depends on DISABLE_OS_API - default n - -config DISABLE_SIGNALS - bool "Disable signal support" - depends on DISABLE_OS_API - default n - -config DISABLE_MQUEUE - bool "Disable POSIX message queue support" - depends on DISABLE_OS_API - default n - -config DISABLE_ENVIRON - bool "Disable environment variable support" - depends on DISABLE_OS_API - default y if DEFAULT_SMALL - default n if !DEFAULT_SMALL - -if !DISABLE_SIGNALS -comment "Signal Numbers" +menu "Signal Numbers" + depends on !DISABLE_SIGNALS config SIG_SIGUSR1 int "SIGUSR1" @@ -502,48 +590,10 @@ config SIG_SIGWORK worker thread. This setting specifies the signal number that will be used for SIGWORK. Default: 17 -endif - -comment "Sizes of configurable things (0 disables)" - -config MAX_TASKS - int "Max number of tasks" - default 32 - ---help--- - The maximum number of simultaneously active tasks. This value must be - a power of two. - -config MAX_TASK_ARGS - int "Maximum number of task arguments" - default 4 - ---help--- - This controls the maximum number of of parameters that a task may - receive (i.e., maxmum value of 'argc') - -config NPTHREAD_KEYS - int "Maximum number of pthread keys" - default 4 - ---help--- - The number of items of thread- - specific data that can be retained - -config NFILE_DESCRIPTORS - int "Maximum number of file descriptors per task" - default 16 - ---help--- - The maximum number of file descriptors per task (one for each open) - -config NFILE_STREAMS - int "Maximum number of FILE streams" - default 16 - ---help--- - The maximum number of streams that can be fopen'ed +endmenu # Signal Numbers -config NAME_MAX - int "Maximum size of a file name" - default 32 - ---help--- - The maximum size of a file name. +menu "POSIX Message Queue Options" + depends on !DISABLE_MQUEUE config PREALLOC_MQ_MSGS int "Number of pre-allocated messages" @@ -559,28 +609,9 @@ config MQ_MAXMSGSIZE Message structures are allocated with a fixed payload size given by this setting (does not include other message structure overhead. -config MAX_WDOGPARMS - int "Maximum number of watchdog parameters" - default 4 - ---help--- - Maximum number of parameters that can be passed to a watchdog handler +endmenu # POSIX Message Queue Options -config PREALLOC_WDOGS - int "Number of pre-allocated watchdog timers" - default 32 - ---help--- - The number of pre-allocated watchdog structures. The system manages a - pool of preallocated watchdog structures to minimize dynamic allocations - -config PREALLOC_TIMERS - int "Number of pre-allocated POSIX timers" - default 8 - ---help--- - The number of pre-allocated POSIX timer structures. The system manages a - pool of preallocated timer structures to minimize dynamic allocations. Set to - zero for all dynamic allocations. - -comment "Stack and heap information" +menu "Stack and heap information" config IDLETHREAD_STACKSIZE int "Idle thread stack size" @@ -609,3 +640,5 @@ config PTHREAD_STACK_DEFAULT default 2048 ---help--- Default pthread stack size + +endmenu # Stack and heap information |