sched: explicitly select the cpuload clock source configuration

Different configurations require different dependencies.
Explicitly select dependencies to avoid automatically selecting inappropriate configurations.

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2023-10-26 21:03:16 +08:00 committed by Xiang Xiao
parent e0c883f487
commit d0a5489ac5
29 changed files with 52 additions and 64 deletions

View File

@ -32,7 +32,7 @@ CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y CONFIG_NSH_READLINE=y
CONFIG_RAM_SIZE=536870912 CONFIG_RAM_SIZE=536870912
CONFIG_RAM_START=0x20200000 CONFIG_RAM_START=0x20200000
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_START_DAY=14 CONFIG_START_DAY=14
CONFIG_START_MONTH=3 CONFIG_START_MONTH=3
CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_NSH=y

View File

@ -32,7 +32,7 @@ CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y CONFIG_NSH_READLINE=y
CONFIG_RAM_SIZE=1048576 CONFIG_RAM_SIZE=1048576
CONFIG_RAM_START=0x20200000 CONFIG_RAM_START=0x20200000
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_START_DAY=14 CONFIG_START_DAY=14
CONFIG_START_MONTH=3 CONFIG_START_MONTH=3
CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_NSH=y

View File

@ -32,7 +32,7 @@ CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y CONFIG_NSH_READLINE=y
CONFIG_RAM_SIZE=1048576 CONFIG_RAM_SIZE=1048576
CONFIG_RAM_START=0x20200000 CONFIG_RAM_START=0x20200000
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_START_DAY=14 CONFIG_START_DAY=14
CONFIG_START_MONTH=3 CONFIG_START_MONTH=3
CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_NSH=y

View File

@ -143,7 +143,6 @@ CONFIG_RAM_SIZE=1048576
CONFIG_RAM_START=0x20200000 CONFIG_RAM_START=0x20200000
CONFIG_READLINE_CMD_HISTORY=y CONFIG_READLINE_CMD_HISTORY=y
CONFIG_RR_INTERVAL=10 CONFIG_RR_INTERVAL=10
CONFIG_SCHED_CPULOAD=y
CONFIG_SCHED_LPWORK=y CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_TICKLESS=y CONFIG_SCHED_TICKLESS=y
CONFIG_SCHED_TICKLESS_ALARM=y CONFIG_SCHED_TICKLESS_ALARM=y

View File

@ -138,7 +138,7 @@ CONFIG_PTHREAD_STACK_MIN=1024
CONFIG_RAM_SIZE=65536 CONFIG_RAM_SIZE=65536
CONFIG_RAM_START=0x10000000 CONFIG_RAM_START=0x10000000
CONFIG_RR_INTERVAL=200 CONFIG_RR_INTERVAL=200
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_SCHED_HPWORK=y CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192 CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_IRQMONITOR=y CONFIG_SCHED_IRQMONITOR=y

View File

@ -18,7 +18,7 @@ config SAM4S_XPLAINED_PRO_SCHED_TIMER_DEVPATH
config SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH config SAM4S_XPLAINED_PRO_CPULOAD_TIMER_DEVPATH
string "CPU Load Timer Device Path" string "CPU Load Timer Device Path"
default "/dev/tc0" default "/dev/tc0"
depends on TIMER && SCHED_CPULOAD && SCHED_CPULOAD_EXTCLK depends on TIMER && SCHED_CPULOAD_EXTCLK
config SAM34_NAND_BLOCKMOUNT config SAM34_NAND_BLOCKMOUNT
bool "NAND FLASH auto-mount" bool "NAND FLASH auto-mount"

View File

@ -50,7 +50,7 @@ CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y CONFIG_RAW_BINARY=y
CONFIG_READLINE_TABCOMPLETION=y CONFIG_READLINE_TABCOMPLETION=y
CONFIG_RR_INTERVAL=100 CONFIG_RR_INTERVAL=100
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_SCHED_HPWORK=y CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192 CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_HPWORKSTACKSIZE=1024 CONFIG_SCHED_HPWORKSTACKSIZE=1024

View File

@ -63,7 +63,7 @@ CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y CONFIG_RAW_BINARY=y
CONFIG_READLINE_TABCOMPLETION=y CONFIG_READLINE_TABCOMPLETION=y
CONFIG_RR_INTERVAL=100 CONFIG_RR_INTERVAL=100
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_SCHED_HPWORK=y CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192 CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_HPWORKSTACKSIZE=1024 CONFIG_SCHED_HPWORKSTACKSIZE=1024

View File

@ -49,7 +49,7 @@ CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y CONFIG_RAW_BINARY=y
CONFIG_READLINE_TABCOMPLETION=y CONFIG_READLINE_TABCOMPLETION=y
CONFIG_RR_INTERVAL=100 CONFIG_RR_INTERVAL=100
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_SCHED_HPWORK=y CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192 CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_HPWORKSTACKSIZE=1024 CONFIG_SCHED_HPWORKSTACKSIZE=1024

View File

@ -50,7 +50,7 @@ CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y CONFIG_RAW_BINARY=y
CONFIG_READLINE_TABCOMPLETION=y CONFIG_READLINE_TABCOMPLETION=y
CONFIG_RR_INTERVAL=100 CONFIG_RR_INTERVAL=100
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_SCHED_HPWORK=y CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192 CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_HPWORKSTACKSIZE=1024 CONFIG_SCHED_HPWORKSTACKSIZE=1024

View File

@ -88,7 +88,7 @@ CONFIG_RAW_BINARY=y
CONFIG_READLINE_CMD_HISTORY=y CONFIG_READLINE_CMD_HISTORY=y
CONFIG_READLINE_TABCOMPLETION=y CONFIG_READLINE_TABCOMPLETION=y
CONFIG_RR_INTERVAL=200 CONFIG_RR_INTERVAL=200
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_SCHED_HPWORK=y CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKSTACKSIZE=2048 CONFIG_SCHED_HPWORKSTACKSIZE=2048
CONFIG_SCHED_IRQMONITOR=y CONFIG_SCHED_IRQMONITOR=y

View File

@ -65,7 +65,7 @@ CONFIG_RAM_SIZE=134217728
CONFIG_RAM_START=0xc0800000 CONFIG_RAM_START=0xc0800000
CONFIG_RAW_BINARY=y CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200 CONFIG_RR_INTERVAL=200
CONFIG_SCHED_CPULOAD=y CONFIG_SCHED_CPULOAD_SYSCLK=y
CONFIG_SCHED_WAITPID=y CONFIG_SCHED_WAITPID=y
CONFIG_STACK_COLORATION=y CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=20 CONFIG_START_DAY=20

View File

@ -213,7 +213,7 @@ static void addentropy(FAR const uint32_t *buf, size_t n, bool inc_new)
static void initentropy(FAR blake2s_state *S) static void initentropy(FAR blake2s_state *S)
{ {
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
struct cpuload_s load; struct cpuload_s load;
#endif #endif
uint32_t tmp; uint32_t tmp;
@ -231,7 +231,7 @@ static void initentropy(FAR blake2s_state *S)
tmp = sizeof(entropy_pool.pool); tmp = sizeof(entropy_pool.pool);
tmp <<= 27; tmp <<= 27;
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
clock_cpuload(0, &load); clock_cpuload(0, &load);
tmp += load.total ^ ROTL_32(load.active, 23); tmp += load.total ^ ROTL_32(load.active, 23);
#endif #endif

View File

@ -45,7 +45,7 @@ config FS_PROCFS_EXCLUDE_CPUINFO
config FS_PROCFS_EXCLUDE_CPULOAD config FS_PROCFS_EXCLUDE_CPULOAD
bool "Exclude CPU load" bool "Exclude CPU load"
depends on SCHED_CPULOAD depends on !SCHED_CPULOAD_NONE
default DEFAULT_SMALL default DEFAULT_SMALL
config FS_PROCFS_EXCLUDE_ENVIRON config FS_PROCFS_EXCLUDE_ENVIRON

View File

@ -106,7 +106,8 @@ static const struct procfs_entry_s g_procfs_entries[] =
{ "cpuinfo", &g_cpuinfo_operations, PROCFS_FILE_TYPE }, { "cpuinfo", &g_cpuinfo_operations, PROCFS_FILE_TYPE },
#endif #endif
#if defined(CONFIG_SCHED_CPULOAD) && !defined(CONFIG_FS_PROCFS_EXCLUDE_CPULOAD) #if !defined(CONFIG_SCHED_CPULOAD_NONE) && \
!defined(CONFIG_FS_PROCFS_EXCLUDE_CPULOAD)
{ "cpuload", &g_cpuload_operations, PROCFS_FILE_TYPE }, { "cpuload", &g_cpuload_operations, PROCFS_FILE_TYPE },
#endif #endif

View File

@ -45,7 +45,8 @@
#include <nuttx/fs/procfs.h> #include <nuttx/fs/procfs.h>
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS) #if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS)
#if defined(CONFIG_SCHED_CPULOAD) && !defined(CONFIG_FS_PROCFS_EXCLUDE_CPULOAD) #if !defined(CONFIG_SCHED_CPULOAD_NONE) && \
!defined(CONFIG_FS_PROCFS_EXCLUDE_CPULOAD)
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions

View File

@ -54,7 +54,7 @@
#include <nuttx/fs/ioctl.h> #include <nuttx/fs/ioctl.h>
#include <nuttx/mm/mm.h> #include <nuttx/mm/mm.h>
#if defined(CONFIG_SCHED_CPULOAD) || defined(CONFIG_SCHED_CRITMONITOR) #if !defined(CONFIG_SCHED_CPULOAD_NONE) || defined(CONFIG_SCHED_CRITMONITOR)
# include <nuttx/clock.h> # include <nuttx/clock.h>
#endif #endif
@ -84,7 +84,7 @@ enum proc_node_e
PROC_LEVEL0 = 0, /* The top-level directory */ PROC_LEVEL0 = 0, /* The top-level directory */
PROC_STATUS, /* Task/thread status */ PROC_STATUS, /* Task/thread status */
PROC_CMDLINE, /* Task command line */ PROC_CMDLINE, /* Task command line */
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
PROC_LOADAVG, /* Average CPU utilization */ PROC_LOADAVG, /* Average CPU utilization */
#endif #endif
#ifdef CONFIG_SCHED_CRITMONITOR #ifdef CONFIG_SCHED_CRITMONITOR
@ -171,7 +171,7 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
static ssize_t proc_cmdline(FAR struct proc_file_s *procfile, static ssize_t proc_cmdline(FAR struct proc_file_s *procfile,
FAR struct tcb_s *tcb, FAR char *buffer, size_t buflen, FAR struct tcb_s *tcb, FAR char *buffer, size_t buflen,
off_t offset); off_t offset);
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
static ssize_t proc_loadavg(FAR struct proc_file_s *procfile, static ssize_t proc_loadavg(FAR struct proc_file_s *procfile,
FAR struct tcb_s *tcb, FAR char *buffer, size_t buflen, FAR struct tcb_s *tcb, FAR char *buffer, size_t buflen,
off_t offset); off_t offset);
@ -278,7 +278,7 @@ static const struct proc_node_s g_cmdline =
"cmdline", "cmdline", (uint8_t)PROC_CMDLINE, DTYPE_FILE /* Task command line */ "cmdline", "cmdline", (uint8_t)PROC_CMDLINE, DTYPE_FILE /* Task command line */
}; };
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
static const struct proc_node_s g_loadavg = static const struct proc_node_s g_loadavg =
{ {
"loadavg", "loadavg", (uint8_t)PROC_LOADAVG, DTYPE_FILE /* Average CPU utilization */ "loadavg", "loadavg", (uint8_t)PROC_LOADAVG, DTYPE_FILE /* Average CPU utilization */
@ -340,7 +340,7 @@ static FAR const struct proc_node_s * const g_nodeinfo[] =
{ {
&g_status, /* Task/thread status */ &g_status, /* Task/thread status */
&g_cmdline, /* Task command line */ &g_cmdline, /* Task command line */
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
&g_loadavg, /* Average CPU utilization */ &g_loadavg, /* Average CPU utilization */
#endif #endif
#ifdef CONFIG_SCHED_CRITMONITOR #ifdef CONFIG_SCHED_CRITMONITOR
@ -369,7 +369,7 @@ static const struct proc_node_s * const g_level0info[] =
{ {
&g_status, /* Task/thread status */ &g_status, /* Task/thread status */
&g_cmdline, /* Task command line */ &g_cmdline, /* Task command line */
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
&g_loadavg, /* Average CPU utilization */ &g_loadavg, /* Average CPU utilization */
#endif #endif
#ifdef CONFIG_SCHED_CRITMONITOR #ifdef CONFIG_SCHED_CRITMONITOR
@ -706,7 +706,7 @@ static ssize_t proc_cmdline(FAR struct proc_file_s *procfile,
* Name: proc_loadavg * Name: proc_loadavg
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
static ssize_t proc_loadavg(FAR struct proc_file_s *procfile, static ssize_t proc_loadavg(FAR struct proc_file_s *procfile,
FAR struct tcb_s *tcb, FAR char *buffer, FAR struct tcb_s *tcb, FAR char *buffer,
size_t buflen, off_t offset) size_t buflen, off_t offset)
@ -1521,7 +1521,7 @@ static ssize_t proc_read(FAR struct file *filep, FAR char *buffer,
ret = proc_cmdline(procfile, tcb, buffer, buflen, filep->f_pos); ret = proc_cmdline(procfile, tcb, buffer, buflen, filep->f_pos);
break; break;
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
case PROC_LOADAVG: /* Average CPU utilization */ case PROC_LOADAVG: /* Average CPU utilization */
ret = proc_loadavg(procfile, tcb, buffer, buflen, filep->f_pos); ret = proc_loadavg(procfile, tcb, buffer, buflen, filep->f_pos);
break; break;

View File

@ -274,7 +274,7 @@
/* This structure is used to report CPU usage for a particular thread */ /* This structure is used to report CPU usage for a particular thread */
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
struct cpuload_s struct cpuload_s
{ {
volatile uint32_t total; /* Total number of clock ticks */ volatile uint32_t total; /* Total number of clock ticks */
@ -615,7 +615,7 @@ int clock_systime_timespec(FAR struct timespec *ts);
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
int clock_cpuload(int pid, FAR struct cpuload_s *cpuload); int clock_cpuload(int pid, FAR struct cpuload_s *cpuload);
#endif #endif

View File

@ -625,7 +625,7 @@ struct tcb_s
/* CPU load monitoring support ********************************************/ /* CPU load monitoring support ********************************************/
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
uint32_t ticks; /* Number of ticks on this thread */ uint32_t ticks; /* Number of ticks on this thread */
#endif #endif

View File

@ -914,9 +914,9 @@ config SCHED_CRITMONITOR_MAXTIME_PANIC
If this option is enabled, a panic will be triggered when If this option is enabled, a panic will be triggered when
IRQ/WQUEUE/PREEMPTION execution time exceeds SCHED_CRITMONITOR_MAXTIME_xxx IRQ/WQUEUE/PREEMPTION execution time exceeds SCHED_CRITMONITOR_MAXTIME_xxx
config SCHED_CPULOAD choice
bool "Enable CPU load monitoring" prompt "Select CPU load clock source"
default n default SCHED_CPULOAD_NONE
---help--- ---help---
If this option is selected, the timer interrupt handler will monitor 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 if the system is IDLE or busy at the time of that the timer interrupt
@ -932,12 +932,11 @@ config SCHED_CPULOAD
possible unless you provide an alternative clock to drive the possible unless you provide an alternative clock to drive the
sampling and select SCHED_CPULOAD_EXTCLK. sampling and select SCHED_CPULOAD_EXTCLK.
if SCHED_CPULOAD config SCHED_CPULOAD_NONE
bool "None CPU load clock source"
choice ---help---
prompt "Select CPU load clock source" If this option is enabled, the system will not support CPU load
default SCHED_CPULOAD_EXTCLK if SCHED_TICKLESS measurement.
default SCHED_CPULOAD_CRITMONITOR if SCHED_CRITMONITOR
config SCHED_CPULOAD_SYSCLK config SCHED_CPULOAD_SYSCLK
bool "Use system clock" bool "Use system clock"
@ -955,8 +954,9 @@ config SCHED_CPULOAD_SYSCLK
the CPU load attributed to these threads that run synchronously with the CPU load attributed to these threads that run synchronously with
they system timer may be grossly in error. they system timer may be grossly in error.
The CPU load measurements are determined by sampling the active The CPU load measurements are determined by sampling the active
tasks periodically at the occurrence to a timer expiration. By tasks periodically at the occurrence to a timer expiration.
default, the system clock is used to do that sampling. If tickless is enabled, SYSCLK should not be used. Its error will be
very large, and using it for analysis will lead to wrong conclusions.
config SCHED_CPULOAD_EXTCLK config SCHED_CPULOAD_EXTCLK
bool "Use external clock" bool "Use external clock"
@ -1068,14 +1068,13 @@ endif # SCHED_CPULOAD_EXTCLK
config SCHED_CPULOAD_TIMECONSTANT config SCHED_CPULOAD_TIMECONSTANT
int "CPU load time constant" int "CPU load time constant"
depends on !SCHED_CPULOAD_NONE
default 2 default 2
---help--- ---help---
The accumulated CPU count is divided by two when the accumulated The accumulated CPU count is divided by two when the accumulated
tick count exceeds this time constant. This time constant is in tick count exceeds this time constant. This time constant is in
units of seconds. units of seconds.
endif # SCHED_CPULOAD
menuconfig SCHED_INSTRUMENTATION menuconfig SCHED_INSTRUMENTATION
bool "System performance monitor hooks" bool "System performance monitor hooks"
default n default n

View File

@ -297,7 +297,7 @@ static void dump_task(FAR struct tcb_s *tcb, FAR void *arg)
size_t stack_filled = 0; size_t stack_filled = 0;
size_t stack_used; size_t stack_used;
#endif #endif
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
struct cpuload_s cpuload; struct cpuload_s cpuload;
size_t fracpart = 0; size_t fracpart = 0;
size_t intpart = 0; size_t intpart = 0;
@ -349,7 +349,7 @@ static void dump_task(FAR struct tcb_s *tcb, FAR void *arg)
#ifdef CONFIG_STACK_COLORATION #ifdef CONFIG_STACK_COLORATION
" %7zu %3zu.%1zu%%%c" " %7zu %3zu.%1zu%%%c"
#endif #endif
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
" %3zu.%01zu%%" " %3zu.%01zu%%"
#endif #endif
" %s%s\n" " %s%s\n"
@ -375,7 +375,7 @@ static void dump_task(FAR struct tcb_s *tcb, FAR void *arg)
, stack_filled / 10, stack_filled % 10 , stack_filled / 10, stack_filled % 10
, (stack_filled >= 10 * 80 ? '!' : ' ') , (stack_filled >= 10 * 80 ? '!' : ' ')
#endif #endif
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
, intpart, fracpart , intpart, fracpart
#endif #endif
#if CONFIG_TASK_NAME_SIZE > 0 #if CONFIG_TASK_NAME_SIZE > 0
@ -431,7 +431,7 @@ static void dump_tasks(void)
#ifdef CONFIG_STACK_COLORATION #ifdef CONFIG_STACK_COLORATION
" USED FILLED " " USED FILLED "
#endif #endif
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
" CPU" " CPU"
#endif #endif
" COMMAND\n"); " COMMAND\n");
@ -450,7 +450,7 @@ static void dump_tasks(void)
# ifdef CONFIG_STACK_COLORATION # ifdef CONFIG_STACK_COLORATION
" %7zu %3zu.%1zu%%%c" " %7zu %3zu.%1zu%%%c"
# endif # endif
# ifdef CONFIG_SCHED_CPULOAD # ifndef CONFIG_SCHED_CPULOAD_NONE
" ----" " ----"
# endif # endif
" irq\n" " irq\n"

View File

@ -91,7 +91,7 @@ elseif(CONFIG_SCHED_RESUMESCHEDULER)
list(APPEND SRCS sched_resumescheduler.c) list(APPEND SRCS sched_resumescheduler.c)
endif() endif()
if(CONFIG_SCHED_CPULOAD) if(NOT CONFIG_SCHED_CPULOAD_NONE)
list(APPEND SRCS sched_cpuload.c) list(APPEND SRCS sched_cpuload.c)
if(CONFIG_CPULOAD_ONESHOT) if(CONFIG_CPULOAD_ONESHOT)
list(APPEND SRCS sched_cpuload_oneshot.c) list(APPEND SRCS sched_cpuload_oneshot.c)

View File

@ -68,7 +68,7 @@ else ifeq ($(CONFIG_SCHED_RESUMESCHEDULER),y)
CSRCS += sched_resumescheduler.c CSRCS += sched_resumescheduler.c
endif endif
ifeq ($(CONFIG_SCHED_CPULOAD),y) ifneq ($(CONFIG_SCHED_CPULOAD_NONE),y)
CSRCS += sched_cpuload.c CSRCS += sched_cpuload.c
ifeq ($(CONFIG_CPULOAD_ONESHOT),y) ifeq ($(CONFIG_CPULOAD_ONESHOT),y)
CSRCS += sched_cpuload_oneshot.c CSRCS += sched_cpuload_oneshot.c

View File

@ -235,7 +235,7 @@ extern volatile int g_npidhash;
extern const struct tasklist_s g_tasklisttable[NUM_TASK_STATES]; extern const struct tasklist_s g_tasklisttable[NUM_TASK_STATES];
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
/* This is the total number of clock tick counts. Essentially the /* This is the total number of clock tick counts. Essentially the
* 'denominator' for all CPU load calculations. * 'denominator' for all CPU load calculations.
*/ */

View File

@ -32,8 +32,6 @@
#include "sched/sched.h" #include "sched/sched.h"
#ifdef CONFIG_SCHED_CPULOAD
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
@ -227,5 +225,3 @@ int clock_cpuload(int pid, FAR struct cpuload_s *cpuload)
leave_critical_section(flags); leave_critical_section(flags);
return ret; return ret;
} }
#endif /* CONFIG_SCHED_CPULOAD */

View File

@ -44,10 +44,6 @@
/* Configuration ************************************************************/ /* Configuration ************************************************************/
#if !defined(CONFIG_SCHED_CPULOAD) || !defined(CONFIG_SCHED_CPULOAD_EXTCLK)
# error CONFIG_SCHED_CPULOAD and CONFIG_SCHED_CPULOAD_EXTCLK must be defined
#endif
/* CONFIG_SCHED_CPULOAD_TICKSPERSEC is the frequency of the external clock /* CONFIG_SCHED_CPULOAD_TICKSPERSEC is the frequency of the external clock
* source. * source.
*/ */

View File

@ -41,10 +41,6 @@
/* Configuration ************************************************************/ /* Configuration ************************************************************/
#if !defined(CONFIG_SCHED_CPULOAD) || !defined(CONFIG_SCHED_CPULOAD_EXTCLK)
# error CONFIG_SCHED_CPULOAD and CONFIG_SCHED_CPULOAD_EXTCLK must be defined
#endif
/* CONFIG_SCHED_CPULOAD_TICKSPERSEC is the frequency of the external clock /* CONFIG_SCHED_CPULOAD_TICKSPERSEC is the frequency of the external clock
* source. * source.
*/ */

View File

@ -51,7 +51,7 @@ static void nxsched_releasepid(pid_t pid)
irqstate_t flags = enter_critical_section(); irqstate_t flags = enter_critical_section();
int hash_ndx = PIDHASH(pid); int hash_ndx = PIDHASH(pid);
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
/* Decrement the total CPU load count held by this thread from the /* Decrement the total CPU load count held by this thread from the
* total for all threads. * total for all threads.
*/ */

View File

@ -46,7 +46,7 @@
int sysinfo(FAR struct sysinfo *info) int sysinfo(FAR struct sysinfo *info)
{ {
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
struct cpuload_s cpuload; struct cpuload_s cpuload;
#endif #endif
#ifdef CONFIG_MM_PGALLOC #ifdef CONFIG_MM_PGALLOC
@ -62,7 +62,7 @@ int sysinfo(FAR struct sysinfo *info)
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
#ifdef CONFIG_SCHED_CPULOAD #ifndef CONFIG_SCHED_CPULOAD_NONE
clock_cpuload(0, &cpuload); clock_cpuload(0, &cpuload);
/* On the simulator, you may hit cpuload.total == 0, but probably never /* On the simulator, you may hit cpuload.total == 0, but probably never