note dump: add CONFIG_SCHED_INSTRUMENTATION_SWITCH

1. If CONFIG_SCHED_INSTRUMENTATION_SWITCH is enabled, then these additional interfaces are expected:
        sched_note_suspend
        sched_note_resume
at the same time,If CONFIG_SMP is enabled,then expected:
        sched_note_cpu_pause
        sched_note_cpu_paused
        sched_note_cpu_resume
        sched_note_cpu_resumed
2. other board if enable SCHED_INSTRUMENTATION,SCHED_INSTRUMENTATION_SWITCH to defconfig.
This commit is contained in:
zhanghu6 2021-12-03 12:26:42 +08:00 committed by Xiang Xiao
parent 6c255f2d07
commit d05b9a9c79
15 changed files with 59 additions and 6 deletions

View File

@ -45,6 +45,7 @@ CONFIG_RTC_DRIVER=y
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_FILTER=y
CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_INSTRUMENTATION_SYSCALL=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SPI=y

View File

@ -53,6 +53,7 @@ CONFIG_SCHED_ATEXIT=y
CONFIG_SCHED_CHILD_STATUS=y
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_ONEXIT_MAX=32
CONFIG_SCHED_STARTHOOK=y

View File

@ -52,6 +52,7 @@ CONFIG_SCHED_ATEXIT=y
CONFIG_SCHED_CHILD_STATUS=y
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_ONEXIT_MAX=32
CONFIG_SCHED_STARTHOOK=y

View File

@ -95,6 +95,7 @@ CONFIG_SCHED_ATEXIT=y
CONFIG_SCHED_CHILD_STATUS=y
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_ONEXIT_MAX=32
CONFIG_SCHED_STARTHOOK=y

View File

@ -150,6 +150,7 @@ CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_PREEMPTION=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_LPWORKPRIORITY=60
CONFIG_SCHED_ONEXIT=y

View File

@ -52,6 +52,7 @@ CONFIG_SCHED_ATEXIT=y
CONFIG_SCHED_CHILD_STATUS=y
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_ONEXIT_MAX=32
CONFIG_SCHED_STARTHOOK=y

View File

@ -69,6 +69,7 @@ CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_HPWORKSTACKSIZE=1800
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_LPWORK=y
CONFIG_SCHED_LPWORKSTACKSIZE=1800
CONFIG_SCHED_WAITPID=y

View File

@ -40,6 +40,7 @@ CONFIG_PREALLOC_TIMERS=0
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_WAITPID=y
CONFIG_START_DAY=29
CONFIG_START_MONTH=11

View File

@ -45,6 +45,7 @@ CONFIG_SCHED_ATEXIT=y
CONFIG_SCHED_CHILD_STATUS=y
CONFIG_SCHED_HAVE_PARENT=y
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_ONEXIT_MAX=32
CONFIG_SCHED_STARTHOOK=y

View File

@ -316,7 +316,9 @@ SMP
+CONFIG_DEBUG_SCHED=y
-# CONFIG_SCHED_INSTRUMENTATION is not set
-# CONFIG_SCHED_INSTRUMENTATION_SWITCH is not set
+CONFIG_SCHED_INSTRUMENTATION=y
+CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
The SMP configuration will run with:

View File

@ -31,6 +31,7 @@ CONFIG_SCHED_INSTRUMENTATION_CSECTION=y
CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER=y
CONFIG_SCHED_INSTRUMENTATION_PREEMPTION=y
CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_WAITPID=y
CONFIG_SYSTEM_NSH=y

View File

@ -41,6 +41,7 @@ CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_INSTRUMENTATION=y
CONFIG_SCHED_INSTRUMENTATION_SWITCH=y
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SPI=y

View File

@ -108,18 +108,24 @@
enum note_type_e
{
NOTE_START = 0,
NOTE_STOP = 1,
NOTE_STOP = 1
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
,
NOTE_SUSPEND = 2,
NOTE_RESUME = 3
#endif
#ifdef CONFIG_SMP
,
NOTE_CPU_START = 4,
NOTE_CPU_STARTED = 5,
NOTE_CPU_STARTED = 5
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
,
NOTE_CPU_PAUSE = 6,
NOTE_CPU_PAUSED = 7,
NOTE_CPU_RESUME = 8,
NOTE_CPU_RESUMED = 9
#endif
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION
,
NOTE_PREEMPT_LOCK = 10,
@ -191,6 +197,7 @@ struct note_stop_s
struct note_common_s nsp_cmn; /* Common note parameters */
};
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
/* This is the specific form of the NOTE_SUSPEND note */
struct note_suspend_s
@ -205,6 +212,7 @@ struct note_resume_s
{
struct note_common_s nre_cmn; /* Common note parameters */
};
#endif
#ifdef CONFIG_SMP
@ -223,6 +231,7 @@ struct note_cpu_started_s
struct note_common_s ncs_cmn; /* Common note parameters */
};
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
/* This is the specific form of the NOTE_CPU_PAUSE note */
struct note_cpu_pause_s
@ -253,6 +262,7 @@ struct note_cpu_resumed_s
struct note_common_s ncr_cmn; /* Common note parameters */
};
#endif
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION
/* This is the specific form of the NOTE_PREEMPT_LOCK/UNLOCK note */
@ -406,24 +416,37 @@ struct note_filter_irq_s
void sched_note_start(FAR struct tcb_s *tcb);
void sched_note_stop(FAR struct tcb_s *tcb);
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
void sched_note_suspend(FAR struct tcb_s *tcb);
void sched_note_resume(FAR struct tcb_s *tcb);
#else
# define sched_note_suspend(t)
# define sched_note_resume(t)
#endif
#ifdef CONFIG_SMP
void sched_note_cpu_start(FAR struct tcb_s *tcb, int cpu);
void sched_note_cpu_started(FAR struct tcb_s *tcb);
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu);
void sched_note_cpu_paused(FAR struct tcb_s *tcb);
void sched_note_cpu_resume(FAR struct tcb_s *tcb, int cpu);
void sched_note_cpu_resumed(FAR struct tcb_s *tcb);
#else
# define sched_note_cpu_start(t,c)
# define sched_note_cpu_started(t)
# define sched_note_cpu_pause(t,c)
# define sched_note_cpu_paused(t)
# define sched_note_cpu_resume(t,c)
# define sched_note_cpu_resumed(t)
#endif
#else
# define sched_note_cpu_pause(t,c)
# define sched_note_cpu_paused(t)
# define sched_note_cpu_resume(t,c)
# define sched_note_cpu_resumed(t)
# define sched_note_cpu_start(t,c)
# define sched_note_cpu_started(t)
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION
void sched_note_premption(FAR struct tcb_s *tcb, bool locked);

View File

@ -946,6 +946,21 @@ config SCHED_INSTRUMENTATION
void sched_note_start(FAR struct tcb_s *tcb);
void sched_note_stop(FAR struct tcb_s *tcb);
If CONFIG_SMP is enabled, then these additional interfaces are
expected:
void sched_note_cpu_start(FAR struct tcb_s *tcb, int cpu);
void sched_note_cpu_started(FAR struct tcb_s *tcb);
if SCHED_INSTRUMENTATION
config SCHED_INSTRUMENTATION_SWITCH
bool "Use note switch for instrumentation"
default n
---help---
Use note switch for instrumentation.
void sched_note_suspend(FAR struct tcb_s *tcb);
void sched_note_resume(FAR struct tcb_s *tcb);
@ -962,8 +977,6 @@ config SCHED_INSTRUMENTATION
done in these interfaces. For example, normal devices may not be
used; syslog output cannot be performed.
if SCHED_INSTRUMENTATION
config SCHED_INSTRUMENTATION_EXTERNAL
bool "System performance monitor endpoints are external"
default n

View File

@ -451,6 +451,7 @@ void sched_note_stop(FAR struct tcb_s *tcb)
sched_note_add(&note, sizeof(struct note_stop_s));
}
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
void sched_note_suspend(FAR struct tcb_s *tcb)
{
struct note_suspend_s note;
@ -488,6 +489,7 @@ void sched_note_resume(FAR struct tcb_s *tcb)
sched_note_add(&note, sizeof(struct note_resume_s));
}
#endif
#ifdef CONFIG_SMP
void sched_note_cpu_start(FAR struct tcb_s *tcb, int cpu)
@ -529,6 +531,7 @@ void sched_note_cpu_started(FAR struct tcb_s *tcb)
sched_note_add(&note, sizeof(struct note_cpu_started_s));
}
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
void sched_note_cpu_pause(FAR struct tcb_s *tcb, int cpu)
{
struct note_cpu_pause_s note;
@ -607,6 +610,7 @@ void sched_note_cpu_resumed(FAR struct tcb_s *tcb)
sched_note_add(&note, sizeof(struct note_cpu_resumed_s));
}
#endif
#endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION
void sched_note_premption(FAR struct tcb_s *tcb, bool locked)