mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
sched/Kconfig: Simplify some configurations. This adds configuration settings that control individual features, rather than long complex OR expressions that determines if an individual feature is required.
This commit is contained in:
@@ -637,8 +637,7 @@ struct tcb_s
|
|||||||
#endif
|
#endif
|
||||||
uint16_t flags; /* Misc. general status flags */
|
uint16_t flags; /* Misc. general status flags */
|
||||||
int16_t lockcount; /* 0=preemptable (not-locked) */
|
int16_t lockcount; /* 0=preemptable (not-locked) */
|
||||||
#if defined(CONFIG_SMP) || defined(CONFIG_SCHED_CRITMONITOR) || \
|
#ifdef CONFIG_IRQCOUNT
|
||||||
defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION)
|
|
||||||
int16_t irqcount; /* 0=Not in critical section */
|
int16_t irqcount; /* 0=Not in critical section */
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_CANCELLATION_POINTS
|
#ifdef CONFIG_CANCELLATION_POINTS
|
||||||
@@ -952,9 +951,7 @@ int group_exitinfo(pid_t pid, FAR struct binary_s *bininfo);
|
|||||||
*
|
*
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC) || \
|
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_RESUMESCHEDULER)
|
||||||
defined(CONFIG_SCHED_INSTRUMENTATION) || defined(CONFIG_SCHED_CRITMONITOR) || \
|
|
||||||
defined(CONFIG_SMP)
|
|
||||||
void sched_resume_scheduler(FAR struct tcb_s *tcb);
|
void sched_resume_scheduler(FAR struct tcb_s *tcb);
|
||||||
#else
|
#else
|
||||||
# define sched_resume_scheduler(tcb)
|
# define sched_resume_scheduler(tcb)
|
||||||
@@ -976,8 +973,7 @@ void sched_resume_scheduler(FAR struct tcb_s *tcb);
|
|||||||
*
|
*
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SCHED_SPORADIC) || defined(CONFIG_SCHED_INSTRUMENTATION) || \
|
#ifdef CONFIG_SCHED_SUSPENDSCHEDULER
|
||||||
defined(CONFIG_SCHED_CRITMONITOR)
|
|
||||||
void sched_suspend_scheduler(FAR struct tcb_s *tcb);
|
void sched_suspend_scheduler(FAR struct tcb_s *tcb);
|
||||||
#else
|
#else
|
||||||
# define sched_suspend_scheduler(tcb)
|
# define sched_suspend_scheduler(tcb)
|
||||||
|
|||||||
@@ -276,11 +276,17 @@ config PREALLOC_IRQCHAIN
|
|||||||
|
|
||||||
endif # IRQCHAIN
|
endif # IRQCHAIN
|
||||||
|
|
||||||
|
config IRQCOUNT
|
||||||
|
bool
|
||||||
|
default n
|
||||||
|
|
||||||
config SMP
|
config SMP
|
||||||
bool "Symmetric Multi-Processing (SMP)"
|
bool "Symmetric Multi-Processing (SMP)"
|
||||||
default n
|
default n
|
||||||
depends on ARCH_HAVE_MULTICPU
|
depends on ARCH_HAVE_MULTICPU
|
||||||
select SPINLOCK
|
select SPINLOCK
|
||||||
|
select SCHED_RESUMESCHEDULER
|
||||||
|
select IRQCOUNT
|
||||||
---help---
|
---help---
|
||||||
Enables support for Symmetric Multi-Processing (SMP) on a multi-CPU
|
Enables support for Symmetric Multi-Processing (SMP) on a multi-CPU
|
||||||
platform.
|
platform.
|
||||||
@@ -429,6 +435,8 @@ config RR_INTERVAL
|
|||||||
config SCHED_SPORADIC
|
config SCHED_SPORADIC
|
||||||
bool "Support sporadic scheduling"
|
bool "Support sporadic scheduling"
|
||||||
default n
|
default n
|
||||||
|
select SCHED_SUSPENDSCHEDULER
|
||||||
|
select SCHED_RESUMESCHEDULER
|
||||||
---help---
|
---help---
|
||||||
Build in additional logic to support sporadic scheduling
|
Build in additional logic to support sporadic scheduling
|
||||||
(SCHED_SPORADIC).
|
(SCHED_SPORADIC).
|
||||||
@@ -691,6 +699,14 @@ endmenu # Pthread Options
|
|||||||
|
|
||||||
menu "Performance Monitoring"
|
menu "Performance Monitoring"
|
||||||
|
|
||||||
|
config SCHED_SUSPENDSCHEDULER
|
||||||
|
bool
|
||||||
|
default n
|
||||||
|
|
||||||
|
config SCHED_RESUMESCHEDULER
|
||||||
|
bool
|
||||||
|
default n
|
||||||
|
|
||||||
config SCHED_IRQMONITOR
|
config SCHED_IRQMONITOR
|
||||||
bool "Enable IRQ monitoring"
|
bool "Enable IRQ monitoring"
|
||||||
default n
|
default n
|
||||||
@@ -704,6 +720,9 @@ config SCHED_CRITMONITOR
|
|||||||
bool "Enable Critical Section monitoring"
|
bool "Enable Critical Section monitoring"
|
||||||
default n
|
default n
|
||||||
depends on FS_PROCFS
|
depends on FS_PROCFS
|
||||||
|
select SCHED_SUSPENDSCHEDULER
|
||||||
|
select SCHED_RESUMESCHEDULER
|
||||||
|
select IRQCOUNT
|
||||||
---help---
|
---help---
|
||||||
Enables logic that monitors the duration of time that a thread keeps
|
Enables logic that monitors the duration of time that a thread keeps
|
||||||
interrupts or pre-emption disabled. These global locks can have
|
interrupts or pre-emption disabled. These global locks can have
|
||||||
@@ -870,6 +889,9 @@ endif # SCHED_CPULOAD
|
|||||||
config SCHED_INSTRUMENTATION
|
config SCHED_INSTRUMENTATION
|
||||||
bool "System performance monitor hooks"
|
bool "System performance monitor hooks"
|
||||||
default n
|
default n
|
||||||
|
select SCHED_SUSPENDSCHEDULER
|
||||||
|
select SCHED_RESUMESCHEDULER
|
||||||
|
select IRQCOUNT
|
||||||
---help---
|
---help---
|
||||||
Enables instrumentation in scheduler to monitor system performance.
|
Enables instrumentation in scheduler to monitor system performance.
|
||||||
If enabled, then the board-specific logic must provide the following
|
If enabled, then the board-specific logic must provide the following
|
||||||
|
|||||||
+3
-3
@@ -42,9 +42,9 @@ ifeq ($(CONFIG_ARCH_GLOBAL_IRQDISABLE),y)
|
|||||||
CSRCS += irq_spinlock.c
|
CSRCS += irq_spinlock.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
else ifeq ($(CONFIG_SCHED_INSTRUMENTATION_CSECTION),y)
|
endif
|
||||||
CSRCS += irq_csection.c
|
|
||||||
else ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
|
ifeq ($(CONFIG_IRQCOUNT),y)
|
||||||
CSRCS += irq_csection.c
|
CSRCS += irq_csection.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,7 @@
|
|||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
#include "irq/irq.h"
|
#include "irq/irq.h"
|
||||||
|
|
||||||
#if defined(CONFIG_SMP) || defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) || \
|
#ifdef CONFIG_IRQCOUNT
|
||||||
defined(CONFIG_SCHED_CRITMONITOR)
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
@@ -392,8 +391,9 @@ try_again:
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else /* defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) || \
|
|
||||||
* defined(CONFIG_SCHED_CRITMONITOR) */
|
#else
|
||||||
|
|
||||||
irqstate_t enter_critical_section(void)
|
irqstate_t enter_critical_section(void)
|
||||||
{
|
{
|
||||||
irqstate_t ret;
|
irqstate_t ret;
|
||||||
@@ -585,8 +585,7 @@ void leave_critical_section(irqstate_t flags)
|
|||||||
up_irq_restore(flags);
|
up_irq_restore(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* defined(CONFIG_SCHED_INSTRUMENTATION_CSECTION) ||
|
#else
|
||||||
* defined(CONFIG_SCHED_CRITMONITOR) */
|
|
||||||
|
|
||||||
void leave_critical_section(irqstate_t flags)
|
void leave_critical_section(irqstate_t flags)
|
||||||
{
|
{
|
||||||
@@ -704,5 +703,4 @@ bool irq_cpu_locked(int cpu)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CONFIG_SMP || CONFIG_SCHED_INSTRUMENTATION_CSECTION ||
|
#endif /* CONFIG_IRQCOUNT */
|
||||||
* CONFIG_SCHED_CRITMONITOR */
|
|
||||||
|
|||||||
+5
-11
@@ -70,22 +70,16 @@ CSRCS += sched_roundrobin.c
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_SCHED_SPORADIC),y)
|
ifeq ($(CONFIG_SCHED_SPORADIC),y)
|
||||||
CSRCS += sched_sporadic.c sched_suspendscheduler.c
|
CSRCS += sched_sporadic.c
|
||||||
else ifeq ($(CONFIG_SCHED_INSTRUMENTATION),y)
|
endif
|
||||||
CSRCS += sched_suspendscheduler.c
|
|
||||||
else ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
|
ifeq ($(CONFIG_SCHED_SUSPENDSCHEDULER),y)
|
||||||
CSRCS += sched_suspendscheduler.c
|
CSRCS += sched_suspendscheduler.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_RR_INTERVAL),0)
|
ifneq ($(CONFIG_RR_INTERVAL),0)
|
||||||
CSRCS += sched_resumescheduler.c
|
CSRCS += sched_resumescheduler.c
|
||||||
else ifeq ($(CONFIG_SCHED_SPORADIC),y)
|
else ifeq ($(CONFIG_SCHED_RESUMESCHEDULER),y)
|
||||||
CSRCS += sched_resumescheduler.c
|
|
||||||
else ifeq ($(CONFIG_SCHED_INSTRUMENTATION),y)
|
|
||||||
CSRCS += sched_resumescheduler.c
|
|
||||||
else ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
|
|
||||||
CSRCS += sched_resumescheduler.c
|
|
||||||
else ifeq ($(CONFIG_SMP),y)
|
|
||||||
CSRCS += sched_resumescheduler.c
|
CSRCS += sched_resumescheduler.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -48,9 +48,7 @@
|
|||||||
#include "irq/irq.h"
|
#include "irq/irq.h"
|
||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
|
|
||||||
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC) || \
|
#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_RESUMESCHEDULER)
|
||||||
defined(CONFIG_SCHED_INSTRUMENTATION) || defined(CONFIG_SCHED_CRITMONITOR) || \
|
|
||||||
defined(CONFIG_SMP)
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@@ -145,6 +143,4 @@ void sched_resume_scheduler(FAR struct tcb_s *tcb)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_RR_INTERVAL > 0 || CONFIG_SCHED_SPORADIC || \
|
#endif /* CONFIG_RR_INTERVAL > 0 || CONFIG_SCHED_RESUMESCHEDULER */
|
||||||
* CONFIG_SCHED_INSTRUMENTATION || CONFIG_SCHED_CRITMONITOR ||
|
|
||||||
* CONFIG_SMP */
|
|
||||||
|
|||||||
@@ -50,8 +50,7 @@
|
|||||||
#include "clock/clock.h"
|
#include "clock/clock.h"
|
||||||
#include "sched/sched.h"
|
#include "sched/sched.h"
|
||||||
|
|
||||||
#if defined(CONFIG_SCHED_SPORADIC) || defined(CONFIG_SCHED_INSTRUMENTATION) || \
|
#ifdef CONFIG_SCHED_SUSPENDSCHEDULER
|
||||||
defined(CONFIG_SCHED_CRITMONITOR)
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
@@ -94,5 +93,4 @@ void sched_suspend_scheduler(FAR struct tcb_s *tcb)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_SCHED_SPORADIC || CONFIG_SCHED_INSTRUMENTATION ||
|
#endif /* CONFIG_SCHED_SUSPENDSCHEDULER */
|
||||||
* CONFIG_SCHED_CRITMONITOR */
|
|
||||||
|
|||||||
Reference in New Issue
Block a user