sched: move SCHED_INSTRUMENTATION_xxx to note Kconfig
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
43cc4bd7bf
commit
ca5fcc58c2
@ -3,6 +3,164 @@
|
|||||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION
|
||||||
|
bool "System performance monitor hooks"
|
||||||
|
default n
|
||||||
|
select SCHED_SUSPENDSCHEDULER
|
||||||
|
select SCHED_RESUMESCHEDULER
|
||||||
|
---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);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
If CONFIG_SMP is enabled, then these additional interfaces are
|
||||||
|
expected:
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
NOTE: These are internal OS interfaces and are called at very
|
||||||
|
critical locations in the OS. There is very little that can be
|
||||||
|
done in these interfaces. For example, normal devices may not be
|
||||||
|
used; syslog output cannot be performed.
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_EXTERNAL
|
||||||
|
bool "System performance monitor endpoints are external"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
When this option is enabled, the board specific logic must implement all
|
||||||
|
callbacks listed in SCHED_INSTRUMENTATION, SCHED_INSTRUMENTATION_CSECTION,
|
||||||
|
SCHED_INSTRUMENTATION_SPINLOCKS, SCHED_INSTRUMENTATION_SYSCALL and
|
||||||
|
SCHED_INSTRUMENTATION_IRQHANDLER. Otherwise the common code will implement
|
||||||
|
these callbacks and packet the arguments into note_ struct. Then the board
|
||||||
|
-specific logic just needs to implement one callback:
|
||||||
|
|
||||||
|
void sched_note_add(FAR const void *note, size_t notelen);
|
||||||
|
|
||||||
|
and send the data to the suitable transport hardware.
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_CPUSET
|
||||||
|
hex "CPU bit set"
|
||||||
|
default 0xffff
|
||||||
|
depends on SMP && SCHED_INSTRUMENTATION_FILTER
|
||||||
|
---help---
|
||||||
|
Monitor only CPUs in the bitset. Bit 0=CPU0, Bit1=CPU1, etc.
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_PREEMPTION
|
||||||
|
bool "Preemption monitor hooks"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Enables additional hooks for changes to pre-emption state. Board-
|
||||||
|
specific logic must provide this additional logic.
|
||||||
|
|
||||||
|
void sched_note_premption(FAR struct tcb_s *tcb, bool state);
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_CSECTION
|
||||||
|
bool "Critical section monitor hooks"
|
||||||
|
default n
|
||||||
|
select IRQCOUNT
|
||||||
|
---help---
|
||||||
|
Enables additional hooks for entry and exit from critical sections.
|
||||||
|
Interrupts are disabled while within a critical section. Board-
|
||||||
|
specific logic must provide this additional logic.
|
||||||
|
|
||||||
|
void sched_note_csection(FAR struct tcb_s *tcb, bool state);
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_SPINLOCKS
|
||||||
|
bool "Spinlock monitor hooks"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Enables additional hooks for spinlock state. Board-specific logic
|
||||||
|
must provide this additional logic.
|
||||||
|
|
||||||
|
void sched_note_spinlock(FAR struct tcb_s *tcb, FAR volatile spinlock_t *spinlock, int type)
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_SYSCALL
|
||||||
|
bool "System call monitor hooks"
|
||||||
|
default n
|
||||||
|
depends on ARCH_HAVE_SYSCALL_HOOKS
|
||||||
|
---help---
|
||||||
|
Enables additional hooks for entry and exit from system call.
|
||||||
|
Board-specific logic must provide this additional logic.
|
||||||
|
|
||||||
|
void sched_note_syscall_enter(int nr, int argc, ...);
|
||||||
|
void sched_note_syscall_leave(int nr, uintptr_t result);
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_IRQHANDLER
|
||||||
|
bool "Interrupt handler monitor hooks"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Enables additional hooks for interrupt handler. Board-specific logic
|
||||||
|
must provide this additional logic.
|
||||||
|
|
||||||
|
void sched_note_irqhandler(int irq, FAR void *handler, bool enter);
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_DUMP
|
||||||
|
bool "Use note dump for instrumentation"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Use note dump for instrumentation.
|
||||||
|
|
||||||
|
void sched_note_string(FAR const char *buf);
|
||||||
|
void sched_note_dump(uint32_t module, uint8_t event, FAR const void *buf, size_t len);
|
||||||
|
void sched_note_vprintf(FAR const char *fmt, va_list va);
|
||||||
|
void sched_note_vbprintf(uint32_t module, uint8_t event, FAR const char *fmt, va_list va);
|
||||||
|
void sched_note_printf(FAR const char *fmt, ...) printf_like(1, 2);
|
||||||
|
void sched_note_bprintf(uint32_t module, uint8_t event, FAR const char *fmt, ...);
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_HIRES
|
||||||
|
bool "Use Hi-Res RTC for instrumentation"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Use higher resolution system timer for instrumentation.
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_FILTER
|
||||||
|
bool "Instrumenation filter"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Enables the filter logic for the instrumentation. If this option
|
||||||
|
is enabled, the instrumentation data passed to sched_note_add()
|
||||||
|
can be filtered by syscall and IRQ number.
|
||||||
|
The filter logic can be configured by sched_note_filter APIs defined in
|
||||||
|
include/nuttx/sched_note.h.
|
||||||
|
|
||||||
|
config SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE
|
||||||
|
hex "Default instrumentation filter mode"
|
||||||
|
depends on SCHED_INSTRUMENTATION_FILTER
|
||||||
|
default 0x3f
|
||||||
|
---help---
|
||||||
|
Default mode of the instrumentation filter logic.
|
||||||
|
Bit 0 = Enable instrumentation
|
||||||
|
Bit 1 = Enable switch instrumentation
|
||||||
|
Bit 2 = Enable syscall instrumentation
|
||||||
|
Bit 3 = Enable IRQ instrumentation
|
||||||
|
Bit 4 = Enable dump instrumentation
|
||||||
|
Bit 5 = Enable collecting syscall arguments
|
||||||
|
|
||||||
|
endif # SCHED_INSTRUMENTATION
|
||||||
|
|
||||||
menuconfig DRIVER_NOTE
|
menuconfig DRIVER_NOTE
|
||||||
bool "Note Driver Support"
|
bool "Note Driver Support"
|
||||||
depends on SCHED_INSTRUMENTATION
|
depends on SCHED_INSTRUMENTATION
|
||||||
|
157
sched/Kconfig
157
sched/Kconfig
@ -945,163 +945,6 @@ config SCHED_CPULOAD_TIMECONSTANT
|
|||||||
|
|
||||||
endif # SCHED_CPULOAD
|
endif # SCHED_CPULOAD
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION
|
|
||||||
bool "System performance monitor hooks"
|
|
||||||
default n
|
|
||||||
select SCHED_SUSPENDSCHEDULER
|
|
||||||
select SCHED_RESUMESCHEDULER
|
|
||||||
---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);
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
If CONFIG_SMP is enabled, then these additional interfaces are
|
|
||||||
expected:
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
NOTE: These are internal OS interfaces and are called at very
|
|
||||||
critical locations in the OS. There is very little that can be
|
|
||||||
done in these interfaces. For example, normal devices may not be
|
|
||||||
used; syslog output cannot be performed.
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_EXTERNAL
|
|
||||||
bool "System performance monitor endpoints are external"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
When this option is enabled, the board specific logic must implement all
|
|
||||||
callbacks listed in SCHED_INSTRUMENTATION, SCHED_INSTRUMENTATION_CSECTION,
|
|
||||||
SCHED_INSTRUMENTATION_SPINLOCKS, SCHED_INSTRUMENTATION_SYSCALL and
|
|
||||||
SCHED_INSTRUMENTATION_IRQHANDLER. Otherwise the common code will implement
|
|
||||||
these callbacks and packet the arguments into note_ struct. Then the board
|
|
||||||
-specific logic just needs to implement one callback:
|
|
||||||
|
|
||||||
void sched_note_add(FAR const void *note, size_t notelen);
|
|
||||||
|
|
||||||
and send the data to the suitable transport hardware.
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_CPUSET
|
|
||||||
hex "CPU bit set"
|
|
||||||
default 0xffff
|
|
||||||
depends on SMP && SCHED_INSTRUMENTATION_FILTER
|
|
||||||
---help---
|
|
||||||
Monitor only CPUs in the bitset. Bit 0=CPU0, Bit1=CPU1, etc.
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_PREEMPTION
|
|
||||||
bool "Preemption monitor hooks"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
Enables additional hooks for changes to pre-emption state. Board-
|
|
||||||
specific logic must provide this additional logic.
|
|
||||||
|
|
||||||
void sched_note_premption(FAR struct tcb_s *tcb, bool state);
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_CSECTION
|
|
||||||
bool "Critical section monitor hooks"
|
|
||||||
default n
|
|
||||||
select IRQCOUNT
|
|
||||||
---help---
|
|
||||||
Enables additional hooks for entry and exit from critical sections.
|
|
||||||
Interrupts are disabled while within a critical section. Board-
|
|
||||||
specific logic must provide this additional logic.
|
|
||||||
|
|
||||||
void sched_note_csection(FAR struct tcb_s *tcb, bool state);
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_SPINLOCKS
|
|
||||||
bool "Spinlock monitor hooks"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
Enables additional hooks for spinlock state. Board-specific logic
|
|
||||||
must provide this additional logic.
|
|
||||||
|
|
||||||
void sched_note_spinlock(FAR struct tcb_s *tcb, FAR volatile spinlock_t *spinlock, int type)
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_SYSCALL
|
|
||||||
bool "System call monitor hooks"
|
|
||||||
default n
|
|
||||||
depends on ARCH_HAVE_SYSCALL_HOOKS
|
|
||||||
---help---
|
|
||||||
Enables additional hooks for entry and exit from system call.
|
|
||||||
Board-specific logic must provide this additional logic.
|
|
||||||
|
|
||||||
void sched_note_syscall_enter(int nr, int argc, ...);
|
|
||||||
void sched_note_syscall_leave(int nr, uintptr_t result);
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_IRQHANDLER
|
|
||||||
bool "Interrupt handler monitor hooks"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
Enables additional hooks for interrupt handler. Board-specific logic
|
|
||||||
must provide this additional logic.
|
|
||||||
|
|
||||||
void sched_note_irqhandler(int irq, FAR void *handler, bool enter);
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_DUMP
|
|
||||||
bool "Use note dump for instrumentation"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
Use note dump for instrumentation.
|
|
||||||
|
|
||||||
void sched_note_string(FAR const char *buf);
|
|
||||||
void sched_note_dump(uint32_t module, uint8_t event, FAR const void *buf, size_t len);
|
|
||||||
void sched_note_vprintf(FAR const char *fmt, va_list va);
|
|
||||||
void sched_note_vbprintf(uint32_t module, uint8_t event, FAR const char *fmt, va_list va);
|
|
||||||
void sched_note_printf(FAR const char *fmt, ...) printf_like(1, 2);
|
|
||||||
void sched_note_bprintf(uint32_t module, uint8_t event, FAR const char *fmt, ...);
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_HIRES
|
|
||||||
bool "Use Hi-Res RTC for instrumentation"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
Use higher resolution system timer for instrumentation.
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_FILTER
|
|
||||||
bool "Instrumenation filter"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
Enables the filter logic for the instrumentation. If this option
|
|
||||||
is enabled, the instrumentation data passed to sched_note_add()
|
|
||||||
can be filtered by syscall and IRQ number.
|
|
||||||
The filter logic can be configured by sched_note_filter APIs defined in
|
|
||||||
include/nuttx/sched_note.h.
|
|
||||||
|
|
||||||
config SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE
|
|
||||||
hex "Default instrumentation filter mode"
|
|
||||||
depends on SCHED_INSTRUMENTATION_FILTER
|
|
||||||
default 0x3f
|
|
||||||
---help---
|
|
||||||
Default mode of the instrumentation filter logic.
|
|
||||||
Bit 0 = Enable instrumentation
|
|
||||||
Bit 1 = Enable switch instrumentation
|
|
||||||
Bit 2 = Enable syscall instrumentation
|
|
||||||
Bit 3 = Enable IRQ instrumentation
|
|
||||||
Bit 4 = Enable dump instrumentation
|
|
||||||
Bit 5 = Enable collecting syscall arguments
|
|
||||||
|
|
||||||
endif # SCHED_INSTRUMENTATION
|
|
||||||
endmenu # Performance Monitoring
|
endmenu # Performance Monitoring
|
||||||
|
|
||||||
menu "Files and I/O"
|
menu "Files and I/O"
|
||||||
|
Loading…
Reference in New Issue
Block a user