diff --git a/sched/Kconfig b/sched/Kconfig index 572d2ecfecd..1ff89697d42 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -920,7 +920,16 @@ config SCHED_INSTRUMENTATION_EXTERNAL bool "System performance monitor endpoints are external" default n ---help--- - Monitor only CPUs in the bitset. Bit 0=CPU0, Bit1=CPU1, etc. + When this option is enabled, the board specific logic must implment 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 need 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" diff --git a/sched/sched/Make.defs b/sched/sched/Make.defs index 57546acdd02..21dd5cc06ee 100644 --- a/sched/sched/Make.defs +++ b/sched/sched/Make.defs @@ -90,8 +90,10 @@ CSRCS += sched_thistask.c endif ifeq ($(CONFIG_SCHED_INSTRUMENTATION),y) +ifeq ($(CONFIG_SCHED_INSTRUMENTATION_EXTERNAL),) CSRCS += sched_note.c endif +endif ifeq ($(CONFIG_SCHED_CRITMONITOR),y) CSRCS += sched_critmonitor.c diff --git a/sched/sched/sched_note.c b/sched/sched/sched_note.c index efbc57abeea..71425b06943 100644 --- a/sched/sched/sched_note.c +++ b/sched/sched/sched_note.c @@ -36,7 +36,6 @@ #include "sched/sched.h" -#if !defined(CONFIG_SCHED_INSTRUMENTATION_EXTERNAL) /**************************************************************************** * Private Types ****************************************************************************/ @@ -611,4 +610,3 @@ void sched_note_irqhandler(int irq, FAR void *handler, bool enter) note_add((FAR const uint8_t *)¬e, sizeof(struct note_irqhandler_s)); } #endif -#endif /* CONFIG_SCHED_INSTRUMENTATION_EXTERNAL */